NavMeshPathfinder fail rate is very high

Title says it all more or less. I’ve generated a nav mesh, and about 90% of the time the NavMeshPathfinder fails to generate a path. As a test I tried giving it 2 points that I knew for a fact were in the nav mesh and about 90% of the time it still failed. (the points were 0, 0, 0 and 30, 0, 0. There was an obstacle between them.) It’s hard to get the AI of my game to actually move realistically if they fail to have any path to follow 90% of the time. Join that with the fact that it takes about 3 seconds to calculate a path and you get out that it generally takes a good 27 seconds before the AI starts behaving at all, which is much too high. Any help?

When I played with it it didn’t do that really, and I had some relatively complex paths through valleys etc… You sure your navmesh is valid? Maybe you oversee something or see it inverted or so? Its areas, not paths along the lines.

There is a problem with the A* algorithm, the heuristic is being wrongly calculated, feel free to fix it ^^

@shirkit I’d have 0 idea whatsoever where to begin. I could do some research on it but it’d still be nothing near good. :confused:

@normen I have the model appear in scene but it’s as a wireframe. I’ll add a solid material to it to see if there’s some upside down parts or something.

Edit: @normen upon rendering with a solid material, I see no defects. No inversion or anything like that. It looks fine from what I can see. It’s probably something to do with what shirkit said.

You can create NavMeshes in the SDK and make them visible by assigning a simple material (or simply by selecting them with selection highlighting enabled). I also added a cleaned up version of the pathfinder to the AI library in the contribution repo now.
http://hub.jmonkeyengine.org/forum/topic/ai-plugin-now-with-navmesh-pathfinding/

1 Like

Alright. I’ve already got in-game dynamic navmesh generation working that changes with my dynamic environment. All I need now is pathfinding, which hopefully will work with your new code. Thanks!