UE4-27 Too many AI creates race condition on perception

When I start putting more than like 30-40 AI on the map at once, there becomes a race condition where it seems arbitrary which ones will percieve the player e.g. When I place 80 enemies in an open area, some will just stare at me while others will shoot. Re-running it, different ones will be shooting/not shooting.

I’ve upped the Max Agents to 150 to support movement for them, but wondering if anyone has any ideas?

Hi, the sight sense has a max number of queries it does per update and priorities them by distance. So if you have too many AIs using sight sense and not increase that number, it will update slower. At some point I set this here in my DefaultGame.ini (since I also have AIs teams)

[/Script/AIModule.AISense_Sight]
MaxTracesPerTick=60

What generally makes sense here, is to implement the team system (if you haven’t already done so), and then change it to only detect hostiles. Otherwise if you have like 80 AIs in your map, each of them also keeps track of each other (so 80 times 80 workload), whereas if they would only need to keep track of the player by sight sense you would just have 80.