Using ProceduralGraphMover throw an exception

Hi again, using ProceduralGraphMover in a 2D game (topdown) give me this error:

IndexOutOfRangeException: Index was outside the bounds of the array.
Pathfinding.GridNode.GetConnections[T] (Pathfinding.GraphNode+GetConnectionsWithData1[T] action, T& data, System.Int32 connectionFilter) (at ./Library/PackageCache/com.arongranberg.astar@4.3.94/Graphs/Nodes/GridNode.cs:190) Pathfinding.HierarchicalGraph+JobRecalculateComponents.FindHierarchicalNodeChildren (Pathfinding.HierarchicalGraph hGraph, System.Int32 hierarchicalNode, Pathfinding.GraphNode startNode) (at ./Library/PackageCache/com.arongranberg.astar@4.3.94/Core/Pathfinding/HierarchicalGraph.cs:444) Pathfinding.HierarchicalGraph+JobRecalculateComponents.Execute () (at ./Library/PackageCache/com.arongranberg.astar@4.3.94/Core/Pathfinding/HierarchicalGraph.cs:537) Unity.Jobs.IJobExtensions+JobStruct1[T].Execute (T& data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at :0)

also at any “move” of the grid i get an:

NullReferenceException: Object reference not set to an instance of an object
Pathfinding.HierarchicalGraph+JobRecalculateComponents.Execute () (at ./Library/PackageCache/com.arongranberg.astar@4.3.94/Core/Pathfinding/HierarchicalGraph.cs:503)
Unity.Jobs.IJobExtensions+JobStruct`1[T].Execute (T& data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at :0)

When i stop the game i get:
NullReferenceException: Object reference not set to an instance of an object
Pathfinding.HierarchicalGraph+JobRecalculateComponents.Execute () (at ./Library/PackageCache/com.arongranberg.astar@4.3.94/Core/Pathfinding/HierarchicalGraph.cs:503)
Unity.Jobs.IJobExtensions+JobStruct`1[T].Execute (T& data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at :0)

If i disable the ProceduralGraphMover all works

Hi

Can you reliably replicate this?
Do you have any details about your setup?

I’m using TopDown engine (https://topdown-engine.moremountains.com/) for a 2D Topdown game.
Using A* and BEHAVIOR DESIGNER (https://opsive.com/) for AI. Unity 2022.3.19f1
If those errors don’t tell you anything specific, I’ll try to create a minimal application to share with you. It will take some time; I have a 3-month-old baby who is not letting me sleep/code :frowning:

Hi

Yes, a minimal reproducible example would be much appreciated. These errors are hard to diagnose on their own, I’m afraid.

Found!
In Grid Graph/Diameter of collision testing, if u put a value <1 gives the error.
Try Example15_2D (oh…by the way, seems that ignores walls)
Put 0.5 in Graph/Diameter, add the mover and point the MainCamera.
Move the camera at runtime.

In my game I’ll put a 1 value and use a half nodesize.

PS: this fixes a lot of leaks from my other post, now only the
“Found 257 leak(s) from callstack:Unity.Jobs.IJobExtensions.JobStruct1<Pathfinding.RVO.JobDestinationReached1<Pathfinding.RVO.XYMovementPlane>>.Execute(ref Pathfinding.RVO.JobDestinationReached`1<Pathfinding.RVO.XYMovementPlane> data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex).XYMovementPlane>>.Execute”

is left. I’m digging

Thanks!

I’ve managed to replicate this now. I will include a fix in the next update.

1 Like