As you could imagine, a lot of the components in my game were very entangled with the networking code. For instance, Character Movement was coupled to network code, as character locations need to be synced between different clients. Similar story with game events, like a player dying, or a player picking up an item.
So, switching Multiplayer frameworks is a pretty drastic switch. Given the amount of rewriting required, this pretty much amounted to starting from scratch.
In my experience, starting a side project over is pretty much a death sentence for the project. It usually ends up requiring you to implement a bunch of stuff you’ve already done, with make staying motivated hard . Also, in the course of any project like this, you learn a lot in the early days! And it’s easy to feel like “If I just started over, I won’t fall into all these traps!”. While this thinking is really easy to fall prey to, trucking through, and incrementally fixing your mistakes is usually the way to go.
In this case though, I was going to get two big wins from starting over:
- Being able to have something that was playable over the network on day 1. Since Photon, the framework I’m using now, has a hosted product, it was very easy to get two clients to connect, where with Mirror I was possibly months away.
- Making the game browser-first. When developing in Unity, developing for the desktop is the easiest thing to do – you’re already at your computer. Starting from scratch, I was able to configure the game to run as a WebGL game. This is going to make distribution way easier for the initial players of this game!
It’s pretty awesome to have a game that I can play on my browser (I still have yet to give it test-run with real humans), and I feel pretty vindicated in my decision.