Hi,
I’ve seen some similar issues in the forum, but none of the other solution approaches seem to fit here.
I’m doing updates of the graph during runtime, while a FollowerEntity is patrolling around 4 points (blue lines). The updates happen, as I move some hexagons (the scan is triggered, when the dragging ends and the hexagon is in it’s new place). I never move hexagons where the FollowerEntity is currently at.
At some point, after a random amount of tiles rearranged and scans, the pathfinding gets terminated with the following error messages:
ArgumentException: Value does not fall within the expected range
Unhandled exception during pathfinding. Terminating.
Error : This part should never be reached.
See stacktraces at the end.
The graph scan is synchronous with AstarPath.active.Scan();
having a single and only recast graph. I also already tried to ScanAsync or update only parts of the graph to no success; at some point in time, the exception limbo is thrown.
I’m currently using version 5.1.3
— stacktraces
ArgumentException: Value does not fall within the expected range.
Pathfinding.Util.UnsafeSpan`1[T].CopyTo (Pathfinding.Util.UnsafeSpan`1[T] other) (at ./Packages/com.arongranberg.astar/Core/Collections/Span.cs:143)
Pathfinding.Util.UnsafeSpan`1[T].Reallocate (Unity.Collections.Allocator allocator, System.Int32 newSize) (at ./Packages/com.arongranberg.astar/Core/Collections/Span.cs:204)
Pathfinding.PathHandler.InitializeForPath (Pathfinding.Path p) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathHandler.cs:211)
Pathfinding.Path.PrepareBase (Pathfinding.PathHandler pathHandler) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/Path.cs:906)
Pathfinding.Path.Pathfinding.IPathInternals.PrepareBase (Pathfinding.PathHandler handler) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/Path.cs:1121)
Pathfinding.PathProcessor.CalculatePathsThreaded (Pathfinding.PathHandler pathHandler, Pathfinding.BlockableChannel`1+Receiver[T] receiver) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:300)
UnityEngine.Debug:LogException(Exception)
Pathfinding.PathProcessor:CalculatePathsThreaded(PathHandler, Receiver) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:379)
Pathfinding.<>c__DisplayClass27_0:<StartThreads>b__0() (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:121)
System.Threading.ThreadHelper:ThreadStart()
Unhandled exception during pathfinding. Terminating.
UnityEngine.Debug:LogError (object)
Pathfinding.PathProcessor:CalculatePathsThreaded (Pathfinding.PathHandler,Pathfinding.BlockableChannel`1/Receiver<Pathfinding.Path>) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:380)
Pathfinding.PathProcessor/<>c__DisplayClass27_0:<StartThreads>b__0 () (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:121)
System.Threading.ThreadHelper:ThreadStart ()
Error : This part should never be reached.
UnityEngine.Debug:LogError (object)
Pathfinding.PathProcessor:CalculatePathsThreaded (Pathfinding.PathHandler,Pathfinding.BlockableChannel`1/Receiver<Pathfinding.Path>) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:387)
Pathfinding.PathProcessor/<>c__DisplayClass27_0:<StartThreads>b__0 () (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:121)
System.Threading.ThreadHelper:ThreadStart ()