Endless world, how?

I’ve figured out the basics of A* Pro and have a Grid Graph setup. I also have several NPCs moving around, etc.

But, I want the player to be able to leave the current 512x512 area. What pattern should I follow to do this since A* cannot have multiple instances? I would really like to be able to use A* with a technology such as Spatial.OS, but it does not work with static class systems since it scales to dozens or hundreds of nodes in one giant world (it has no zoning.)

Right now the world is too tiny to be much fun. If I make it larger, the performance suffers greatly. And even then, 1024x1024 or higher is still too small.

Thoughts?

Hi

Check out the example scene called “Procedural” something like that may or may not work for you (your grid has to be smaller for it to have good enough performance, but on the other hand it will follow the player around).

I’m imagining that you have a small grid and when the player gets close to the edge, you move it and re-scan. Sound about right? If so, is there any way to scan asynchronously?

Hi

That’s essentially what the ProceduralGridGraph component will do if you set the threshold high enough.

If you want to implement it manually you could also scan it asynchronous: See AstarPath.ScanAsync.