Search Unity

Question What techniques do I need for large amount (200) of moving enemies with decent performance?

Discussion in 'Getting Started' started by oncegolden, Dec 28, 2022.

  1. oncegolden

    oncegolden

    Joined:
    Dec 18, 2022
    Posts:
    1
    Hello everyone,

    i recently switched to Unity and got a nice barebone for my third person game working. Essential for my game would be having waves of up to ~200 on screen moving enemies. I made a little test scenario with 200 Navmesh Agents that move towards a point through a little maze. Working kind of fine with cubes as meshes with ~65fps. When I switch to the robot mesh from the 3rd Person Template with 20k polygons the fps drop under 25. Kinda interesting that theres is not much of a difference in fps between 100 and 200 agents.

    Having 200 Agents with 20k polygone meshes without optimization is obviously not a good start, that much I know. I searched the net and found serveral techs and keywords that could help or not.
    • Combine Meshes
    • GPU Instancing
    • ECS
    • something entierely different?
    For the first two I couldnt find any good tutorials that deal with moving agents/meshes, therefor I have no idea if these are really useful for my usecase. DOTS/ECS looks like a huge and complicated new topic, but I guess its powerful.
    My main problem seems to be the the meshes. What would be the right direction to optimize?

    TLDR:

    It would be really helpful if somebody could point me into the right direction what techniques are needed to handle large amounts of chasing/moving enemies in a 3d game and how to lessen the burden of having that many "detailed" (guess could lower to about 5k polygons) meshes.

    Thank you for your time!