Not...
We've been hard at work improving the performance of Primal Hunger. We know that in a competitive Battle Royale every millisecond counts and we want as many people to be able to play our game as possible; regardless of their machine quality.
This has led us down quite the rabbit hole of editing and tweaking nearly every script in the game; sometimes for dozens of milliseconds and sometimes for tenths. It seems tedious but the outcome has been worth it as a build of the client and server have both nearly met our performance requirements.
If you're looking to improve the performance of your game here are some of the biggest performance drainers of our game.
FindObjectOfType
This function is an absolute performance killer. This function runs just fine when there's only a dozen objects in the scene but in our final scene we're looking at several thousand gameobjects causing every call to take forever. You can get away with it in functions run on Start() or Awake() but even these can cause performance dips as new objects are instantiated so we've avoided it all together.
Batching
Speaking of instantiating gameobjects, instantiating gameobjects take a ton of performance. It's not a big deal at the beginning when players are loading in but we needed gameobjects instantiated every frame so we opted for a technique called batching. For those who don't know, batching is when you spawn all the gameobjects you may need in a scene at the beginning and then simply reposition the gameobject or turn it on or off. This makes for longer load times to get into the game but an overall smoother gameplay experience.
These two were the biggest general killers of our performance. Some other issues also plagued our performance but those were more specific to various packages we're using.
We hope this was helpful. Please subscribe for more updates on Primal Hunger and more helpful game dev tip and tricks!
Nick
Comments