Agents are taking weird path

  • A* version: 5.3.8
  • Unity version: 6000.0.30f1

Hi,
Replace NavMesh by A* Pathfinding Project in pro version.
I am using a Grid configure like that (I tried multiple parameters, especially for ‘Diameter’ but I finally use 0.25 because it’s my agent size for this test) :


And my agents are configure like that :

The thing is my agents are sometime taking realy weird path, not the shortest they could.
Here is an example :
azeaze
The scene during debug

sllslslsls
Here I draw the situation, the blue outlined agent have destination green cross, and he take the red arrow as path instead of just passing by the left of the agent just below him.

Note that if I clic far Did I miss something ?

Here is the basic code I use to perform movement :
private void StartMovementToTarget(Vector3 target)
{
aiPath.destination = target;
aiPath.isStopped = false;
aiPath.SearchPath();
}

After a some debugging & testing I find out that disabling “Stop when destination is crowded” helped a lot to fix this particular problem, but I don’t understand why because the destination is not crowded (there is no agent at the destination).

Sorry for newbie question, I had setup all of these by following documentations & now I am experiencing, the main idea is to create a system of pathfinding like warcraft 3 :smiley:
If I miss a documentation on this, thanks for sharing it to me.

Thanks a lot for your advise :fire:

Do the four characters lined up under the blue-circled character not have an AIPath component attached to them? Also try it without the RVO Controller enabled to see if that may be causing an issue.

Hi,
They all have the same configuration as exposed in my screen.

Hi

Since you have “Locked When Not Moving” enabled on your agents, the local avoidance system will be somewhat limited and the agent will have to move around the agents. When figuring out in which direction to move around an agent, the local avoidance system only uses very local information and no global pathfinding. It is also biased towards passing agents on the right to break symmetries (RVO Simulator Component → Symmetry Breaking Bias). So it’s not at all guaranteed to pick the shortest path in this case.