It seems like there is a strange error when using MultiTargetPath near the origin point of a GridGraph.
Here is what the ‘reachable squares’ are when using ConstantPath
code for this looks like:
constantPath = ConstantPath.Construct(currentStartPosition, moveRange * multiplier, null); // 1066 // 1040 is better
constantPath.heuristic = heuristic;
constantPath.heuristicScale = heuristicScale;
AstarPath.StartPath(constantPath);
constantPath.BlockUntilCalculated();
This is what it looks like when figuring out a path to each square within the circle sequentially.
with code looking like:
ABPath p = ABPath.Construct(currentStartPosition, potentialPoints[i]);
AstarPath.StartPath(p);
p.BlockUntilCalculated();
pathModifier.Apply(p);
currentPaths.Add(p);
but this is what it looks like when I calculate paths using MultiTargetPath
with code:
mtPath = MultiTargetPath.Construct(currentStartPosition, potentialPoints.ToArray(), delegates);
mtPath.pathsForAll = true;
AstarPath.StartPath(mtPath);
mtPath.BlockUntilCalculated();
Now, I think it’s related to the origin point of the graph (the selected transform in the image above is the origin of a 200x200 grid graph). This is because if I move the obstacles, and re-run the pathfinder, I get the following.
Not sure what is going on, but it seems like a bug (maybe off by one error?)