What is the best practice for large worlds that change during runtime?
I figured I would generate a graph at the launch of a new save and then save the graph along with the other save data. Then, I would update a small section around things changing in the world as they happened. The first part was no problem, but I’m struggling to get the runtime update to perform. I have tried using different graphs. The most promising one is Raycast, but the runtime update takes 10 seconds or more. I thought updating a small section of a tiled graph within a frame would be doable…
This is how I trigger the update. I figured I hardcode 4 units size for now as all the pieces that may change are smaller.
float updateAreaSize = 4f;
Bounds bounds = new Bounds(updateQueue.Dequeue(), Vector3.one * updateAreaSize);
GraphUpdateObject guo = new GraphUpdateObject(bounds);
AstarPath.active.UpdateGraphs(guo);
World size: 2048x2048
Cell size: 0.25
Tile size: 32
Min region Size: 3
Character radius 0.5
Rasterie terrain and trees
Terrain sample size 3
Am I approaching this wrong? Any suggestion how I can get the runtime update to complete in a reasonable time?