Support Forum

Units that can't push will never move around other units

Our units are using the AIPath and RVOController for pathfinding.

If we have one unit that can’t push, i.e. RVOController priority 0 with the other units blocking its path with a priority of 0.5, the unit will not move around these units but just stand in front of these blocking units forever.

The unit computed a path right through the blocking units, but the unit is just too kind to not push them away (as intended by the priority value).

Instead, the player expects that the unit computes a path around these units.

If we assign the priority of 0.06 instead of 0 to that unit, it will succeed in pushing already.
But in our case it’s not desired that the units are pushed away, the unit should walk around them.

If this behavior was implemented, then one might consider using it also for cases where the priority is large enough to push the units away, instead of using it only for this edge case.

In our case pushing away the units is not acceptable because this unit is invisible to enemies. If he was able to push units away, he could push enemies away from their guarding position, which would be a cheat.

Sorry for the late reply.
Hmmm. This is a tricky case. I’m not quite sure how to solve it.
Or rather, I know how to solve it in the beta version, but it would require some code modifications. In particular, in the beta there’s another mode of local avoidance called ‘horizon avoidance’ which is used for locked agents. Your agent essentially wants to consider every other agent to be locked and thus use horizon avoidance for all other agents.
I don’t know of a way to solve it without code changes, though :confused:

Have you figured this out yet?

I read that for Starcraft they use RVO to avoid walking into buildings instead of rebuilding the mesh at runtime. I was wondering if this is the right approach for APP because it isn’t working and this I would think is a pretty obvious use case (RTS).

But maybe I just don’t understand how to set it up? Can you help? Here’s an example of it not working. The unit is trying to get past two trees here, but it gets into this wedge and doesn’t try to recalculate its path:
image

I tried making my recast graph smaller and smaller but it doesn’t help… here are my settings on my main A* GO:

only 2 embedded items allowed in 1 post for some reason… so… continued:

Here’s my settings on my character:

Here’s my settings on my trees I’m trying to avoid (I’ll implement the same on all immobile objects once I figure out how it’s supposed to work):
image

I’m also kinda wondering how I’m supposed to handle objects that are not circular… Like some of my buildings have… rectangular building shapes…

Actually, I just updated to the beta version 4.3.51, and this issue doesn’t exist anymore! :smiley:

So glad that now I am a step closer to wrapping up replacing Unity’s NMA w APP :smiley:

1 Like

I don’t think that’s accurate. The navmesh in Sc2 is definitely updated at runtime.

This is a limitation of local avoidance. It finds the local optimum, not the globally best path. If you have big rocks like this and change often, this is much better handled by navmesh cuts I think. Navmesh Cutting - A* Pathfinding Project
The beta has some tweaks to make avoidance of static obstacles better, though. I’m glad it worked for you in this case, but keep in mind that it might not always find the optimal route around the rocks when just using local avoidance.

1 Like

My character can’t figure out how to get around these trees when I use navmesh cutting:
image

Edit: Actually it was just due to those trees having colliders! Once I removed those, the unit can path through. The only thing that is weird to me now is that the character is larger than the gap between trees (after a test adjustment) but yet is allowed to path through them.
image

The navmesh is always assumed to have been pre-shrunk by the character’s radius. The recast graph does this (using the character diameter in the recast graph settings. Navmesh cuts should also normally be a bit bigger than the obstacles they represent. In the beta version there’s an option to automatically expand the navmesh cut by the agent’s diameter (though it looks like you are using custom meshes for the cuts, and the automatic expand doesn’t work for those).

Thanks for this info man! Hope you’re having a blessed week :slight_smile: