This part should never be reached

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 ()
1 Like

Hi

This has been fixed in 5.1.4.

I think I have similar problems. 5.1.4 download does not seem available on your web site. I am running Unity 2021.3 and that does not seem to work with the package manager any more?

I can add the scoped registry through the manifest ok but when I go to install the package it only has old versions, the latest being 4.3.66. You do have a big red warning saying Unity 2022.1 or greater needed so I assume this is the case.

Indeed. Big red warning is accurate.

Would you please put 5.1.4 download on your website? Latest showing is 5.1.3. Much appreciated.

I must have forgotten to upload it.
I’ll ensure it gets updated when I publish the next update.

It should show up in the package manager as long as you use 2021.3.35f1 or later.