RustyAstroboy-DungeonLoadingOptimizer icon

DungeonLoadingOptimizer

ALPHA. Cuts Lethal Company interior loading time and removes the navmesh lag spike when landing. Multiplayer determinism is not yet verified - do not use on a serious save.

CHANGELOG

Changelog

0.1.0 — alpha

First public build. Released for compatibility testing on large modpacks only.

What it does

  • Frame budget — fixes DunGen's per-frame work budget. Lethal Company sets it to 1 ms and DunGen measures wall-clock time, so the budget is already spent by the time the generator resumes and only one work unit runs per frame. Measured on Titan: 1.00 → 9.53 work units per frame.
  • Non-blocking navmesh — the navmesh bake is captured and driven through NavMeshSurface.UpdateNavMesh, reusing the surface's existing data so only the changed regions are rebuilt. Measured on Titan's outdoor surface: 1806 ms blocking → 153 ms, none of it blocking the main thread.
  • Phased level finalisationFinishGeneratingLevel is spread across frames, and the completion RPC is held until the bakes finish so nothing spawns onto an incomplete navmesh.
  • Load report — per-load timings, work-unit counts, frame statistics, and layout/navmesh fingerprints.

Measured against a control run on Titan, the worst frame of the whole landing goes from 1815 ms to 106 ms.

Known limitations

  • Multiplayer determinism is not verified. The two-client test comparing layout and navmesh fingerprints has not been run. Until it has, treat desync as an open possibility.
  • Only tested on Lethal Company v81, as host, on Experimentation, Assurance and Titan.
  • The watchdog path (FinishSequence.MaxFinishSeconds) has not been exercised in a real failure.