-
Rixarn
-
We're still here! Back-End Optimization: Part 2
So, it's been quite a while since I last wrote here and I apologise for that. I've been quite busy juggling between working on the game and other things but here I am. Still, the biggest reason for me not writing as often is because this "optimization" work turned out to be a huge refactor in pretty much all game logic (both in client side and server side) and I was waiting to finish it before writing something. But it's been two months already so...what happened?
Well... I already had a good separation of concerns between render code and simulation code... and still it wasn't good enough once I had to build each turn's snapshot. This is due to the fact that, in order to do a full server authoritative simulation and keep trap of the game state for each turn, you really have to make a careful planning on how you will structure everything. You need to make each "snapshot" unique in terms of memory ownership and also lightweight. And I have to do this twice; once for the C# code and another one for the Go code. Both simulations must produce the exact same result.
Anyway, implementation details will probably bore everyone here. But I must say I've learned a lot doing this and as a result I feel like I'm getting better at writing code. Due to the nature of the problem and the solution it requires I had to become much more sensitive about side effects in functions, memory ownership and other things.
So that said... where are we? Simulation code on the client is basically done. I'm currently porting the same simulation code from the client to the server. Once we have that in place, the real optimization work can begin :) This next iteration of the network code is using a fraction of network resources compared the last implementation and even the last one was already optimized! So rest assured; it's a matter of time for me to finish this.
By the way, new screenshots are coming! We are resuming our work on the pixel art probably this week and we might be able to share some of that in the next post.
Thanks for reading!
Cheers,