RVO causes agents to freeze

Hi there,

I have a set up where people walk from the road (at the top right of the screenshot attached), to one of the 3 desks, and then after that on to the area at the top left of the screenshot. You can see that a bunch of agents do make it successfully to the top, but many end up simply stuck around one of the 3 initial waypoints.

When I highlight one of the ‘stuck’ agents, I can see that:

  • The Destination field has been updated to reflect the correct final destination (525,0,365)
  • Distance to destination is still large (~100 or so)
  • Paths seem to be successfully calculated from the groups of stuck agents to the final destination (the blue gizmos)
  • Yet nobody moves
  • If I disable the RVO controller on the agents, they will unstick and happily walk to the final destination.

Any ideas what settings I need to tweak to try and get agents to not get stuck like this? Interestingly, this ‘sticking’ happens even if the crowds around the initial 3 waypoints are very small (just 2 agents arriving ~around the same time at the initial waypoints).

Attached is a screenshot of the setup, with one agent highlighted so you can see their RichAI and RVOController settings. Thanks!

Screenshot: Screenshot by Lightshot

Unsure if this is related, but I’m seeing a lot of these in the console, too:

transform.position assign attempt for 'prefabs/agents/passenger-ee33eff0-db0c-489c-bfb2-0ff5f46fd6de' is not valid. Input position is { NaN, NaN, NaN }.
UnityEngine.Transform:set_position (UnityEngine.Vector3)
Pathfinding.AIBase:FinalizePosition (UnityEngine.Vector3) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:789)
Pathfinding.AIBase:FinalizeMovement (UnityEngine.Vector3,UnityEngine.Quaternion) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:742)
Pathfinding.AIBase:OnUpdate (single) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:491)
Pathfinding.AIBase:OnUpdate (Pathfinding.AIBase[],int,Pathfinding.Util.BatchedEvents/Event) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:471)
Pathfinding.Util.BatchedEvents/<>c__DisplayClass14_0`1<Pathfinding.AIBase>:<Add>b__0 (object[],int,Pathfinding.Util.BatchedEvents/Event) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Utilities/BatchedEvents.cs:150)
Pathfinding.Util.BatchedEvents:DoEvent (Pathfinding.Util.BatchedEvents/Event) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Utilities/BatchedEvents.cs:172)
Pathfinding.Util.BatchedEvents:Update () (at Library/PackageCache/com.arongranberg.astar@4.3.47/Utilities/BatchedEvents.cs:184)

Hmm. This might be caused by the new ‘stop when destination is crowded’ feature. Some other users have ran into similar issues (though not NaNs, I’m not sure where those are coming from). Can you try to disable it and see if that changes anything?

Certainly! I’ll try later and get back to you.

By the way, what’s the best way to read the ‘Destination is crowded’ bit in code? I’d like to detect if agents reach the crowd of agents around the destination so I can update their AI, even if they’re not exactly at the destination lat/long.

Hey Aron,

I can confirm disabling ‘stop when destination is crowded’ fixes the issue. Agents do not appear to be getting stuck now. Of course, now I have the secondary problem of swirling crowds of agents when the destination is actually crowded, but that’s secondary at this point :sweat_smile:

Re: errors I’m seeing on the console, with ‘stop when destination is crowded’ OFF, I still see a bunch of:

Look rotation viewing vector is zero
UnityEngine.Quaternion:LookRotation (UnityEngine.Vector3,UnityEngine.Vector3)
Pathfinding.AIBase:SimulateRotationTowards (UnityEngine.Vector2,single,single) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:694)
Pathfinding.RichAI:FinalMovement (UnityEngine.Vector3,single,single,single,UnityEngine.Vector3&,UnityEngine.Quaternion&) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/RichAI.cs:485)
Pathfinding.RichAI:MovementUpdateInternal (single,UnityEngine.Vector3&,UnityEngine.Quaternion&) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/RichAI.cs:391)
Pathfinding.AIBase:MovementUpdate (single,UnityEngine.Vector3&,UnityEngine.Quaternion&) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:546)
Pathfinding.AIBase:OnUpdate (single) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:490)
Pathfinding.AIBase:OnUpdate (Pathfinding.AIBase[],int,Pathfinding.Util.BatchedEvents/Event) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:471)
Pathfinding.Util.BatchedEvents/<>c__DisplayClass14_0`1<Pathfinding.AIBase>:<Add>b__0 (object[],int,Pathfinding.Util.BatchedEvents/Event) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Utilities/BatchedEvents.cs:150)
Pathfinding.Util.BatchedEvents:DoEvent (Pathfinding.Util.BatchedEvents/Event) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Utilities/BatchedEvents.cs:172)
Pathfinding.Util.BatchedEvents:Update () (at Library/PackageCache/com.arongranberg.astar@4.3.47/Utilities/BatchedEvents.cs:184)

And only 1 instance, once, of: (down from ~1 instance per frame before)

transform.position assign attempt for 'prefabs/agents/passenger-2c46f3f8-31d3-4bd4-b046-a734b93d0e5d' is not valid. Input position is { NaN, NaN, NaN }.
UnityEngine.Transform:set_position (UnityEngine.Vector3)
Pathfinding.AIBase:FinalizePosition (UnityEngine.Vector3) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:789)
Pathfinding.AIBase:FinalizeMovement (UnityEngine.Vector3,UnityEngine.Quaternion) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:742)
Pathfinding.AIBase:OnUpdate (single) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:491)
Pathfinding.AIBase:OnUpdate (Pathfinding.AIBase[],int,Pathfinding.Util.BatchedEvents/Event) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Core/AI/AIBase.cs:471)
Pathfinding.Util.BatchedEvents/<>c__DisplayClass14_0`1<Pathfinding.AIBase>:<Add>b__0 (object[],int,Pathfinding.Util.BatchedEvents/Event) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Utilities/BatchedEvents.cs:150)
Pathfinding.Util.BatchedEvents:DoEvent (Pathfinding.Util.BatchedEvents/Event) (at Library/PackageCache/com.arongranberg.astar@4.3.47/Utilities/BatchedEvents.cs:172)
Pathfinding.Util.BatchedEvents:Update () (at Library/PackageCache/com.arongranberg.astar@4.3.47/Utilities/BatchedEvents.cs:184)

You can access the experimental (ai as AIBase).rvoDensityBehavior.reachedDestination property.

I’ll investigate why it’s behaving in this way.