I’m trying to serialize multiple Tiled Recast graphs into a single byte
My code to serialize:
Pathfinding.Serialization.SerializeSettings settings = Pathfinding.Serialization.SerializeSettings.All;
var sr = new Pathfinding.Serialization.AstarSerializer(AstarPath.active.astarData, settings);
sr.OpenSerialize();
sr.SerializeGraphs(ourGraphs.ToArray());
sr.SerializeNodes();
sr.SerializeExtraInfo();
navmeshBytes = sr.CloseSerialize();
To deserialize i just call this:
AstarData.active.astarData.DeserializeGraphsAdditive(navmeshBytes);
The problem is I get an error
Caught exception while deserializing data.
System.Exception: Guid in graph file not equal to guid defined in meta file. Have you edited the data manually?
bd54c2d975c4790e-a0774d0cf5bac563 != 3f73dce26fca9fef-07d0826595762597
at Pathfinding.Serialization.AstarSerializer.DeserializeGraphs () [0x00118] in JsonSerializer.cs:648
at Pathfinding.AstarData.DeserializeGraphsPartAdditive (Pathfinding.Serialization.AstarSerializer sr) [0x0002f] in AstarData.cs:362
Am I using the serialize functions correctly? Is there a simpler way? can I just save the recasts as meshes, then use TileHandler.RegisterTileType (Mesh source)?
Originally my game had the entire world covered in Tiled Recasts. You helped me a lot and I got it working by using the TileHandler. Unfortunately I need really high resolution (0.1 cell size!) to navigate small corridors in houses. It’s too much data to cover the world, so I am just covering cities areas with high-res Tiled Recasts.
Thanks so much for your help!
-Mark