RVO Implementation

Hello,
We are trying to implement local avoidance in our prototype and we are having difficulties understanding the implementation. We are using Unity 5.1.2 and A* version is 3.8.6.

Please check the attached screenshots, the settings of the controller and A* setup is attached along with the issue we are facing when trying to use RVO controller with AIPath. The unit still tries to take a path which should be ignored.

Kindly guide with the right implementation for it.

Thank you,

Couple more screenshots.


Hi

RVO is a local avoidance system which means that it only looks in its immediate surroundings. It does not impact pathfinding at all and will thus not change the path the character tries to follow. What it does is that it will look at the nearby agents and try to find a velocity as close as possible to the velocity it wants to have, while not putting it on a collision course with any other agents (within some small amount of time). In your case I would expect the 2 middle agents in that row to move out of the way from the agent that tries to move between them.
RVO stands for ‘Reciprocal Velocity Obstacles’ and a key part in the algorithm is that all parties act as to resolve the potential collision (hence the ‘reciprocal’). It is possible that your agents in the row are ordered to stay where they are (using a call to RVOController.Move(Vector3.zero) by the AIPath script). With the default settings that will cause the RVOController to become locked (see the ‘Lock When Not Moving’ toggle) and that will prevent it from moving out of the way to let other agents past. You may want to disable that checkbox on your agents if this is a problem.

Hello Aron,
Thank you for the reply, we are prototyping for our RTS. Is it possible to achieve this and maintain the formation intact?

Hi

That is very tricky if you also want that formation to move.

If the formation is stationary and does not move you can use navmesh cutting to cut a hole in the navmesh below those stationary agents. You can attach a navmesh cut component to them and enable it only when they are stationary. You will likely have to disable pathfinding (see the ‘canMove’ and ‘canSearch’ fields on the AIPath script for example) on those agents when the navmesh cut component is enabled to make sure they do not get confused about being outside the navmesh.

I should point out that most RTS games do in fact no do this. Some do to a degree, but many of the popular ones do not. For example in SC2 units are simply pushed out of the way when necessary.

PS: The tile size in your recast graph is very small, and will not give you much improvement over just a grid graph. I would recommend increasing it to say 64 or 128.