Server Optimisations
For most of you, especially server owners, server performance is a huge topic. For this reason, I've compiled this report on our effort to optimize the server performance during BETA/1.0 release, and the improvements we achieved in January.
After the Christmas holidays, we've made several server FPS measurements. In a nutshell, these were our results:
After profiling the servers, we've identified several problems.
The first cause of this decline in performance was tied to the despawning system. Its task is to despawn entities on clients when they are outside of the network bubble. This despawn routine was called once every 3 seconds. During the BETA stage, we've found a pretty ugly bug within this system, so we decided to call the despawn routine with every network simulation tick. This naturally puts more load on the server.
Another cause of performance drops is tied to the animation LOD system and AI counts. In one of the previous Status Reports, I've mentioned that we were working on an animation LOD system, which should optimise the evaluation of animations on the server.
This evaluation phase was accelerated 4 times with the LOD system, so we decided to double the AI counts as a followup. Although the performance of the animation evaluation was correct, the increased AI count had an impact on the AI (brain) simulation and on its replication processing (the construction of gamestate update data for every player) . This, unfortunately, had a severe impact on performance that was made even worse with higher numbers of connected players.
And finally, the new input system we've introduced during the BETA development stage made the input processing on the servers worse, too. We can say that what we've gained by animation LOD system on player's animation evaluation, we've lost by the new input system.
Because of that, on January 17th, we've released a Stable Update with these improvements:
Despawn system - despawn routine is called once per 3 seconds, as it was before
Attached lights - we were still using an Arma legacy system for updating light positions, which we don't really need on the server - we removed it completely
AI step noises - when moving, every AI entity was making noise that players and other AI entities could hear - we removed the AI to AI footstep hearing completely as this has minimum impact on gameplay, it was basically just creating interactions between animals and infected, and for creating those, we think the AI to AI vision triggers are enough. Players can still hear AI footstep noises of course.
The followings are the results from the above mentioned Stable Branch update (measurement was done on a machine running 3 instances of the game server):
Although the performance has improved a lot or has significantly improved, you can see how it goes down with more connected players. That's why for today's 1.01 Experimental, we've introduced more optimisations:
AI targeting system - we optimised the routine for getting a target list - now it should be much more independent from the connected players count
AI obstacles avoiding - we optimised the avoidance system by removing the unnecessary calls of the expensive function for getting positions on the navmesh - this function is called only when it's needed
Replication system - the simulation often marked an entity often marked an entity for synchronization even if it wasn't needed - we've improved it, which will ignore these marks so that the replication system doesn't have to do as much work
Central Economy respawn system -We've optimised the loot/ai respawners to limit its impact on the performance. the loot/AI respawners will affect the performance less.
Of course, the results of our optimisation efforts now need to be properly tested in the Experimental environment under some authentic server load. Please, let us know if you notice any improvements or performance issues (or on the contrary: any specific performance issues)!