Hello everyone,
the past week I’ve been mostly occupied with technical issues. The sad story game developers sometimes come across. I’ve been working on the game since well over 6 months now. And each time you finish new functionality you come to a point where you want to debug the new features you implemented. That’s what this past week has been mostly about for me.
Basically, ‘Debugging’ is the big word here. Generally most bugs are fixed in a matter of minutes, some however take a bit longer. As was the case this past weekend. Checking your code, making sure it does what it is supposed to. I fix most bugs using just the ‘single player’ functionality of my game. Basically the game is ran as both server and host in 1 game application and you check if everything works as it should. This makes it easy to fix stuff. However, it sometimes makes you forget it’s a multiplayer game. And then you go back to your earlier implemented functionality and you notice it no longer works.
Now, this weekend was special in that I came across a big issue that nearly killed the plan to ever release the game if not fixed. Basically my players could join the server, play, but could never rejoin the server at a later point if they wanted to play again. When rejoining, lots of data was being transmitted between server and client, yet no game objects were ever received on the players end. I then went ahead and investigated, around 15 hours total (Friday , from 10 am in the morning until 6 in the following morning). Taking just a break to have lunch and dinner. When in such a situation i start to feel very uncomfortable as the morning approuches. This doesn’t happen often, a bug I cannot find in any reasonable time frame. But as morning dawned I came to realise my code was bug free.
What option did I left? If my code was indeed bug free… Maybe there was an issue in the Unity3d Engine I use. So I went ahead and started reading the many patch notes from patches that came out since I started using the game engine for my game. And suddenly, in one of the patches, I noticed: ” Networking: ReliableFragmented channel stops working after client has disconnected, then reconnects.” As described in the Unity 5.3.6p1 patch. And this gave me hope. Hope that not all the countless day and nightly hours I’ve put into creating the game were lost. So, I went ahead and looked at the networking class. And indeed, i had implemented a channel as ReliableFragmented. After 15 hours of trying to fix my working code, i just had to remove the channel with 2 mouse clicks and assign some game objects to be communicated over different channels. And indeed, the bug was fixed!
This, in my opinion, is proof that as game developer, and developer in general you need a very broad view on everything that happens. It shows that projects can fail where you do not expect them to. Unity3d, afterall is also a work in progress and in constant development. In this particular case it failed me a bit. However, it was great that they provide nice documentation where you can read about issues that have been noted and fixed in later versions of the engine.
For me, Unity3d, even with this issue has been a great experience. And I’d recommend it to anyone wishing to create a multiplayer experience. In general the HLAPI Unity3d provides makes it very convenient to write a networking game that works and is not susceptible to exploits. (They use server authority) It also allows you to, with sufficient coding of yourself, write a game that will scale well for many many a player.
I’m confident in saying my game servers will be able to host the game for hundreds of players per server. The biggest bottleneck will surely be the speed of the hard drives /SSD’s. I find i can easily keep traffic to any player down to the absolute minimum. The tools are there, you just have to know how to use them.
With that positive note I’ll end my post for today.
Over and out,
see you soon!