Long navigation path issue

Hello!

I have an issue with the long paths for pathfinding: I use “FindPathToLocationSynchronously” function in C++ implementation to find my custom pawn’s path and it works fine until I place the pawn far enough. I thought that the path just didn’t exist, however it looks like if I place my pawn just a bit closer it starts to navigate correctly.

It is demonstrated well on the pictures below. Is it a bug or I’m missing some “max path length” settings there?

  1. Path is not found

  1. Path is found very well after just slight movement

The path length is about 41600 cm in the second case.
The engine version I use is 4.7.6.

Thank you in advance!

The limit is not on the path length, it’s on number of navigation nodes processed while looking for it. In general it’s not recommended to search for long paths with A* since pathfinding cost grows exponentially with pathing distance.

But if you really wanted to do that you can modify the node-pool size used by A* by changing RecastNavMesh.DefaultMaxSearchNodes. It’s not exposed anywhere so you’d need to add it to DefaultEngine.ini, like so:

[/Script/Engine.RecastNavMesh]
DefaultMaxSearchNodes=4096

The default value is 2048.

Cheers,

–mieszko

Knowing the cause of this problem I’ve changed navmesh properties to have less navigation nodes total. It worked for me for now. Thank you!

Hi!
I’m trying to find a way to tell my AI to take the longest path instead of the shortest path,
Is there a way to do it via blueprints?