Hello,
I have an issue where occasionally (maybe 1 in 5 times I run the game) nodes that appear to be connected will fail a PathUtilities.IsPathPossible check because the node.Area value they return differs. However, looking at the Graph Colouring Debug, they appear to be in the same area and are not blocked by unwalkable nodes.
If I disable my random “terrain generation” at the start of the game, I can’t reproduce, so I suspect there is something I am doing wrong there when I recalculate the graph with the new unwalkable nodes:
void Start(){
// Create some random mountains, trees etc. IF generating a new world. TODO: an actual system.
if (!PersistentData.CheckLoadFlag())
{
// Generate mountaints.
foreach (Tile tile in mountainSeeds)
{
List<Tile> mountainTiles = ReturnNearestFreeTiles(tile, UnityEngine.Random.Range(3, 6), true);
PlaceableController.CreateTerrainPlaceablesOnTiles(mountainTiles, (StructureObject)Database.GetFurnitureObject(5));
}
// Generate trees.
foreach (Tile tile in treeTiles)
{
PlaceableController.CreateTerrainPlaceablesOnTiles(tile, (PlantObject)Database.GetFurnitureObject(6));
}
// Rescan the grid graph.
AstarPath.active.Scan();
}
}