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
Best regards
Bennet