AstarPath.Scan over multiple frames

Hi,

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 :slight_smile:

That’d be incredibly helpful! I’ve just got around to trying Aron’s update solution with no success. If you could post your changes that’d be awesome :slight_smile:

Aron: which version are you planning on putting this into?

Many thanks

Robin

Hi Robin,

So here is my ScanInternal for RecastGenerator.cs http://pastebin.com/8UaNKz9Y

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());


bool finishedScan = false;
IEnumerator Scan()
{
finishedScan = false;
foreach (var p in m_gameController.AStarScript.ScanLoop())
{
Debug.Log§;
yield return null;
}
finishedScan = true;
}

and I can easily check finishedScan to know the state of the scan :slight_smile:
Hopefully that helps, even if it is from 3.7.x and not 3.8.2.

Let me know how it goes,
Erin

Awesome! Thank you! Will plug that in later :slight_smile:

I am also looking for the same solution for 3.8.2

Anyone has modified script that I can use?

I have tried the code above, but it doesn’t seem to compile…

Any idea Aron? Did anything improve in this matter?

Hi

I have this implemented in my dev version. I could send you a preview version if you want.

Yeap ofcourse! It will really help! you can send it to [email removed] if you want.

nice… NICE! … AWESOME!

Thanks! It does what I need to do perfectly!

Awesome!
I’m glad it works well!

Btw, if you like the package, a rating and/or a review on the Unity Asset Store is a great way to support it :slight_smile:

Is there any possibility I could also get the preview version aswell?

Async graph updates are almost mandatory at this point :slight_smile:

Hi

This exists in the latest beta version (3.8.3). You can download it from http://arongranberg.com/astar/download
It is a pro only feature however.

Hi!

Could someone link me to the documentation about Async scan on the latest builds? I can’t find it so far. Is it included in the Astar.path component?

Hi

Async scanning is included in the latest beta version. Here are the docs: http://arongranberg.com/astar/docs_rvo_fix/class_astar_path.php#a41c928232446156b4b13e097c18918d2

1 Like

Thank you for the response, I look it up!

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?

Hi

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.

You can take a look at the changelogs here
beta: http://arongranberg.com/astar/docs_rvo_fix/changelog.php
latest: http://arongranberg.com/astar/docs/changelog.php

1 Like

Oh ok, yes it was a bit confusing XD, but don’t worry, I’ll download the 3.8.5 right away and test it out!

Thanks!

Hi Aron, I just download the latest PRO 3.x version, PRO 3.8.11 and I’m trying to scan async, but I can’t find the proper documentation.
for this version, The latest version I got acces to the documentation is https://arongranberg.com/astar/docs_rvo_fix/class_astar_path.php#a69a25908bb9a9244e74df95d05001c77

But in the 3.8.11 ScanLoop() doesn’t return an Inumerable, just return void.
Is there something I’m missing?
Thanks as always.

Hi

The ScanAsync method only exists in various experimental forms in some beta versions in the 3.x branch. I think the latest one is 3.8.5 (see similar explanation in the post just above yours). You can find all previous versions on this page: https://arongranberg.com/astar/download (just click the ‘Show older versions’ button).
The finished version of ScanAsync exists in 4.x. Sorry for the confusing version numbers.

Perfect Aron, We will upgrade then to 4.x Pro.
Thanks!