G1R AngelScript
Scripting reference for the Gothic 1 Remake
Loading...
Searching...
No Matches
FCrowdAvoidanceConfig Struct Reference

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

Public Member Functions

Functions
FCrowdAvoidanceConfig & opAssign (FCrowdAvoidanceConfig Other)

Public Attributes

Crowd
float32 ImpactTimeRange
float32 DesiredVelocityWeight
float32 CurrentVelocityWeight
float32 SideBiasWeight
float32 ImpactTimeWeight
float32 VelocityBias
uint8 CustomPatternIdx
 index in SamplingPatterns array or 0xff for adaptive sampling
uint8 AdaptiveDivisions
 adaptive sampling: number of divisions per ring
uint8 AdaptiveRings
 adaptive sampling: number of rings
uint8 AdaptiveDepth
 adaptive sampling: number of iterations at best velocity

Detailed Description

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.

Member Function Documentation

◆ opAssign()

Member Data Documentation

◆ AdaptiveDepth

uint8 AdaptiveDepth

adaptive sampling: number of iterations at best velocity

◆ AdaptiveDivisions

uint8 AdaptiveDivisions

adaptive sampling: number of divisions per ring

◆ AdaptiveRings

uint8 AdaptiveRings

adaptive sampling: number of rings

◆ CurrentVelocityWeight

float32 CurrentVelocityWeight

◆ CustomPatternIdx

uint8 CustomPatternIdx

index in SamplingPatterns array or 0xff for adaptive sampling

◆ DesiredVelocityWeight

float32 DesiredVelocityWeight

◆ ImpactTimeRange

float32 ImpactTimeRange

◆ ImpactTimeWeight

float32 ImpactTimeWeight

◆ SideBiasWeight

float32 SideBiasWeight

◆ VelocityBias

float32 VelocityBias