Currently using version 5.3.1 with Unity 2022.3.30f1
My project is essentially a dungeon crawling game, where each dungeon “chunk” is a prefab with a NavmeshPrefab component storing the scanned navmesh. Everything works fine except that there is a specific chunk which the SerializedNavmesh corrupts from time to time without a noticeable pattern.
One of the two possible errors will happen:
AssertionException: Assertion failure. Value was False
Expected: True
UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) (at <0652bf0e14024522b5c92574ad0ef550>:0)
UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) (at <0652bf0e14024522b5c92574ad0ef550>:0)
UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition) (at <0652bf0e14024522b5c92574ad0ef550>:0)
Pathfinding.Graphs.Navmesh.TileMeshes.Deserialize (System.Byte[] bytes) (at ./Packages/com.arongranberg.astar/Graphs/Navmesh/TileMeshes.cs:141)
Pathfinding.NavmeshPrefab.DrawGizmos () (at ./Packages/com.arongranberg.astar/Core/Misc/NavmeshPrefab.cs:124)
Pathfinding.Drawing.DrawingManager.DrawGizmos (System.Boolean usingRenderPipeline) (at ./Packages/com.arongranberg.astar/Drawing/DrawingManager.cs:669)
UnityEngine.Debug:LogException(Exception, Object)
Pathfinding.Drawing.DrawingManager:DrawGizmos(Boolean) (at ./Packages/com.arongranberg.astar/Drawing/DrawingManager.cs:671)
Pathfinding.Drawing.DrawingManager:Submit(Camera, CommandBufferWrapper, Boolean, Boolean) (at ./Packages/com.arongranberg.astar/Drawing/DrawingManager.cs:703)
Pathfinding.Drawing.DrawingManager:SubmitFrame(Camera, CommandBufferWrapper, Boolean) (at ./Packages/com.arongranberg.astar/Drawing/DrawingManager.cs:554)
Pathfinding.Drawing.DrawingManager:ExecuteCustomRenderPass(ScriptableRenderContext, Camera) (at ./Packages/com.arongranberg.astar/Drawing/DrawingManager.cs:479)
Pathfinding.Drawing.AlineURPRenderPass:Execute(ScriptableRenderContext, RenderingData&) (at ./Packages/com.arongranberg.astar/Drawing/AlineURPRenderPassFeature.cs:25)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
IOException: Corrupted data ReadInternal
System.IO.Compression.DeflateStreamNative.CheckResult (System.Int32 result, System.String where) (at <e2bec1e2c81b42b3b2ee8a58b12808fc>:0)
System.IO.Compression.DeflateStreamNative.ReadZStream (System.IntPtr buffer, System.Int32 length) (at <e2bec1e2c81b42b3b2ee8a58b12808fc>:0)
System.IO.Compression.DeflateStream.ReadInternal (System.Byte[] array, System.Int32 offset, System.Int32 count) (at <e2bec1e2c81b42b3b2ee8a58b12808fc>:0)
System.IO.Compression.DeflateStream.Read (System.Byte[] array, System.Int32 offset, System.Int32 count) (at <e2bec1e2c81b42b3b2ee8a58b12808fc>:0)
System.IO.BinaryReader.FillBuffer (System.Int32 numBytes) (at <467a840a914a47078e4ae9b0b1e8779e>:0)
System.IO.BinaryReader.ReadInt32 () (at <467a840a914a47078e4ae9b0b1e8779e>:0)
Pathfinding.Graphs.Navmesh.TileMeshes.Deserialize (System.Byte[] bytes) (at ./Packages/com.arongranberg.astar/Graphs/Navmesh/TileMeshes.cs:122)
Pathfinding.NavmeshPrefab.DrawGizmos () (at ./Packages/com.arongranberg.astar/Core/Misc/NavmeshPrefab.cs:124)
Pathfinding.Drawing.DrawingManager.DrawGizmos (System.Boolean usingRenderPipeline) (at ./Packages/com.arongranberg.astar/Drawing/DrawingManager.cs:669)
UnityEngine.Debug:LogException(Exception, Object)
Pathfinding.Drawing.DrawingManager:DrawGizmos(Boolean) (at ./Packages/com.arongranberg.astar/Drawing/DrawingManager.cs:671)
Pathfinding.Drawing.DrawingManager:Submit(Camera, CommandBufferWrapper, Boolean, Boolean) (at ./Packages/com.arongranberg.astar/Drawing/DrawingManager.cs:703)
Pathfinding.Drawing.DrawingManager:SubmitFrame(Camera, CommandBufferWrapper, Boolean) (at ./Packages/com.arongranberg.astar/Drawing/DrawingManager.cs:554)
Pathfinding.Drawing.DrawingManager:ExecuteCustomRenderPass(ScriptableRenderContext, Camera) (at ./Packages/com.arongranberg.astar/Drawing/DrawingManager.cs:479)
Pathfinding.Drawing.AlineURPRenderPass:Execute(ScriptableRenderContext, RenderingData&) (at ./Packages/com.arongranberg.astar/Drawing/AlineURPRenderPassFeature.cs:25)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
AFAIK, there’s nothing unique about that chunk compared to any other chunk in the database. Once it is seen as corrupted, it will stay corrupted between restarts until a rescan. Upon rescanning of that chunk, there’s no data change in the serializednavmesh bytes asset after diffing it with the previous version. This happens randomly to that chunk only for some reason.
- No navmeshcuts are used
- There are recastnavmeshmodifiers present in each chunk, but they are all disabled outside of gameplay
- This error happens in prefab mode too when gizmos is turned on.