I actually have async scanning working in my internal dev version (pathfinding is still paused when the graph is being scanned however). Graph updates on a recast graph are already async, so you can cheat a bit by first scanning the graph and making sure it detects no ground or obstacles (so it will be completely empty) and then request a graph update of the whole graph.
I suspect that to achieve more smooth, or as I calling progressive graph building it may need to make BuildTileMesh(vox, x, z) method itself as a separate coroutine with “yield return null” statement, which might be casted not on every single iteration, but lets say every 10th of 100th iterations.
I just wanted to say thanks for the pastebin it was super helpful and I was able to make my recast graph update async which really helps for building procedural levels. Now the scan can be done in the background which really improves loading between levels.
Thanks!
also gonzorob if Aron’s update solution didn’t work for you I’d be happy to post up what changes I added (although I am a bit behind 3.7.x not 3.8.2) Not sure if they will necessarily be what you’re looking for but it helped my project
I pretty much just followed everything else in Aron’s update solution. But for clarity, in the AstarPath.cs here is my ScanLoop() http://pastebin.com/sZNhFqGh
finally in my application code I have something like this
… where i used to have AstarPath.active.Scan ();
now i have
StartCoroutine(Scan());
EDIT : It seems that the ScanAsync is present in the version 3.8.5, but I am currently using the 3.8.8.1 (pro). And I can’t find it either in the script, nor in the 3.8.8.1 doc. Has it been deprecated? Do I need to downgrade to 3.8.5 in my project?
The version numbers are really confusing right now. Sorry about that.
3.8.5 was a beta, but several features in it were not ready for official release, but some others were, so the beta branch and the release branch diverged a bit. 3.8.8.1 contains some things from the beta, but not all. ScanAsync is one of those things.