AStarPath currently contains many graphs together, causing heavy load during the DeserializeGraphs step. I want to improve this behavior.
- If I split the graphs and load only the ones needed in each scene, would this actually improve performance?
If not, are there any recommended alternative optimization approaches?
- Instead of general “functionality,” does the A* Pathfinding Project provide any component-level support for loading graphs individually?
For example, is there a built-in component or system that allows saving and loading separate graph assets independently, instead of keeping all graphs inside a single AStarPath instance?
A* Pathfinding Project version 5.3.7
Hi
You can load graphs using AstarPath.active.data.LoadGraphsAdditive. They’ll still be loaded into the same AstarPath component, but at least you can load them one by one, if you wish.
You might also want to check out the NavmeshPrefab component, which can load a recast-based navmesh on a tile-by-tile basis.
It would improve load performance, and reduce memory usage, but it wouldn’t significantly change runtime performance.
Hi,
Thanks for the clarification!
We are currently using a 2D GridGraph, not a recast-based navmesh.
Is there any equivalent component for loading GridGraphs additively (similar to NavmeshPrefab or tile-based loading)?
Just to confirm — does this mean the DeserializeGraphs step would indeed become faster if we split the graphs and only load the ones needed for each scene?
Thanks again for the help!
Follow up.This is really interesting