I have a landscape with a single navmesh covering the entire thing (52000x52000x6000). In the landscape, I have a bunch of enemies with AI which basically run towards the player when in sight range, and attack the player when in attack range. This works great when I have about 30 enemies. I added about 50 more enemies to bring the total to 80, and now only the latest ~30 enemies I added will move - the original 30 just stand there, motionless. If I delete the newly-added enemies, the original ones magically start working again. If I add another 50 enemies (130 total), then they all stop working again except the ~30 most-recently added.
If I walk near the enemies that can’t move, they attack me, so I know the AI is running. I also checked the behavior tree while running and it’s calling the MoveTo node. I’ve been looking everywhere for some kind of information about a maximum number of actors on a single navmesh or something like that, but I can’t find anything that might suggest what’s broken.
edit: after some more testing, it looks like exactly the 50 most recently-added enemys work, and no others do
note: this works only if your AiController class is inherited from Detour Crowd Ai Controller
Why this controller is used? It is used to allow pawns avoid each other in combat or on the city streets. It’s limited and has affect on the performance.
But you anyway will have to hide npc’s that are not in your view or far from the current player position.
What this limit means? It means that only 50 npc’s can pathfind(move) at one time. It dosen’t mean that there can’t be more than 50 npcs. It can be. But they can’t move together. Only 50 or … the value you set to Max Agents can move at one time.