Large map support

I’m using a Layered Grid graph because I need support for walkable layers. I also have buildings that can fall over or be destroyed, which can then be walked on. That happens via DynamicGridObstacle.

I’m using a node size of 1, which works well for what I’m doing because my character radius is 2. However, the problem is I also have a fairly large world. 1024 nodes wide and 1024 nodes tall. It takes a long time to scan and I’m concerned about runtime performance as well.

Do you recommend staying with Layered Grid Graph?

By the way, because I support modding I’m doing the scan at runtime. If there was a way to save the results of the scan to disk that would work, since I could do the scan once when the mod is loaded.

Hi

Either a layered grid graph or a recast graph. Probably a layered grid graphs since they are faster to update usually.

You can save graphs to disk. See https://arongranberg.com/astar/docs/save-load-graphs.php

Thanks for the quick answer. My maps do not always have rectangular play areas. For example, I might have one open area, a path between non-navigable mountains, and another open area. Is it possible to connect multiple LayeredGridGraphs to support this without having to waste time and memory scanning the mountains? Or maybe just have one graph, but with large sections masked off as not needing to be scanned?

Hi

It is technically possible to connect two layered grid graphs, however I discourage that as it brings with it its own issues (unless you are careful, it is easy for agents to get confused at the border between the graphs, and it also makes querying for the closest node to points slower).

It is not possible to mark regions as not having to be scanned at the moment unfortunately.
If you want to optimize the graph scanning time, make sure that you are not using a high erosion value as that is relatively slow.