Skip to content

Starting the Devlog

I decided to start a devlog, I'm about a month into developing my first game and the journey has been interesting and I've learned a lot. Recently I was working through some performance issues that did not quite make sense, but first let me talk about where I am.

I'm using Mongogame since I have an engineering background and the Unity/Unreal tooling has always been a major turn off for me, I'm much more interested in writing code. We'll worry about proper assets when we get to that 😃, people like geometric shapes right?

I've developed a map, and the abiltiy to fly around, shoot projectile and missiles. Ships have health, thrust, energy and it's fully multiplayer with a rudimentary NPC simulator so I could test things without bugging my friends. Hard to get a feel for how the missiles will work without a moving target. I built a simple Admin tool using Avalonia so I could interact with the server, tune game values like linear drag, thrust, damage, I can run simple scenarios like spawning NPCs, and capturing various metrics a little quicker than digging through some OTEL metrics.

Now back to our problem! I logged into the dev server to check some things after my long weekend and noticed I was getting a large amount of rubber banding! I thought some of my changes from before the weekend were to blame, I checked the VM load and it looked ok, after awhile of debugging and some rollbacks and roll forwards. As it turns out the shared compute for my entire stack on my dev box might not be sufficient, and I knew that, but I think the rubber banding was being caused by a neighbor that was sharing the CPU. I cranked up the horsepower and everything worked fine, then I pulled it back to a more reasonable but still modest value and we're back to it!

I have put the finishing touches on a replication interest graph as described in the Unreal docs. In order to get 100 players in a system together to maintain full performance as it turns out might be impossible, the UDP packet budget allows for 1000-1400 bytes, so if your inputs and projectiles exceed that, you cannot maintain the same tick rate and receive all the data, even with compressions and such. So I developed an interest graph to prioritize dangerous projectiles and nearby players, and ensure things of less interest are updated less frequently. It's not perfect but its a deterministic degredation. I'll experiment with delta compressions later, but for now I'm feeling good about this implementation, I don't expect 100 players to be fighting in the same system very often, but if they do, the lower updated entities would at least in theory be the ones you are not focused on.