I optimized our trees this week. Turns out the biggest performance hit came from tree culling, which in our case was done by the Unity terrain system. I replaced this with a custom culling system and saved more than 2.5ms every frame on my machine.
LOD Bias Exploit
While optimizing tree performance I also took on another issue that has been plaguing us for quite some time. People playing on low graphics settings, specifically extremely low LOD biases, had a significant advantage over other players since trees and bushes turned into billboards or even disappeared far earlier for them. This is now finally fixed.
I added a tree quality slider to the main menu performance options that simplifies the tree geometry, but the billboard and culling distance is now guaranteed to be fair across the board.
Player Damage Verification
Last week I prototyped a system to ignore damage from players that recently received anti-hack violations or intentionally lagged out, but I only enabled it on one official server to test the waters. This system is now enabled by default on all servers and should help make various exploits less abusable. The current configuration is probably too far on the safe side and is mostly meant to prevent a number of high profile networking delay exploits, but I’m planning to punish a bit more loosely once we’re certain everything is working as intended.
After getting rid of the major tree performance bottleneck I started working on a new batching system that will go far further than the current batching we’re doing for the low building LODs and shadow caster meshes. My plan is to be able to batch all levels of detail on all our static meshes (buildings, rocks and potentially even trees) in an easy to use, high performance way. Sadly I didn’t manage to finish it in time for this week’s update, but I wanted to mention it nonetheless since if everything works out this should be a significant step towards improving performance.
- Fixed being unable to upgrade foundations with a turret on them
- Fixed being able to jump higher when standing in water
- Fixed light LOD performance regression from dungeons
- Fixed shelves being unplaceable on certain triangle floors
- Fixed bleeding damage lag exploit
I should really take some time off over the holidays, but knowing myself I imagine I’ll continue working on the new batching system in order to get it out the door early next year.