RVO Beta Version

I have recently uploaded a new beta version to http://arongranberg.com/astar/download. There are several users who have been having some issues with the rvo system and others who have asked for new features.
I think I have implemented most of it now (though it took longer than I expected). There are also some other nice features such as agent priorities, a better symmetry breaking bias, and improved inspectors and gizmos.

If you try out the new version, I would be really glad if you would comment on how it went and if there are any further issues with it.

I have just been testing it out using my usual game level and got some unusual results.

First one shows one agent (the first one in line) attempting to pass a gap between two stationary agents which turns out he cannot pass through and gets stuck and the other agents when passing the stationary agents below seem to move really slowly like they are “grinding” past if that makes sense here a animation:

Second issue in the next image is when the RVO’s reach their target naturally they are all pushing each other about and something really crazy happens to one of the agents where he flies off the map a few times.

(This is the same play through i just split the images up to reduce file size on the images - you will notice the 4th agent is still stuck between the two stationary agents.

I think the second image can be solved by simply making a more complex target system to avoid two agents having the same target (which i can do myself) but i am pretty sure when they push each other like that the agent shouldn’t fly up and down :stuck_out_tongue:

Further developments:

I increased the speed of my agents from 3 to 10 to see what happened and some interesting behaviours occurred this first image seemed to show a slight improvement:

But then i re-ran the test without changing any values and this happened:

You will notice on this one, one of the agents becomes set to a stationary locked agent at the bottom, the other 3 make it eventually to the target but one of them goes off the map again.

That is completely expected and would have happened in the previous version as well. This is local avoidance, it does not do any kind of global planning. If you need obstacles that they need to navigate around using pathfinding, then you will need to update the graph to take them into account (see also https://docs.unity3d.com/Manual/class-NavMeshObstacle.html which explains pretty much the same thing).

No idea what that is. Maybe a collider issue? If the agents use raycasting to position themselves on the ground, make sure that the raycast mask is not including the layer they are using.

See response to first issue.

Ah i see, just trying to work out how to make those RVO’s that become stationary to act as obstacles, then be back to normal agents when moving again so i can further test some stuff. I presume the NavMeshObstacle component by unity won’t be compatible with recast.

What would be the simplest way to update my recast graph when RVO agents become or start stationary and thus need to be considered obstacles?
I was going to add a nav mesh cutting component to them but that doesn’t seem right as they will go strange if they have to move.

I added some nav mesh cuts to see how things go and i dunno if its just the way i set it up or not but some of the NPCs get stuck near the nav mesh cuts when they all start trying to avoid each other.

Maybe i could send you the project to see if its just my setup or not?


I am not sure where the target points for the specific agents are in that gif, some seem to be doing the wrong thing, but I am not sure because I don’t know where they are supposed to be headed. I would suggest that you disable the RVOController when you have activated the navmesh cut, otherwise you may get the exact same problem as before.

The nav-mesh was on from the start so its basically acting like obstacles - then the agents that are moving calculate a path. It’s basically two groups of moving agents going left to right.

I’ll try disable the RVO when stationary, wondering if there is a callback for when they become locked. That would be useful.

Not sure if this is a decent spot to discuss this… but I linked here from RVO for 2D (and actually purchased the PRO edition of your asset) in order to try 2D RVO. Any documentation on how exactly that’s intended to work? Do we just add the ‘normal’ RVO mesh and give it an X rotation of 90 or is there more to it than that?

What do you mean by RVO mesh?

No movement scripts except AILerp has support for 2D at the moment, and since AILerp is intended to follow paths exactly it cannot use RVO, so currently no movement scripts have support for RVO in 2D. The way you would use it would simply be to set the RVOController.movementMode to XY instead of XZ. The gizmo will change to a circle in the 2D plane to reflect this. Then in the movement script you would call rvoController.SetTarget(whereIWantToMoveTo, desiredSpeed, maxSpeed) to set the desired target point and finally you would get the processed velocity using rvoController.CalculateMovementDelta(Time.deltaTime);

So something like

 rvoController.SetTarget(transform.position + Vector3.up, 1, 1);
 transform.position += rvoController.CalculateMovementDelta(Time.deltaTime);