I want my game to have the ability to have massive amount of units.
I’m talking about armies of hundreds of units each with his own AI and functionalities.
At the moment I have a monster with 9 LODs which has it lowest level as about 900 polygons I think.
Even on a strong computer I’m getting low FPS when having about 60 of them shooting around fireballs and fighting each other ( fireballs has a sphere of about 10 polygons and a particle system ).
Any good general advices?
like, on 3rd LOD it should be sprite. 4 polygons of pure performance
But those enemies are animated…
Creative Assembly has builded their own engine for the Total War games, to especially support many units. And I do think they do some tricks to achive this.
However maybe some points for help:
1. Profile your game and check which is taking most processor time.
Does your units use CharacterMovementComponent? I heard it could be quite costly for many units. Maybe you need to use a simpler MovementComponent or a custom solution.
I was told object pooling isn’t as needed with UE4 as with other engines or target platforms. However if you spawn a lot of fireballs, maybe it could help. (Again I’m not sure if UE4 handles this out of the box.)
Reduce the number of bones for your lower LOD’s. Furthermore I don’t think it is needed to have 9 LOD’s. It ‘could’ increase overhead of the frequenter swaping of meshes.
Not testet, but I think reducing the amount of transitions per frame could help to improve performance. You can find it in the detail panel of your state machines.
How often are you calculating the logic for the AI? Maybe it could be of benefit to increase this interval for farhter away units, and thus also delaying the event tick for those units.
No need for. Looking forward to hear how far you could increase the performance of your game.
Thanks this is a great article.