A* Pathfinding Project

Path not taking direct route


#1

I couldn’t find an answer here, but when I am pathfinding the RTS units, the path is not a direct route but rather goes to a point on the navmesh.

You can see I clicked a path to the upper right, but the left unit decides to go out of his way -

The path goes to this vert on the navmesh

How can I get it to take a more direct route when there is no obstacle in the way?


#2

Hi

I have just uploaded beta version 4.3.2 which adds a straight line of sight check when the funnel simplification option is enabled on the RichAI component: https://www.arongranberg.com/astar/download

For some reason the agents in the RTS demo had funnel simplification disabled which often caused their paths to be less optimal.