RVO does not work correctly when the unit is standing still

This is what I need:When a agent is attacking, it remains stationary and does not avoid other agents. However, other moving agents will avoid it.

This is my code:

public void StopMoving(){
  _follower.isStopped = true;
  var rvoSettings = _follower.rvoSettings;
  rvoSettings.locked = true;
  _follower.rvoSettings = rvoSettings;
}

Details of the issue are shown below.

The unit was expected to follow the green path, but it actually followed the red path. Other units are attacking(StopMoving)

I know Local avoidance is inherently local. It does not do any global path planning.

I just need the agent to turn in the correct direction most of the time. Is there a good way to achieve that?

Is there a way for me to tell the agent which direction to turn? For example, to turn right.

This comes up every once in a while and I see you’re already aware of how RVO is local. It’s not really a “pathfinder” so it’s not really suited for this kind of behavior (unless I’m missing some crucial info). You have some options for pathfinding around the standing units– just off the dome, Navmesh Cutting around them when stopped/not a target, assigning a path to units manually that avoids those units, maybe changing SymmetryBreakingBias if you wanna be a little cheat-y/dirty, just switching to another movement script and writing a custom modifier, or just writing a custom movement script– sky’s the limit :slight_smile: Just depends on your use-case and how much work you want to put into it yourself. But yeah this isn’t a case for RVO sadly.

I I tried using NavmeshCut, but it created very small GraphNodes(red triangle) in the scene. These GraphNodes are impassable for normal units, which severely affects their pathfinding.

There’s an option on the navmesh cut to expand it by the unit radius. The end result should be that it cuts the navmesh with a radius of 2x the units’ radii, to ensure other agents can go through any gaps.

@aron_granberg @tealtxgr Thanks a lot, the issue is resolved now! :grinning_face: :grinning_face:

1 Like