RVO agents overlapping

Hi,

I’m using AIPath + RVOController on a Recast graph but I’m having trouble getting the local avoidance to work consistently. I’m testing with no more than 10 agents.

The agents will attempt to move out of the way, and some of the time they do, but if they intersect at all they just stop trying to move out of the way and pass through each other. I have no problem at all with some intersection of units I just don’t like that they completely stop trying to avoid each other once they do. I’ve been playing around with various settings but can’t seem to get it to work as expected.

Is this expected behavior? Does the RVO simulation give up as soon as 2 agents intersect? Are there specific settings I can use to avoid this?

Ideally I want the agents to not be able to pass through each other at all, sort of like 2 character controllers can’t pass through each other.

I’m currently at work so I can’t post any videos of the issue. I can do so later if you need to see an example.

Thanks
Patrick

Hi

Try to increase the “incompressibility” field on the RVOSimulator component, the higher it is, the more they will try to avoid each other while intersecting.

I tried raising it a little (around 60) and then quite a lot (999) and it didn’t seem to make that much difference.

The avoidance it actually pretty good when agents are moving in opposite directions but they overlap a lot when moving as a group. I just find it odd that they stop trying to avoid each other as soon as their RVO radii intersect and don’t try to avoid each other again until they separate.

Can you verify that what I’m seeing is normal for RVO? I do intend to add some better group movement behaviors to avoid clumping in the first place but I just want to make sure I get the best out of RVO first.

Hi

When they do overlap, they switch to using some different math which is why there might be a visible switch, but the incompressability should make them avoid each other and not overlap.

http://arongranberg.com/astar/webplayer?p=rvo

Could you post a screenshot or video of what you are seeing also the settings that you are using could be interesting.

Here are the images with the settings and videos showing the issue. The Unit AI im using is basically the same as the mine bot ai in the examples.

Rvo Sim settings

Rvo agent

video 1

video 2

Hi

I cannot see anything wrong with those settings (except maybe that the Agent Time Horizon is a bit large, a value of 5 will make it try to avoid the character when it can see a collision in less than 5 seconds, which is quite a lot, try to reduce it to 1 or 2, I don’t think this is what is causing the problem though).
I assume those 1m cubes are actually 1 world unit?

Is it possible for you to zip up a small example project which I could take a look at.

Sure. I can invite you to my repo on bitbucket or send a zip if you prefer. Can you send me your email address?

PM sent

Hi

I upgraded to the latest version (3.5.2) of the system, and they do not seem to be intersecting each other now.
That is a bit odd though because the only thing I have changed related to RVO has to do with a compiler bug (unity on osx didn’t throw an error because a struct was uninitialized when the control left the constructor)…

Btw, I would advice you to rewrite the scripts a bit so that the characters will turn towards their actual velocity (can be got from the RVOController script) instead of their desired velocity. Right now it looks like they are just being pushed aside, but if you make them face their actual velocity it will look like they are avoiding the other characters more.
Also, I think you should increase the Neighbour Dist variable, set it to 3-5 or something, that will give the agents more time to react.

Ok I figured out why my code wasn’t working. There was a compile issue with the RVOAgent VO struct in Visual studio 2012. It was complaining about the VO struct not being fully assigned before returning if it entered the
// Collision? if ( center.magnitude < radius ) { block near the top. Unity seems to run fine but since VS complained I must of commented out the return statement a while back.

Thanks for your help in testing this. Sorry for the hassle since it turned out to be an issue on my end. It might be worth updating the code so VS compiles correctly though.

Works as expected now.

I will have to mess around with the rotation and animation code a little. Thanks for the suggestion.