Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

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


    Dec 18, 2022
    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?


    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!