Avoidance system like in "Final Fantasy XIV" (video example attached)

Hi. I’m want to replicate avoidance system used in Final Fantasy XIV.
I’ve attached video bellow, where you can visualy understand how it works.

Video: FFXIV Avoidance system example

Lets summarize it in text now:

When mobs are too far away from player to attack it, they start to chase player. While they are chasing, “avoidance” does not work at all - so even 10 mobs can be stacked in one position.
But once a mob are close enough to player, he stops chasing, attacks player and enable “avoidance system”.

So what we know:

  • Avoidance system should have availability to being turned on/off when needed.
  • Type of avoidance. When “avoidance system” starts to work in crowd of mobs, they do not immediately push neighbours outside from their models. It happens relatively “slow”.
  • Obviously, “avoidance system” does not push mobs to unwalkable areas (e.g. outside of graph or to unwalkable nodes).

I’m using Recast graph, but I can consider switching to Navmesh if needed.

Can you please point me out how can I implement described behaviour?
My current idea is to detect “collision” between mobs and then push them out from each other each frame, checking if “destination” of this push is walkable node (and if is unwalkable - locate nearest walkable node and change vector of push there). “Push” apply to mob “transform”, without using AStar classes

Okay, I managed to do this simply by calling AIPath.Move(direction); when I detect “collision” between two agents.

I also need to set AIPath.constrainInsideGraph = true; in order for agents not to being pushed outside of graph.

So, basic implementation was ridiculously easy. I will let you know if I will meet any issues with it.

Rvo turn on off + increase unit radius over time

1 Like