How to prevent multiple AI from trying to walk through a door and getting stuck?

I have a zombie wave spawner and it works fine but when a lot of zombies spawn two or more will start to get stuck as the try to go through the same door or converge on the same nav point link. What could I do to avoid this without having to drastically change my levels? Thanks!

1 Like

You could have a volume that adds each zombie to an array as it enters. Then, you could tell each zombie individually to go through the door, and once the zombie passes the threshold or exits the volume, remove him from the array and tell the next zombie to go.

1 Like

This @vanlacke solution with volume is good and you will use it too for sure, but firstly you should check you basic AI setup.

For example:

  1. your mesh character by default have disabled “Can Ever Affect Navigation” - is false, should be true
  2. maybe your capsule is used instead, it is disabled too by default;
  3. Use CCD (collision settings can help too)

You can check you path (is blocked or not) in many ways. For example: https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/AI/Navigation/UNavigationSystem/TestPathSync/index.html

with decorators DoesPathExists:
https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/NodeReference/Decorators/#doespathexist

If not, you can tell you ai what to do - like nothing, find random location, back to start, back … units etc. I think it will be key.

This in not whole solution, because this is not that easy. You should look for tutorial on youtube or elsewhere, but my tips can help on start I hope.

Here is something more in project settings, I forgot it now :stuck_out_tongue: Check Engine - Crowd Manager in project settings, this is very important too (if you are using Crowd, what can help a lot with many ai).

Don’t forget also to take a look on https://docs.unrealengine.com/latest/INT/Engine/AI/EnvironmentQuerySystem/UserGuide/

2 Likes

Thank you for the in-depth comment. I will try what you have suggested and will post/vote once I know more.