RVO avoidance in vehicle BP

Recently i came across RVO avoidance in vehicle movement component setting and i tried to add it to my vehicle AI and it didn’t work quite well as the AI just spins in circle after avoiding the first pawn in its way.

The way my vehicle AI works is, I set a target location for the AI to go and set the steering and throttle accordingly to help it get to the target actor.
I was already working for a way to get my AI sense collusion round it and avoid it and I am looking for something like this (- YouTube) which is done using RVO avoidance.

243210-ezgifcom-optimize.gif

above file shows how my AI behaves after applying RVO avoidance, the target location is the target actor and red car is the AI obviously. usually it will will find its way to target (i cannot avoid collisions) point if i don’t use RVO avoidance.

I’m just looking at this. My approach is to convert the angle/speed a velocity vector (which is simple enough [theta & speed into 2d velocity vector]), go through the process of changing the velocity to avoid collision and then converting it back into the angle of steering.

The converting back [vector to theta,speed] however is not a simple equation and you need to use numerical methods to do this. I’ve found that the speed converges really quickly (~1 iteration), but no so the angle (~5 iterations). I’ve also found that I need to use double point precision. So this is not cheap. The partial derivatives for angle are quite long as well.

I’m still trying to work out a good system that allows it to respond to a pure sideways movement (suggested by rvo)
which of course is impossible with a car.

My task is for fish, so I’m working on 3d obstacles (which is an interesting task in itself).

I hope this helps and gives you some ideas. I’m just giving pointers so don’t expect anything on github.

My fish video…fish demo