FCrowdAvoidanceConfig

Crowd manager is responsible for handling crowds using Detour (Recast library)

Windows
MacOS
Linux

References

Module

AIModule

Header

/Engine/Source/Runtime/AIModule/Classes/Navigation/CrowdManager.h

Include

#include "Navigation/CrowdManager.h"

Syntax

struct FCrowdAvoidanceConfig

Remarks

Crowd manager is responsible for handling crowds using Detour (Recast library)

Agents will respect navmesh for all steering and avoidance updates, but it's slower than AvoidanceManager solution (RVO, cares only about agents)

All agents will operate on the same navmesh data, which will be picked from navigation system defaults (UNavigationSystemV1::SupportedAgents[0])

To use it, you have to add CrowdFollowingComponent to your agent (usually: replace class of PathFollowingComponent in AIController by adding those lines in controller's constructor

ACrowdAIController::ACrowdAIController(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.SetDefaultSubobjectClass<UCrowdFollowingComponent>(TEXT("PathFollowingComponent")))

or simply add both components and switch move requests between them)

Actors that should be avoided, but are not being simulated by crowd (like players) should implement CrowdAgentInterface AND register/unregister themselves with crowd manager:

UCrowdManager* CrowdManager = UCrowdManager::GetCurrent(this); if (CrowdManager) { CrowdManager->RegisterAgent(this); }

Check flags in CrowdDebugDrawing namespace (CrowdManager.cpp) for debugging options.

Variables

Name Description

Public variable

uint8

 

AdaptiveDepth

Adaptive sampling: number of iterations at best velocity

Public variable

uint8

 

AdaptiveDivisions

Adaptive sampling: number of divisions per ring

Public variable

uint8

 

AdaptiveRings

Adaptive sampling: number of rings

Public variable

float

 

CurrentVelocityWeight

Public variable

uint8

 

CustomPatternIdx

Index in SamplingPatterns array or 0xff for adaptive sampling

Public variable

float

 

DesiredVelocityWeight

Public variable

float

 

ImpactTimeRange

Public variable

float

 

ImpactTimeWeight

Public variable

float

 

SideBiasWeight

Public variable

float

 

VelocityBias

Constructors

Name Description

Public function

FCrowdAvoidanceConfig()

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss