recastnavigation: find path enters an infinite loop.
Hi,
My test input as bellow,
float start[3] = { -22.636648178101, 12.46023273468, -123.88012695313 };
float end[3] = { -12.93, 12.08, -110.27 };
float speed = 0.77999997138978;
And the target test navmesh binary as bellow,
If i am trying find a smooth path use these data, i will enter an infinite loop from a iteration. From smooth_path_count_ = 17, the loop keeps give me bad point (-14.4847, 12.4086, -113.422).
Is there any hints for me?
Thanks
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (15 by maintainers)
Commits related to this issue
- Add guard check against infinite loop in detour. Ref https://github.com/recastnavigation/recastnavigation/issues/343 — committed to jackpoz/recastnavigation by jackpoz 5 years ago
- Add consistent input validation to dtNavMeshQuery Validate input values, including that points are finite. This would have saved everyone some time in #343/#373. — committed to jakobbotsch/recastnavigation by jakobbotsch 5 years ago
- Add consistent input validation to dtNavMeshQuery Validate input values, including that points are finite. This would have saved everyone some time in #343/#373. — committed to jakobbotsch/recastnavigation by jakobbotsch 5 years ago
I was able to identify the issue in my project: Line https://github.com/recastnavigation/recastnavigation/blob/master/Recast/Source/RecastRasterization.cpp#L133 gives priority to area types with higher id, making ground with very shallow water be handled as water. This is how area types are defined:
In a particular region we have terrain data from 2 different sources, one has ground and one has liquid. The way the overlap made recast mark some parts as ground and some part as liquid, creating a lot of small polys
If I change the way the flags are prioritized, making ground win against water, I get a clean result.
This is also why I couldn’t reproduce the issue in RecastDemo as the .obj file doesn’t have any area flag data. This issue wasn’t spotted before it didn’t cause any issue as noticeable as the recent infinite loop.