Hi everyone,
I am working on an Auto-Battler / RTS style game. I am using ADetourCrowdAIController and UCrowdFollowingComponent.
The Goal:
I want RTS-style movement where units find the shortest path around friendly units without losing momentum. If a unit is blocked by a friend, it should smoothly steer around them to get to the target, maintaining its movement speed.
The Problem:
My units are behaving too passively. When a unit approaches a stationary group of friendly units from behind, it slows down significantly (almost to a crawl) as if it is stuck in a “forcefield” behind them.
Instead of maintaining speed and curving around the group to find the open path, they brake and slide slowly.
My Setup:
-
AI Controller: Custom C++ class inheriting from ADetourCrowdAIController.
-
Character Movement: bUseRVOAvoidance is FALSE (Relying entirely on Detour). Max Acceleration is high to keep movement snappy.
-
NavMesh: Agent Radius is set correctly (slightly smaller than capsule).
Here is my current C++ configuration for the Crowd Component. I have set a high optimization range hoping they would look for paths around the blockers, but they still brake.
AMinionAIController::AMinionAIController(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
UCrowdFollowingComponent* CrowdComp = Cast(GetPathFollowingComponent());
if (CrowdComp)
{
// I want them to keep distance, so I have some separation
CrowdComp->SetCrowdSeparationWeight(2.0f);
// Detection range
CrowdComp->SetCrowdCollisionQueryRange(150.0f);
// High value to encourage finding paths "around" obstacles?
CrowdComp->SetCrowdPathOptimizationRange(1000.0f);
// Using Low quality to reduce jitter
CrowdComp->SetCrowdAvoidanceQuality(ECrowdAvoidanceQuality::Low);
// I disabled this hoping it would stop the braking, but the issue persists
CrowdComp->SetCrowdAnticipateTurns(false);
}
}
What I have tried:
-
Increasing PathOptimizationRange to encourage the AI to look for side paths.
-
Disabling AnticipateTurns.
-
Adjusting CollisionQueryRange. Lower values stop the braking but cause clipping; higher values make them brake too early.
The Question:
Is there a specific setting in Detour that controls how aggressively the AI “brakes” when it detects a soft obstacle (like another agent)? I want them to prioritize steering around the obstacle rather than slowing down behind it.
here is also a short video that shows it