A* Pathfinding Project

How can I simulate dynamic obstacles like this?


#1

I want to try and simulate the same avoidance as shown in the video. As you can see, at the beginning, the ambulance agent can avoid the two firefighter agents by having to pathfind around them; the firefighter agents are static / not moving. Later on, you can see with other pedestrian agents, the ambulance actually ‘pushes’ those agents away.

I assume this is somewhat like the equivalent of setting the “Lock when not moving” bool to true / false under RVOController, but when trying to do this in my own game (in my case it is a point graph and not a navmesh), my vehicle agent slows down + jitters when trying to pathfind around other agents. I’d like the velocity to be more or less constant.

EDIT: To clarify: I assume I am looking for something that acts more like Navmeshobstacle but for both point and recast graphs (I also use recast graphs in some scenarios).


#2

Sorry, just bumping this. Is there less of an out-of-the-box solution?


#3

If you want the humans to avoid the ambulance you could override the RVO velocity.
Set the RVO Controller.ForceSetVelocity to the velocity of the movement component.

Alternatively take a look at https://arongranberg.com/astar/docs/writing-rvo-colliders.php