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,

all_tiles_navmesh.zip

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

Most upvoted comments

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:

NAV_EMPTY   = 0x00,
NAV_GROUND  = 0x01,
NAV_MAGMA   = 0x02,
NAV_SLIME   = 0x04,
NAV_WATER   = 0x08,

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 image

If I change the way the flags are prioritized, making ground win against water, I get a clean result. image

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.