Detour Crowd Controller AI getting stuck inside one another

Has anyone ran into this issue? If there are a decent amount of AI chasing the player they start sliding inside of one another then move at a crawls pace as if their speed was halved. I’ve tried enabling collision between them. The only solution I’ve found so far is to enable RVO so they basically slide outside of one another but RVO doesn’t respect collisions so they can glitch into walls.

The other issue is their movement is very jittery when chasing the player and the only solution I’ve found is locking their rotation to 90 degrees, but then they turn incredibly slow.

Would appreciate any recommendations on how to resolve these!

Believe I figured out the stacking issue. First I set the AI to block each other in collisions. Next I enable sweeping for collisions while walking in their movement component. Finally I configured the detour crowd project settings to handle collision instead of the movement component. This gives the desired result to prevent them from stacking while also giving the best performance otherwise sweeping while walking gets expensive with too many AI.

Still no solution for the stuttering movement of the AI. Believe it’s the detour crowd controller conflicting with their AITask to move to an actor. Anyone have any ideas besides making their rotation insanely slow?

Has really no one ever had this happen? Seams to be a conflict between “Orient Rotation to Movement” and the detour crowd controller telling the AI to move to avoid each other. I guess it’s not lerping the rotation?

Have same issue, mitigated it a bit by change rotation speed to 150, ground friction to 5-6, braking speed reduced and enabled smoothing in anim blendspace.
It didn’t fix their jittering completely but to some extent

Adjusting the rotation speed reduces it, but it makes rotation extremely rough. As in so bad that the AI is basically walking backwards while trying to turn around. Will explore trying ground friction as I hadn’t tried that yet, but will probably massively mess up my dialed in movement speeds for my AI.

90 is too slow but 150 looks fine to me. Also can try lower speed acceleration a bit.

Tried 150 for rotation and helps some, but still very noticeable jittery movement. Didn’t notice any changes upping the friction or drastically lowering max acceleration. Will keep trying things I suppose. There has to be a way to fix this.

You should lower, not upper the Ground Friction - it reduces speed of direction change.
I use 5-6 for my AI.

If you find more ways on improving it please let us know here)

It does seam to help some. I guess maybe this is all we can hope for is tiny improvements here and there until it adds up enough. Just seams like the crowd control is setting the rotation instead of lerping the rotation.

Wonder if we’re looking in the wrong place. The crowd controller is responsible for these scoped movements so maybe there’s some settings in the crowd controller project settings to adjust this. I don’t fully understand the parameters there yet, but will try tinkering around there.

Also may be worth to check it in C++, maybe there’s some event that can be overwritten like “receive target rotation” or something like that, and you will be able to handle it from there.

Seams like all the logic is in the below files and not the detour crowd controller directly.

https://github.com/EpicGames/UnrealEngine/blob/master/Engine/Source/Runtime/Navmesh/Private/DetourCrowd/DetourCrowd.cpp

https://github.com/EpicGames/UnrealEngine/blob/master/Engine/Source/Runtime/AIModule/Private/Navigation/CrowdManager.cpp

Looks like rotation might be handled in SetAgentMoveDirection of CrowdManager.cpp.

I can’t find any documentation on the Avoidance Config though so it’s difficult trying to figure out how to adjust this. I’d think maybe adjusting the velocity settings there could help prevent or reduce the jittering, but with no documentation this is rough.

Messed with the settings for awhile and didn’t really help. It mainly just changes their spacing, but no real impact on their rotation behavior. Does anyone have any other things to try? Maybe someone from Epic could take a look at this as this feels like an actual bug. Going to try and look for some possible clues in the following component used by the detour crowd controller.

https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/AIModule/Private/Navigation/CrowdFollowingComponent.cpp

I’ve tried everything. Every parameter for movement and every parameter for crowd management. The only parameter that matters is Rotation Rate Z. Nothing else matters. It has to be aggressively set though. 90 giving solid results. 120 giving OK results. 150 jitter is noticeable. I think the only way to further smooth this out is custom movement behavior. If anyone has any ideas would be greatful.

Never found a solution. So for now I’ve set the following.

Rotation Rate.Z = 145

It’s not perfect, but it’s better than having so much jitter going on. Also found a really good documentation on the crowd manager settings if anyone needed help understanding them.

Edit: The documentation link got paywalled. Sorry. Epic please for the love of god hire some people to improve your documentation. I beg of you. Please.

If anyone ever finds a solution then would appreciate if you’d provide your findings!

3 Likes

Believe I figured out the stacking issue. First I set the AI to block each other in collisions. Next I enable sweeping for collisions while walking in their movement component. Finally I configured the detour crowd project settings to handle collision instead of the movement component. This gives the desired result to prevent them from stacking while also giving the best performance otherwise sweeping while walking gets expensive with too many AI.