Ai-Crowd Design Question

Hello,

I have been reading a lot about AI and specifically AI in the Unreal engine over the last week, but I still have many doubts regarding the design approach I should choose for my project.

My aim:

I would like to generate a crowd of 50 - 200 AI-controlled characters that move to seemingly random locations all over the map, stop and interact with each other. It is important that the whole system is designed well and doesn’t eat up insane amount of resources.

My thoughts so far:

  1. Since the system needs to be performant and upscalable, I should probably go for C++ over blueprint.

  2. I have tried to read as much as possible on EQS and the AI-Sensing component (although I find the documentation provide by Unreal sparse) and understand that one solution could be to add a AI-Sensing component to every pawn that checks for obstacles and other pawns in the vicinity but am wondering how effective/performant that would be considering the sheer amount of pawns - and if it would introduce a racing condition if pawns try to navigate through a bottleneck on the NavMesh.

  3. Is it possible to query the NavMesh for all actors on it, their intended paths, predicted collisions etc. ?

  4. I have noticed that there is a Crowd Manager in the Unreal engine itself full of parameters which I frankly don’t understand… is this documented properly somewhere - can this help me?

Thank you for your time!

Try to find more about Detour crowd ai controller it works well. Also, there exist RVO, but visually they move unnaturally. Try yourself.

Thanks for your reply. I am already using the detour ai crowd controller but found that bots run into each other when faced with bottle necks such as doors. Avoidance isn’t applied correctly (maybe i made a mistake here since the documentarion is sparse) and when many bots congregate in the same area pathfinding fails to recognise them as one obstacle and fails.

Yes, I use to use them also. I changed my levels to avoid this issue, turn on some navigation visualizations to see how they find path. If they can’t move your obstacles.

I am not allowed to change the level. The problem is anyways not stemming from bad level design but from bad AI :slight_smile:

I think it isn’t AI problem. Navmesh works bad.

First, I’m not good at English.

UE use recast navigation as far as I know. ( In addtion, UE use physics also. you can select using physics or not. )

So, you can find document about it here. ( GitHub - recastnavigation/recastnavigation: Navigation-mesh Toolset for Games ) or search with ‘recast’

In my case, some object can move in recast navimesh, but stuck at physics like rock or tree. In that case, you should build navimesh again with physics object or make simple terrain mesh for navimesh.

performance is case by case. (but 50~200 should works good)
you can test it with recast demo. (spawn agents, move to target, spawn dynamic obstacle, set region with option like water, door, etc)

Agent can get each collisions, but it takes performance.
Crowd Manager is calculate all agent position with time. ( like unreal Tick(delta) )
If you’re programming in server with recast, I’ll not suggest to use crowd manager.

I think I understood what you wanted to say and I tried the recasting. The problem is, that it takes quite a while since the area is quite large and has a lot of characters moving at the same time so it doesn’t work in my case.

I will try now to add a AI-sense component to the characters and see if I can make it stop every time he sees another pawn and wait - maybe that makes the behavior more realistic… lets see.