9_7_8-LazyMoons icon

LazyMoons

Less RAM on the first launch after adding or updating custom moons: LethalLevelLoader no longer loads every new moon at startup. Moons load when you route to them. Performance and memory fix for moon modpacks.

Last updated 26 minutes ago
Total downloads 3
Total rating 0 
Categories Mods BepInEx Client-side Moons Performance AI Generated
Dependency string 9_7_8-LazyMoons-0.1.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2305 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2305
IAmBatby-LethalLevelLoader-1.7.13 icon
IAmBatby-LethalLevelLoader

A Custom API to support the manual and dynamic integration of all forms of custom content in Lethal Company. (v81 Compatible)

Preferred version: 1.7.13

README

LazyMoons

Lots of custom moons, not a lot of RAM? After you add or update custom moons, the next time you start Lethal Company it loads all the new ones at once. LazyMoons lets them sleep in, so that launch uses less memory. Each moon loads when you fly to it.

It's a small performance mod for moon modpacks that use LethalLevelLoader. There's nothing to set up, and it doesn't change your moons' files.

How much memory does it save?

About 0.9–1 GB at the main menu in our test, on a first launch with 6 moon mods (31 moon scenes):

Memory at the main menu Moons loaded at once
First launch without LazyMoons 5.3–5.4 GB 31
First launch with LazyMoons 4.4 GB 0
Later launches without LazyMoons 4.4 GB 0

Each row is three launches of the game (v81) with LethalLevelLoader 1.7.13, on a laptop with 16 GB of RAM. "Memory" is what Windows calls commit; running out of it can crash the game. The LazyMoons row was measured on the prototype, which has the same code under another name. One run of the released build matched it. Your savings depend on your moons.

How it works

LethalLevelLoader already loads most moons only when you route to them, and unloads them when you route somewhere else. But when a moon is new or updated, it loads the moon's file at launch just to see what's inside. With lots of new moons, they're all in memory together.

Each moon file has a small label that says which scenes are inside. Before LethalLevelLoader starts, LazyMoons reads those labels and adds the moons to LethalLevelLoader's list of moons it knows. For all 31 moons, this took less than a tenth of a second.

Good to know

  • It helps on the first launch after adding or updating moons. If your moons haven't changed, LethalLevelLoader already skips them, so you won't see a difference.
  • It only covers moon scenes (in .lethalbundle files). Interiors, scrap, enemies, suits and cosmetics still load as usual, so it won't fix every "out of memory" crash, including ones that happen later in a lobby or on a moon.
  • Moons still load when you route to them, so you may wait a moment, just as you normally would. LethalLevelLoader keeps a moon loaded until you route to a different one.
  • If LazyMoons can't safely read a moon file, it leaves that moon to LethalLevelLoader.

Does it work with other mods?

  • Faster Load AssetBundles 1.2.0: worked together in one test, with its copies of the moon files already made. We haven't tested visiting a moon before it has a copy. In that test, the game logged an error twice about a piece of an interior (Cylinder.002). It's probably from the random interior, but we haven't ruled out either mod.
  • BundleSlimmer and BaconMemory: not tested.

What's been tested

With one player hosting a LAN game, we landed on Bozoros and Xenos and left again, twice with LazyMoons (once on the prototype) and once more with Faster Load too. All 11 checks passed each time. Multiplayer, big modpacks and the other 29 moons haven't been tested yet. If something breaks, please report it on GitHub and include your LogOutput.log. Check it for anything private first. The full results are in TESTING.md.

Installing

Use a mod manager. If you install it by hand, put LazyMoons.dll in BepInEx/patchers/LazyMoons/, not in plugins. To check that it's working, search for LazyMoons in BepInEx/LogOutput.log.

To undo everything: remove LazyMoons and delete BepInEx/cache/scenebundles.txt. LethalLevelLoader makes a new list the next time you start the game.

The source code is on GitHub (GPL-3.0). LazyMoons was made with AI help (Claude Code).