Path.ReleaseIfClaimed function and RichPath StackOverflow

I have a test project of just a bunch of RVOController + RichAI agents wandering around. Somewhat frequently I get debug warnings in the log about claiming a path already claimed that comes from line 175 RichAI where it claims and releases the current path. Since the current path is usually but not always claimed it kinda seems like we need a ReleaseIfClaimed function on Path. That seems easy to add but I also don’t see a clear way to add it in without breaking updates.

I’m also getting StackOverflow exceptions from Richpath after turning on Funnel Simplification on a tiled Recast graph. (e.g. line 304 from Trinary). However I can’t actually find any documentation on what tiled impacts on a Recast graphs aside from forum posts and scattered comments in the code. Are there docs I’m missing in case I’m just setting up my graphs wrong somehow?


What version of the system are you using?

The RichAI component definitely should not claim the path twice… hm… it might be caused by the StackOverflow exception though. That will cause it to not release the path at the end of the OnPathComplete function, so it will still be claimed when the code at line 175 tries to claim it.

Best option is probably to switch the simplification mode from Trinary to Iterative, I think I will deprecate Trinary anyway since it is a lot slower than the Iterative one and not really generating better paths. I remember having a lot of trouble with that mode causing stack overflow exceptions, but I thought I had fixed all of them… apparently not.

If you look at your recast graph from above, you will see that it is divided into tiles. Tiles are great for breaking up large triangles (very large triangles next to small triangles often cause very suboptimal paths to be generated) and since tiles are recalculated separately, it is possible to generate a navmesh for a huge world without running into out of memory exceptions. It also makes it possible to update individual tiles during runtime at a lower cost than recalculating the whole graph.

Latest version. I hadn’t realized but yeah iterative doesn’t cause the stack exception just the other two and that stopped the errors about the already claimed path. Thanks for the info on tiled recast.