- A* version: [new System.Version(4, 3, 60);]
- Unity version: [2021.3.45f1]
NOTE: I’ve fixed this issue by updating from 4.3 to 5.2, BUT I have some problems with the update outlined in the last reply if you could please read that, thanks!
Hello, I recently updated my unity version very slightly from 1. 2021.3.5f1 to 2021.3.45f1 for some minor shader updates in a different plugin. I did not change anything in astar project or in my use of the API. Everything seemed fine with it at first, but after testing more I’m now getting a stack overflow issue like this
"System.StackOverflowException: The requested operation caused a stack overflow.\r\n at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_gc_wbarrier_generic_nostore_internal(intptr)\r\n at (wrapper write-barrier) System.Object.wbarrier_conc(intptr)\r\n at Pathfinding.BinaryHeap.DecreaseKey (Pathfinding.BinaryHeap+Tuple node, System.UInt16 index) [0x00083] in C:\\PerforceWorkspaces\\FormationTacticsGame\\Library\\PackageCache\\com.arongranberg.astar@4.3.60\\Core\\Misc\\BinaryHeap.cs:167 \r\n at Pathfinding.BinaryHeap.Add (Pathfinding.PathNode node) [0x00029] in C:\\PerforceWorkspaces\\FormationTacticsGame\\Library\\PackageCache\\com.arongranberg.astar@4.3.60\\Core\\Misc\\BinaryHeap.cs:137 \r\n at Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) [0x00023] in C:\\PerforceWorkspaces\\FormationTacticsGame\\Library\\PackageCache\\com.arongranberg.astar@4.3.60\\Generators\\NodeClasses\\GridNode.cs:262 \r\n at Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) [0x00086] in C:\\PerforceWorkspaces\\FormationTacticsGame\\Library\\PackageCache\\com.arongranberg.astar@4.3.60\\Generators\\NodeClasses\\GridNode.cs:270 \r\n at Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) [0x00086] in C:\\PerforceWorkspaces\\FormationTacticsGame\\Library\\PackageCache\\com.arongranberg.astar@4.3.60\\Generators\\NodeClasses\\GridNode.cs:270 \r\n at Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) [0x00086] in...
and it just keeps repeating like that, so seemingly some issue in UpdateRecursiveG of GridNode. this in turn calls TerminateReceivers() in CalculatePathsThreaded() of PathProcessor.cs, which means all paths after that fail to start, of course breaking everything after that point. I construct the paths like this (ignore hash in brackets of int just for formatting here):
var p = ABPath.Construct(startPosition, endPosition, OnPathComplete);
int[#] tagPenalties = new int[32];
Pathfinding.GraphNode nodeEndPosition = AstarPath.active.GetNearest(endPos).node;
tagPenalties[3] = …
ApplyMovementPathSettings(p, tagPenalties);
AstarPath.StartPath(p);if(Application.isPlaying){AstarPath.BlockUntilCalculated(p);}
and where:
public void OnPathComplete(Pathfinding.Path path)
{
ABPath abPath = path as ABPath;
…
I did not change gameplay code or astar code or increase the number of paths calculated or anything like that. The stack trace in visual studio and at the exception e doesn’t go back far enough to which path was called to help me isolate which unit started it, as it’s multithreaded i guess? Could some settings need to be updated? Is this version of Unity not compatible with this version of AStar?
Thanks for any help.