Cuts navmesh memory usage by at least 5 times (about 3GB less in our benchmark scene), enabling much larger scenes to generate successfully.
Small Fish’s MSC scene (~3km x 3km) now generates fine, previously ran out of memory and crashed.
The new theoretical maximum for a navmeshed scene is now ~50km x 50km.
- Packed `CompactCell` data into a single 32-bit field (8 bytes -> 4 bytes).
- Added heightfield serialization + compression so `CompactHeightfield` can be stored/transferred as bytes, and tiles store compressed heightfield data instead of large voxel arrays.
- **Heightfield serialization + compression is a prerequisite for navmesh baking.**
- Tiles are decompressed when generating polymeshes (e.g., to adapt to area changes).
- Compression adds a small overhead during navmesh generation.
- Fixed load sequence, now properly shows "Generating Navmesh..." in scene loading screen
- Reduced allocations during `PolyMesh` generation.
- Reduced the permanent memory usage of `PolyMesh`.
- Improved parallel tile generation; now properly limits the number of in-flight tasks to prevent OOM crashes.
Overall generation will be slower due to the extra compression step, I expect roughly ~30% in our benchmarks.
Basically, we're trading generation speed for drastically lower memory usage.
Some of the slowdown we will see in the benchmark is also due to the increased tile size. The larger tiles don’t actually make generation slower in real use, but they show up as "slower" because of how our benchmarks are designed/measured.
* Enable CA2000 in editorconfig
* Remove unused CaptureStdOut class
* Add missing dispose calls in Sandbox.Tools
* Add missing dispose calls in tests
* Add missing dispose calls in launchers
* Add missing dispose calls in Topten.RichtTextKit
* Add missing dispose calls in Engine
* Add missing dispose calls in SboxBuild
* Add nullchecks to a few dispose calls
* Fix more missing disposal calls and leaks
* Disable CA2000 for Textures
* Fix disposing too early in ImageFileTextureGenerator
* Fix disposing codec, ownership is transferred to animation
* Add missing using in ByteStream benchmark