
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. Press F8 in game to open its settings window and turn any option on or off, no restart needed. The optional graphics tweaks are all off 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.
Graphics (all off by default)
These change how the game looks, so you choose them yourself in the settings window. Each one is tagged Graphics there.
- Weather: thinner rain, snow, ash and mist, and no per-raindrop collision or lights.
- Lights: distant torches, fires and their shadows switch off a bit sooner.
- Rendering: caps for shadow distance and particle raycasts, and an optional draw distance for small clutter.
- Low-end GPU: slower and smaller world reflections, optional half-resolution textures, lower LOD bias, fewer shadow cascades, less grass.
Diagnostics (optional)
- Profiler: a built-in profiler and freeze detector that write to the BepInEx log, including how much garbage each subsystem produces.
Settings window
Press F8 (changeable in the config) to open it. Options are sorted into tabs with a category tag: Performance, Memory, Graphics and Diagnostics. Hover an option to read what it does. Changes apply at once and are saved to the config file. Only the profiler switch needs a restart. You can also turn everything off with the Enabled switch of each module; a switched-off module behaves exactly like vanilla.
Configuration
The config file is BepInEx/config/leanheim.performance.cfg. It is created on the first start.
Every feature has its own Enabled switch (or can be edited in the settings window). Turning a switch off restores vanilla behaviour.
Compatibility
- Requires BepInExPack Valheim.
- It patches
WearNTear,WearNTearUpdater,Character,Player.UpdateTeleport,Gamecleanup methods and physics settings; the optional graphics modules patchEnvMan,LightLod,ReflectionUpdate,ClutterSystemandGraphicsSettingsManager. 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 the profiler (Diagnostics tab, then restart), play until the problem happens, and attach BepInEx/LogOutput.log.
Support
If LeanHeim made your game smoother, you can support its development. Thank you!
