I’ve been trying to save my grid graphs at runtime and reload these again as part of my save game system.
As part of my game logic, I place buildings that cut the grid graph and make some nodes unwalkable.
I read the documents and am trying to achieve this using SerializeGraphs() and DeserializeGraphs().
My code is:
graphBytes = AstarPath.active.astarData.SerializeGraphs();
I’ve done some testing and the bytes file is successfully saved and loaded and by tweaking a setting on the graph (max climb) and reloading I can see that the value is reloaded so it seems to be passing the data back into the pathfinding system on load; however, as you can see from the screenshots the unwalkable nodes are no longer saved and instead seem to have some random grid nodes that have become unwalkable.
Is there something more specific that needs to be done to save this data for grid graphs?