
You are viewing a potentially older version of this package. View Latest Version
LeanHeim
Client-side performance fixes for Valheim: smoother big bases, storms and portals. Fixes snow and per-second update spikes, moves asset cleanup to loading screens. Works with vanilla players and servers.LeanHeim
Client-side performance fixes for Valheim, made for big bases, storms and weak PCs.
LeanHeim fixes parts of the game that waste CPU time. It does not lower your graphics quality by default.
Multiplayer
- Install it only on your own PC. Other players and the server do not need it.
- It adds no network messages and no version check, so you can join vanilla servers and play with vanilla friends.
- On a dedicated server (no graphics device) it does nothing.
What it does
Buildings
- Snow speed bug fixed. In vanilla, snow on buildings piles up faster at low FPS (about 3x faster at 20 FPS than at 60 FPS). LeanHeim makes it grow at vanilla's 60 FPS speed on every PC.
- Fewer snow network updates. In a snowstorm, vanilla writes the snow level of every building piece to the network about once per second. LeanHeim writes it only when it changed by a visible amount. You get less CPU work and less network traffic, and snow looks the same.
- No once-per-second spike. Vanilla updates the roof and ash state of all building pieces in a single frame every second. LeanHeim spreads the same work over several frames.
- Cheaper support checks. Every second each piece looks up which pieces hold it up. LeanHeim remembers that lookup instead of searching again. Support works exactly as in vanilla.
Creatures
- Purely visual creature updates (slope tilt, water and slide effects) run once per frame instead of on every physics step. At low FPS there are 3 to 5 physics steps per frame. AI, combat and movement are untouched.
Memory cleanup (unload unused assets)
- Vanilla runs this cleanup once per hour at a random moment, which causes a freeze, even in combat. LeanHeim postpones it to the next loading screen.
- It also cleans up during long-distance teleports (portals and dev commands) while the screen is black.
- On respawn, vanilla's own cleanup runs while the screen is still black instead of after you appear.
- Sleep and pause-menu cleanup stay exactly as in vanilla.
World streaming
- Terrain rebuilds away from the player are spread over several frames. The ground under you always updates immediately.
Engine
- Physics reuses one collision object per callback instead of allocating a new one each time: less garbage, fewer garbage collection freezes.
- Optional (multiplayer): physics transform syncs for objects moved by other players are merged into one.
Optional (config)
- Profiler: a built-in profiler and freeze detector that write to the BepInEx log, including how much garbage each subsystem produces.
LeanHeim does not change graphics: shadows, lights, weather, textures and draw distance stay exactly as the game sets them.
Configuration
The config file is BepInEx/config/leanheim.performance.cfg. It is created on the first start.
Every feature has its own Enabled switch. Turning a switch off restores vanilla behaviour.
Compatibility
- Requires BepInExPack Valheim.
- It patches
WearNTear,WearNTearUpdater,Character,Player.UpdateTeleport,Gamecleanup methods and physics settings. Other mods that completely replace these methods may conflict. - If the game updates and a patch no longer fits, LeanHeim writes a warning to
BepInEx/LogOutput.log. The rest of the game keeps working.
Reporting problems
Enable [1 - Profiler] Enabled = true, play until the problem happens, and attach BepInEx/LogOutput.log.
Support
If LeanHeim made your game smoother, you can support its development. Thank you!
