BUG: Recast Graph Burst - Unity 2020.1

Hi,

we are just evaluating our new project for a 2020.1 upgrade and A* doesn’t want to work properly.

The first issue we had were compile issues with the newest entities and collections packages. We were able to fix these by replacing Line 649 in JobDependencyTracker with:

Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref Unity.Collections.LowLevel.Unsafe.UnsafeUtility.AsRef<NativeArray<byte> >(ptr), safetyHandle);

Now when we run the game (same without entities + collections update and code change above):

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Unity.Collections.NativeArray`1:.ctor(Int32, Allocator, NativeArrayOptions)
Pathfinding.Recast.RecastMeshGathererBurst:Finalize() (at Packages\com.arongranberg.astar@4.3.30\Generators\Utilities\RecastMeshGathererBurst.cs:101)
Pathfinding.RecastGraph:CollectMeshesBurst(Bounds) (at Packages\com.arongranberg.astar@4.3.30\Generators\RecastGenerator.cs:1136)
Pathfinding.<ScanAllTilesBurst>d__53:MoveNext() (at Packages\com.arongranberg.astar@4.3.30\Generators\RecastGenerator.cs:757)
Pathfinding.<ScanInternal>d__46:MoveNext() (at Packages\com.arongranberg.astar@4.3.30\Generators\RecastGenerator.cs:602)
<ScanGraph>d__143:MoveNext() (at Packages\com.arongranberg.astar@4.3.30\Core\AstarPath.cs:1847)
<ScanInternal>d__142:MoveNext() (at Packages\com.arongranberg.astar@4.3.30\Core\AstarPath.cs:1769)
AstarPath:Scan(NavGraph[]) (at Packages\com.arongranberg.astar@4.3.30\Core\AstarPath.cs:1626)
<scanningRoutine>d__10:MoveNext() (at Assets\Scripts\Building Mode\AstarScanManager.cs:54)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

And onther one here:

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Pathfinding.RecastGraph:PutMeshesIntoTileBuckets(MeshCollection, IntRect) (at Packages\com.arongranberg.astar@4.3.30\Generators\RecastGenerator.cs:685)
Pathfinding.<ScanAllTilesBurst>d__53:MoveNext() (at Packages\com.arongranberg.astar@4.3.30\Generators\RecastGenerator.cs:760)
Pathfinding.<ScanInternal>d__46:MoveNext() (at Packages\com.arongranberg.astar@4.3.30\Generators\RecastGenerator.cs:602)
<ScanGraph>d__143:MoveNext() (at Packages\com.arongranberg.astar@4.3.30\Core\AstarPath.cs:1847)
<ScanInternal>d__142:MoveNext() (at Packages\com.arongranberg.astar@4.3.30\Core\AstarPath.cs:1769)
AstarPath:Scan(NavGraph[]) (at Packages\com.arongranberg.astar@4.3.30\Core\AstarPath.cs:1626)
<scanningRoutine>d__10:MoveNext() (at Assets\Scripts\Building Mode\AstarScanManager.cs:54)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

We didn’t have these issues in 2019.4 because the Bursted Recast Generation is disabled there. It ran fine without Burst, but there is no active option to disable Burst for recast generation (but was able to disable it via code)? Still the best would be to not have these Exceptions :stuck_out_tongue:

Best regards
Bennet

I just updated from 2020.1.0b14 to 2020.1.0f1 and at the same time, I also updated to Hybrid Renderer 2 v0.7.0. I’m getting this same error (line 649) of JobDependencyTracker.cs.

I updated A*PFP from 4.3.28 to 4.3.30, but that did not fix the problem. I wasn’t sure where ENABLE_UNITY_COLLECTIONS_CHECKS gets defined or if it’s possible to disable it, so I commented out all the sections where I found it in JobDependencyTracker.cs. This allowed it to compile, however, I think some namespaces got changed around because “using Pathfinding;” no longer seems to have ABPath in it. So I’m trying to track that down right now…

1 Like

Hi

Thanks! I have fixed this issue and it will be included in the next update.

I cannot replicate the ‘not disposed’ errors though.

1 Like