I received a report from a playtest where someone had a crash, and looking into the player log & crash dump, the crash occurs inside pathfinding code! It appears that somehow an IndexOutOfRange exception occurs in an array lookup in DelaunayTriangle.PointCWFrom(), see screenshot for call stack & (stripped) log.
We’re using 2 recast graphs, mostly for 2 different sizes
We’re using RichAI primarily, but also a few ABPath.Construct() to measure distances
The level may have been reloaded a few times, but crash did not occur right before/after this, but during general gameplay.
Note that this isn’t a crash that occurs all the time or anything, we’ve been using the pathfinding tool in builds for a few months now and haven’t noticed any crashes related to it before.
So in summary if two NavMesh cuts have overlapping vertices. And there are many navmesh cuts with this scenario we end up with the stack overflow crash in Pathfinding.Poly2Tri
If we ensure that no two NavMesh cuts have overlapping vertices then the crash never happens.