Crowd Manager Avoidance Config

I have been working with the detour avoidance system and have been trying to influence how strong the avoidance is so the units will completely veer off if they get really close. That’s when I noticed a section within the Crowd Manager called Avoidance Config. By default it has 4 entries. They are all the same struct with the same values. These are show in the image. I tried looking for it but there really aren’t docs regarding it. If anyone can define what each field does I’d really appreciate it.

1 Like

Just as an update I tried experimenting with this. The only noticeable change seemed to be changing Custom Pattern Idx from 255 to 1. That caused a crash (noticeable)

No idea what these are for but I managed to get detour to work better using C++ via the Avoidance Weight parameter.

Those parameters are only for adaptive velocity sampling, defining possible velocity vectors for next step of simulation. Each entry corresponds to avoidance quality enum: low, medium, good, high

It works by creating a rings patterns around center point and can refine results by spawning next, smaller sets of rings recursively, centered on best sample (AdaptiveDepth times). Each velocity sample is weighted using following conditions: does direction match expected direction on path (DesiredVelocityWeight), does direction match current velocity (CurrentVelocityWeight), does it go sideways (SideBiasWeight), does it collide with any known obstacle (ImpactTimeWeight in scan range: ImpactTimeRange seconds).

Sampling preview, using CrowdDebugDrawing::bDebugSelectedActors + CrowdDebugDrawing::bDrawDebugVelocityObstacles flags from CrowdManager.cpp

CustomPatternIdx param is for creating your own sampling patterns (SamplingPatterns array), but crashing needs to be fixed :slight_smile:

Avoidance Weight is not used by detour’s crowd simulation, but RVO in character movement component. Usually it’s not good to have both system running: they will start colliding with each other.

1 Like

Hi Lukasz, first off Thanks for the awesome description of this. To Enable the crowd managers debug do I need to be using a pull from GitHub to edit the core library? I tried changing the crowd manager to a custom crowd manager (DebugCrowdManager) in a build on the binary but I don’t have access to the CrowdDebugDrawing namespace even though CrowdManager is the parent class.

Just to follow up, I was incorrect I modified SeperationWeight in a custom CrowdFollowComponent not AvoidanceWeight It looks like a lot of the “controls” for detour are in there. Are their plans to expose them in the future?

That is a property of CrowdFollowingComponent. In native code you can change it inside constructor of your AIController class. In blueprints, check default properties of controller class derived from ADetourCrowdAIController, or any other controller using CrowdFollowingComponent for pathing.

How do i set which quality enum i want to use?

when you say

" In blueprints, check default properties of controller class derived from ADetourCrowdAIController"

what property are you referring to? I use a controller derived from ADetourCrowdAIController, but I’m not sure what property you are talking about?

Hello @IceWraith!
I can’t see any default properties in controller from ADetourCrowdAIController and can’t find CrowdFollowingComponent in blueprint version. Crowd is possible with blueprints? How to set up distances between agents etc?
Thank’s

Hello @IceWraith

I have the same issue with the Detour Crowd AI Controller.

I did everything correctly in BP but there are no options for the CrowdFollowingComponent in the Default or any other Section.

May it be possible they aren’t exposed to BPs yet? And if so how I can activate this, since there is really no documentation on how to set up the Detour Ai Controller in C++ either.

Thanks in advance

Cheers

It’s been a while, have you managed to solve this issue?

Hello, I found some documentation about AI Detour Crowd if that can help :
https://subscription.packtpub.com/book/game-development/9781788835657/8/ch08lvl1sec51/detour-crowd

1 Like