We are creating a game with sections that load at runtime, and we need this to happen without any breaks in gameplay.
We we load a new section, we need to load a new graph in that section. If we use saving and loading of a NavGraph, the deserialization causes a lag. If we use a GridGraph, the scan method causes a lag.
We placed the scanLoop method in a Coroutine to slow down grid graph scanning and spread the work over several frames, and that works without causing any lag, but it could end up being too slow for gameplay.
Is there a way to create a basic grid graph by loading the node data for a graph directly into AstarData.graphs? We thought this might be a way to avoid running the scan method. We could then set all the nodes to walkable, and then at runtime use the UpdateGraph method to just update each part of the level as it is loaded. Or would this not give any performance increase?
Also, we wondered if there was a way to strip out some of the functionality of the grid graph if we are creating our own type of graph (that inherits from GridGraph) to increase performance? No matter how many nodes we have in a grid graph, scan time is never less than 16ms, which made us wonder if there was some sort of delay that we could avoid?