Pathfinding returning suboptimal paths
I've been seeing strange results of pathfinding, where the calculated path seems to want to avoid crossing certain polygons on the navmesh, and as such takes long routes going via polygon vertices when it should be evaluating to a straight line. See for example the image below.
The green line is the calculated path. I'm not using any nav areas or cost alterations of any kind. This appears to happen regardless of whether Regular or Hierarchical pathfinding is used. I actually noticed this back around 4.10/4.11, but haven't touched this project since then. I've now updated to 4.13 and the issue persists.
Any ideas? This surely can't be expected behavior.
asked Sep 21 '16 at 10:32 PM in Bug Reports
After speaking to our developers, I have a concrete answer for you:
This is technically not a bug. What's happening is the path is straightened along the navigation corridor. If you have a tiled navmesh you end up with navpoly corners in empty, flat areas sometimes.
Currently, these are the types of paths you're going to get on large empty areas.
There are two ways you can work around this behavior:
Hope that helps, and have a great day!
answered Sep 22 '16 at 06:56 PM
Sean L ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here