Agents Just Stuck On Each Other

Hello,

we have very huge issues with the pathfinding in our project and agents, as they get just stuck on each other in tigher corridors.

This is quite a blocker we would need assistance with, as all our enemy camps are just unusable right now, which is blocking a playable version of our game.

Sending screenshots using DM as agreed.

We are using RichAI agents with RVO Controllers, tried changing every single settings of RichAI or RVO Controller to no avail (e.g. disabling hard collisions on rvo)., the agents just bunch of each other, try to move through each other and get stuck.

We were thinking about navmesh cuts on agents, but this we fear would be hard on performance, as may we have 50-100 agents moving on map at the same time.

Our agent radiuses are roughly from 0.4 to 0.6, the reason being that when we have combat, and like 5 units attack 1 enemy, the 5 units are not stack on top of each other, which would cause setting character radius to lower values, like 0.2.

May we please get assistance with this issue so it works in our project and AI has a good feeling please? As this is really critical for functionality of our AI.

Hi

Are some of these agents locked in place, or are all free to move (theoretically)?

It does look like a pretty tricky case for local avoidance. What many RTS games do is that they use agent prioririties. E.g. large agents will push smaller agents away, and not consider them at all in their local avoidance calculations (you can do this by changing the “Collides With” layer mask on the RVOControllers).

Often it can be better to assign specific positions for the agents to move to. E.g. telling them to move to individual points on a circle around the enemy. This may or may not be suitable for your particular game, though.

1 Like

Hello,

thank you for the reply.

The agents are not locked by our code in any way, only RichAI is moving/locking them via its functionality. Agents were in process of moving to their destinations, however got stuck in this tight corridor (so they were not idle and locked).

The issue with large agents pushing smaller away, is that we may have many similar agents from same prefab, then the issue will again arise that they get stuck, as they will have same priority.

Often it can be better to assign specific positions for the agents to move to. E.g. telling them to move to individual points on a circle around the enemy. This may or may not be suitable for your particular game, though.

This would somehow work when player gives order to attack 1 enemy with selection, but does not work when AI auto attacks other agents, that way they just move to each other to attack (so not as group with single command, but each agent AI for itself).

Then again the same issue would arrive, where some units are on same positions.

So there is no fix or alternative for this? Because for example in starcraft, the agents know they need to circle around completely if some path is blocked by other agents.

Hi @aron_granberg , we encountered the same problem, so there is another approach for this, enemy in auto attack should know the path that they can surround their target

RVO is pretty much useless for our game in it’s current state. Agents get stuck to each other most of the time while wandering. Takes some time for them to get unstuck and keep walking on their original path. If this happens close to a wall they try to walk into walls but can’t and get stuck completely. No matter what settings I try it’s not working. Also tried FollowerEntity but nah. Thinking of getting rid of RVO altogether and handle agent avoidance manually. Maybe context steering can work even though it’s heavy on performance but bad performance is better than NPCs getting stuck

@aron_granberg do you have any plans to improve RVO in close future?

1 Like