You are viewing a potentially older version of this package. View all versions.
Skarif-ValheimPerformanceOverhaul-2.6.3 icon

ValheimPerformanceOverhaul

Comprehensive performance optimization mod. Reduces CPU/GPU load via light culling, LOD system, AI throttling, distance culling, piece sleep management and more. Designed for large bases and busy servers.

Date uploaded 4 months ago
Version 2.6.3
Download link Skarif-ValheimPerformanceOverhaul-2.6.3.zip
Downloads 611
Dependency string Skarif-ValheimPerformanceOverhaul-2.6.3

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2202 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.

Preferred version: 5.4.2202

README

Valheim Performance Overhaul

A comprehensive performance optimization mod focused on reducing CPU and GPU load β€” especially on large bases, busy servers, and zones with many light sources.


Installation

Install via r2modman or Thunderstore Mod Manager (recommended) β€” everything is placed automatically.

Manual install:

  1. Install BepInExPack Valheim first.
  2. Copy ValheimPerformanceOverhaul.dll into BepInEx/plugins/.
  3. Launch the game β€” a config file is generated automatically at BepInEx/config/com.Skarif.ValheimPerformanceOverhaul.cfg.

What it does

πŸ”¦ Light Culling (biggest FPS impact)

  • Limits active light sources to a configurable maximum (default: 15).
  • Disables shadow casting beyond a set distance.
  • Light LOD system: transitions lights through Full β†’ No Shadows β†’ Emissive β†’ Billboard β†’ Disabled as distance increases.

πŸ’€ Distance Culler

  • Puts distant creatures and building pieces to "sleep" β€” pauses their Update logic.
  • Physics culling for Rigidbodies beyond a set range.
  • Configurable exclusions (e.g. portals, tombstones are never culled).

πŸ—οΈ Piece Optimization

  • WearNTear.GetSupport() results are cached with a configurable TTL.
  • Distant pieces skip their Update cycle entirely.
  • Asynchronous WearNTear initialization β€” spreads load over multiple frames on scene load.

πŸ€– AI Throttling

  • Monsters beyond 60 m update AI only every 5 seconds instead of every frame.
  • LOS (line-of-sight) checks are cached per-target with a 0.5 s timeout.
  • Idle tamed animals inside player bases enter a low-power mode.

🎨 Graphics Settings

  • Configurable shadow distance, resolution, and cascade count.
  • Bloom and screen-space reflections toggle.
  • Terrain quality multiplier.

🌿 Vegetation

  • Grass render distance and density control.
  • Detail object distance and density.

🎡 Audio Pooling

  • Reuses AudioSource components instead of creating new ones per sound effect.

♻️ Object Pooling

  • Reuses ItemDrop GameObjects to reduce instantiation overhead when loot spawns.

🧠 GC Control

  • Prevents Unity's garbage collection from firing during combat or movement.

⚑ JIT Warm-up

  • Pre-compiles critical game methods on spawn to eliminate the first-use stutter.

πŸ—ΊοΈ Minimap Optimization

  • Configurable texture resolution and update frequency.

Configuration

All settings are available in BepInEx/config/com.Skarif.ValheimPerformanceOverhaul.cfg.

If you have BepInEx Configuration Manager installed, press F1 in-game to adjust all settings with a GUI in real time.

Key settings

Setting Default Description
Max Active Lights 15 Max simultaneous light sources
Light Cull Distance 60 m Beyond this distance lights turn off
Creature Cull Distance 80 m Creatures sleep beyond this distance
Piece Cull Distance 100 m Building pieces sleep beyond this distance
Support Cache Duration 5 s How long structural support values are cached
Grass Density Multiplier 0.7 1.0 = vanilla, lower = fewer grass
Shadow Distance 50 m Maximum shadow render distance

Performance expectations

Results depend heavily on scene complexity. Typical gains:

Scenario Expected FPS gain
Open world, few structures ~5–10%
Medium base (50–100 pieces) ~10–20%
Large base (300+ pieces, 10+ light sources) ~20–40%
Busy server with many players/mobs ~15–30%

Compatibility

  • βœ… Works standalone β€” no other mods required.
  • βœ… Compatible with most content mods (Epic Loot, Jotunn-based mods, etc.).
  • ⚠️ If Object Pooling conflicts with a loot mod, disable it in config (4. Object Pooling β†’ Enabled = false).
  • ⚠️ The mod was created in collaboration with AI. Despite the fact that I conducted test runs in various situations, the mod is in BETA. Although the mod technically cannot break the world, it is advisable to make backups.
  • ❌ Does not support crossplay (Steam + Game Pass mixed sessions). Pure Steam servers are fine.

Changelog

2.6.0

  • Removed NetworkManager (ZSteamSocket-only, broke crossplay)
  • Removed ZDOOptimizer (potential desync risk on servers)
  • Fixed LightLODManager: removed duplicate ScanForLights() on Start
  • Fixed AdvancedLightManager: removed periodic FindObjectsByType scan every 5s (caused micro-freezes)
  • DistanceCuller refactored: all cullers now managed by one central Update loop instead of one Update() per object
  • PiecePatches: replaced ConcurrentDictionary with Dictionary (main thread only, 3–5x faster)
  • AsyncWearInit: added early exit when queue is empty

2.5.1

  • Initial public release

CHANGELOG

Changelog


v3.0.0

Added

  • Decor Batching (New Module): Automatically combines meshes of decorative pieces (Misc category, no WearNTear) in a chunk grid to drastically reduce draw calls on large bases. Configurable rebuild cooldown and minimum pieces per chunk.
  • In-Game Settings Menu: Added a built-in VPO configuration menu accessible directly from the Main Menu. No longer requires external BepInEx Configuration Manager to tweak settings.
  • Network Optimizations (Crossplay Safe!): Brought back and completely rewritten to safely support Game Pass / Crossplay:
    • Steam Socket Uncap: Increases P2P data limits (solves lag on huge bases). Safely disables itself if not running on Steam.
    • Adaptive Throttling: Intelligently drops ZDO sends to clients with high ping (>400ms) to prevent choking their connection.
    • Smart ZDO Sorting: Prioritizes players, portals, and ships over AI during network sync to prevent desyncs.
    • Smart Zone Ownership: Automatically transfers AI control to the player with the lowest ping in the zone.
  • Piece Sleep Manager: Puts static building pieces (WearNTear) to sleep after 2 frames of inactivity, saving CPU cycles on massive structures.

Changed / Optimized

  • Zero GC Allocations on Hot Paths: Replaced expensive Reflection (GetValue/SetValue) with compiled Expression delegates. Completely eliminates boxing (float -> object) and garbage generation per frame in:
    • LightFlickerPatch (v2.8.0)
    • VegetationPatches (v2.8.1)
    • SmokePatch (v2.9.0)
    • ObjectPoolManager
  • O(1) Collection Upgrades: Upgraded DistanceCullerManager, AIOptimizerManager, and AudioPoolManager to use HashSet alongside List. This changes duplicate checking from O(n) to O(1), fixing massive O(nΒ²) lag spikes when loading chunks with thousands of objects.
  • Smoke Physics Overhaul: AddForce is now throttled to run once every 3 physics frames. Rigidbody mass updates are throttled to 0.1s. isKinematic and Rigidbody references are now heavily cached.
  • Tamed Idle Optimizer: Optimized base detection using LayerMask directly in Physics.OverlapSphere, avoiding expensive GetComponentInParent traversals on hundreds of colliders.
  • Object Pooling: Optimized IsInWhitelist to use GetStableHashCode, completely avoiding string allocations (Replace, Trim) on the hot path. Removed unnecessary thread lock statements since pooling is strictly single-threaded, reducing overhead.
  • AdvancedLightManager & FrameBudgetGuard: Cached Comparer delegates to avoid lambda allocations multiple times per second.

Fixed

  • [CRITICAL] Smoke Memory Leak: Fixed a critical vanilla issue (and previous patch oversight) where smoke objects were never destroyed after fading out. Hundreds of invisible smoke objects would accumulate and tick in FixedUpdate, killing FPS over time.
  • [CRITICAL] Light Culling Conflict: Fixed a severe conflict where AdvancedLightManager and LightLODManager both patched ZNetScene.CreateObject and fought over light states. Registration is now unified.
  • Zombie Lights Bug: Fixed a bug in AdvancedLightManager where destroyed lights weren't removed from the _culledLights list, causing zombie references that permanently broke the active lights limit.
  • Animator Conflict: Fixed a bug where AIOptimizer and CharacterAnimatorOptimizer were fighting over Animator.cullingMode in the same frame.
  • Support Cache: Added ZNetScene_OnDestroy_Postfix to clear the invalidation queue on scene unload, preventing null reference errors when changing worlds.

v2.7.1

Added

  • mini-update (smokePatch).

v2.7.0

Added

  • Light Flicker Optimization β€” Harmony Prefix on LightFlicker.CustomUpdate that fixes light intensity at its base value, eliminating per-frame Shadow Map recalculation for all fires and torches.
  • Smoke Physics Optimization β€” Harmony Prefix on Smoke.CustomUpdate that replaces the vanilla complex aerodynamics with a lightweight quadratic interpolation + single upward force.
  • Engine Quality Settings β€” Forces low-level Unity QualitySettings at startup: softParticles = false, softVegetation = false, configurable particleRaycastBudget.
  • Skip Intro β€” Skips Iron Gate and Coffee Stain logo screens on every game launch.
  • Frame Budget Guard β€” Dynamic stutter protection system. Monitors a rolling 120-frame window and lowers Time.maximumDeltaTime when heavy spikes are detected.

Changed

  • Config sections renumbered: new modules occupy sections 17–21.

v2.6.4

Added

  • Nothing (maintenance release).

v2.6.3

Added

  • Welcome screen on main menu launch with clickable Discord link.

v2.6.0

Changed / Fixed

  • Removed NetworkManager and ZDOOptimizer temporarily (crossplay issues).
  • Fixed LightLODManager duplicate scans.
  • DistanceCuller refactored to central Update loop.
  • AsyncWearInit early exit when queue is empty.

v2.5.1

  • Initial public release.