FollowerEntity NotImplementedException

A NotImplementedException occurs when a unit passes through the doorcut not in a straight line. It doesn’t happen each time, but like 1 in 20-100 passes. The unit and some other units all over the map get stuck and the error continues popping each frame. Enabling local avoidance seems to fix the issue. (grid graph, v 5.2.4)

UPD: Local avoidance doesn’t remove the issue completely, but in a few seconds after the error, the unit manages to unstuck himself

NotImplementedException: The method or operation is not implemented.
Pathfinding.PathTracer.AppendNode (System.Boolean toStart, Pathfinding.GraphNode node) (at ./Packages/com.arongranberg.astar/Utilities/PathTracer.cs:372)
Pathfinding.PathTracer.AppendPath (System.Boolean toStart, Pathfinding.Collections.CircularBuffer`1[T] path) (at ./Packages/com.arongranberg.astar/Utilities/PathTracer.cs:380)
Pathfinding.PathTracer.RepairFull (UnityEngine.Vector3 point, System.Boolean isStart, Pathfinding.PathTracer+RepairQuality quality, Pathfinding.Util.NativeMovementPlane movementPlane, Pathfinding.ITraversalProvider traversalProvider, Pathfinding.Path path) (at ./Packages/com.arongranberg.astar/Utilities/PathTracer.cs:913)
Pathfinding.PathTracer.Repair (UnityEngine.Vector3 point, System.Boolean isStart, Pathfinding.PathTracer+RepairQuality quality, Pathfinding.Util.NativeMovementPlane movementPlane, Pathfinding.ITraversalProvider traversalProvider, Pathfinding.Path path, System.Boolean allowCache) (at ./Packages/com.arongranberg.astar/Utilities/PathTracer.cs:650)
Pathfinding.PathTracer.UpdateStart (UnityEngine.Vector3 position, Pathfinding.PathTracer+RepairQuality quality, Pathfinding.Util.NativeMovementPlane movementPlane, Pathfinding.ITraversalProvider traversalProvider, Pathfinding.Path path) (at ./Packages/com.arongranberg.astar/Utilities/PathTracer.cs:306)
Pathfinding.ECS.JobRepairPath.Execute (Unity.Transforms.LocalTransform& transform, Pathfinding.ECS.MovementState& state, Pathfinding.ECS.AgentCylinderShape& shape, Pathfinding.ECS.AgentMovementPlane& movementPlane, Pathfinding.ECS.DestinationPoint& destination, Unity.Entities.EnabledRefRW`1[T] readyToTraverseOffMeshLink, Pathfinding.ECS.ManagedState managedState, Pathfinding.ECS.MovementSettings& settings, Unity.Collections.NativeList`1[T] nextCornersScratch, Unity.Collections.NativeArray`1[System.Int32]& indicesScratch, Unity.Collections.Allocator allocator, System.Boolean onlyApplyPendingPaths) (at ./Packages/com.arongranberg.astar/Core/ECS/Jobs/JobRepairPath.cs:166)
Pathfinding.ECS.JobRepairPath.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) (at ./Packages/com.arongranberg.astar/Core/ECS/Jobs/JobRepairPath.cs:123)
Pathfinding.ECS.JobRepairPath.Unity.Entities.IJobChunk.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) (at <6575069a1eda4787957df56c505f703c>:0)
Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].ExecuteInternal (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at ./Library/PackageCache/com.unity.entities/Unity.Entities/IJobChunk.cs:420)
Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].Execute (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at ./Library/PackageCache/com.unity.entities/Unity.Entities/IJobChunk.cs:363)

In this case with local avoidance enabled it seems they just didn’t manage to bypass each other. Identical error log. But after tremoring for a minute, they did unstuck.

image

Was local avoiding another unit and decided to go into a doorframe. Stuck

image

Hi

Thanks.
Is it possible for you to share this project (or a stripped down version) with me so that I can replicate it? :slight_smile:

I’ve recreated the project in a stripped version, and the bug was gone. The only difference was the complexity of the layout creation.

So in the main project instead of doing RecalculateConnectionsInRegion for every object and wall placed, I tried RecalculateAllConnections. This fixed the issue for good. Thanks!

However, I’m wondering what did I wrong with the RecalculateConnectionsInRegion. I did recalculate for a region of object size + margin of 1. Like if an object blocks one tile, the region is 3x3. One sus thing I did was trigger a region recalculation for each wall segment in one frame. Then, in that same frame, I also replaced a segment with the door (unlocking the cells), and triggered another region recalculation.

Sounds like some connections were invalid, in that case.

Your way of doing it sounds ok, though. So not quite sure what’s going on.