stevefsp / critterai

Archive of CAINav Project (Inactive)
MIT License
126 stars 75 forks source link

Exception when Building Navmesh with bvTreeEnabled Set to False #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
An exception will occur in certain cases when building a navigation mesh with 
bvTreeEnabled set to false.

This problem is known to occur when building navigation meshes with off-mesh 
connections. There may be other triggers.

The following exception is thrown in a .NET envornment: 
'System.AccessViolationException: Attempted to read or write protected memory.'

The Unity Editor will crash with an 'Access Violation'.

Workaround: Build the mesh with bvTreeEnabled set to true.

Details:

1. Create a NavmeshTileBuildData object using a constructor that permits 
off-mesh connections.
2. When calling NavmeshTileBuildData.LoadBase(), set bvTreeEnabled to 'false'.
3. Load valid polymesh and detail mesh data.
4. Load one or more valid off-mesh connections using 
NavmeshTileBuildData.LoadConns().
5. Attempt to build the navigation mesh using Navmesh.Build().

Original issue reported on code.google.com by steve...@gmail.com on 8 Dec 2011 at 7:47

GoogleCodeExporter commented 9 years ago
Troubleshooting notes:

The exception occurs at detournavmesh.cpp: line 638. In 
dtNavMesh.closestPointOnPolyInTile()

The cause is an invalid polygon index which results in a pointer referencing 
memory beyond the end of the tile->detailTris array.  During troubleshooting 
the invalid index was being returned by the decodePolyIdPoly() function.  The 
value happened to be the number of polygons in the mesh.  So it was the max 
index + 1.

Original comment by steve...@gmail.com on 14 Jan 2012 at 8:56

GoogleCodeExporter commented 9 years ago
Looks like this was an issue with the Recast code that was fixed in Recast 
Navigation revision 324.

See: http://code.google.com/p/recastnavigation/source/detail?r=324

Will validate when the Recast changes are integrated for the next release.

Original comment by steve...@gmail.com on 5 Feb 2012 at 1:57

GoogleCodeExporter commented 9 years ago
Deployed in v0.4.0.

WARNING: There is a new bug that still prevents use of off-mesh connections 
with bounding volumes disabled.  See issue 26.

Original comment by steve...@gmail.com on 9 May 2012 at 9:12