Valheim
You are viewing a potentially older version of this package. View Latest Version
Install

Details

Date Uploaded
last week
Downloads
15K
Size
293KB
Dependency string
Skarif-ValheimPerformanceOverhaul-5.0.0
ADDatHost Valheim hosting
30% off!

⚡ Valheim Performance Overhaul (VPO) - v5.0.0

----------------- BEFORE ---------------------------- AFTER -------------------

Banner

Verified on this map with these settings

    

⚠️ IMPORTANT HOTKEYS TO REMEMBER:

- Press F6 at any time to open the in-game, graphical VPO configuration menu.
Adjust any setting, limit, or distance on the fly.
- Press F7 at the base to set a base anchor. This will instruct VPO to remember these coordinates and automatically 
merge the static geometry of your structure after a short loading delay,
reducing CPU rendering overhead without having to manually execute commands in the terminal.
This will help improve your frame rate and reduce CPU load. You can place multiple anchors in different locations.

    

GENERAL

Valheim is an incredible game, but we have all experienced the dreaded "base lag." Once you build a massive fortress, light up a few dozen torches, tame some wolves, and host a couple of friends, your frames per second can drop into the single digits.

Valheim Performance Overhaul (VPO) is a highly optimized, fully comprehensive system built to eliminate the game's worst CPU, GPU, memory, and network bottlenecks. Rather than simply turning down graphics settings, VPO implements advanced runtime caching, asynchronous processing, time-sliced update loops, and deep engine hooks to make the game run significantly smoother while preserving its visual atmosphere.

🎨 Graphics & Rendering Optimizations

Valheim's rendering engine often chokes on having too many unique draw calls. VPO introduces a complete suite of rendering optimizations:

  • 🍀 GPU Instancing & Material Deduplication: Forces Unity to use GPU Instancing on highly repetitive world objects like grass, flowers, shrubs, and rocks. VPO automatically scans and merges duplicate materials in memory using a fast material hashing key to maximize instancing batch sizes.
  • 🏰 Static Batching & Base Anchors (F7): Combines static geometry (dungeon details, ruins, POIs, cliffs) per world sector using Unity's native StaticBatchingUtility. For player bases, you can place a Base Anchor by pressing F7. When you return to your base, VPO waits for a configurable delay (BaseAnchorBatchDelay) for all assets to spawn before automatically batching them.
  • 🌳 Asynchronous LOD Generation: Uses a background thread to generate simplified mesh levels (LOD1 at 50% complexity, LOD2 at 15% complexity) using a custom Quadratic Error Metrics (QEM) decimator. The process runs smoothly in the background without causing loading screen freezes.
  • 💾 On-Disk Persistent Cache: Saves your generated LOD meshes locally in the BepInEx/cache/VPO folder. The cache automatically invalidates itself safely when either the mod or the game updates.
  • 🗺️ Terrain Mesh Cache: Features a high-performance LRU (Least Recently Used) cache for generated heightmap meshes. This eliminates micro-stutters when crossing zone boundaries. If you terraform or modify the ground, VPO instantly invalidates the cached sector and its adjacent neighbors on Heightmap.Poke to prevent visual mismatches.
  • 🖼️ Runtime Texture Downscaler: Downscales secondary object textures and compresses them to save VRAM. It safely bypasses Unity's write protection, saving raw bytes to the disk cache.

💡 Lighting & Shadows Optimizations

Point lights and dynamic shadows are among the biggest killers of GPU performance in Valheim. VPO rewrites how the game handles illumination:

  • 🔦 Advanced Light Culling: Limits active point lights around you to a configurable maximum (default: 15). Lights outside this limit are disabled.
  • 🌖 Light LOD System: Transitions lights through multiple levels based on distance:
    • Full: Standard lighting with shadows.
    • No Shadows: Shadows are disabled, leaving only light.
    • Emissive: The light source mesh glows, but does not cast actual light.
    • Billboard: The light is replaced by a lightweight 2D glow sprite.
    • Disabled: Completely turned off.
  • 🕯️ Light Flicker Optimization: Fixes fire and torch light intensity to its base value. This prevents Unity from constantly rebuilding shadow maps every frame, resulting in major GPU performance gains. This is optimized using compiled expression delegates to bypass slow reflection lookups on the hot path.
  • ⚖️ Dynamic Priority Sorting: Uses a fast O(N) selection algorithm to dynamically prioritize which lights should stay on (e.g., players, portals, and hearths are prioritized over common torches).
  • 🕶️ Distance Shadow Culling: Automatically disables shadow casting on lights beyond a set distance (default: 30 meters).

🛠️ Building & Base Optimizations

Building is the core of Valheim, but structures can choke your CPU with continuous stability and rendering updates:

  • 📦 Decor Batching: Combines the meshes of static, non-structural decorations (Misc category) in a 32x32 grid to drastically lower draw calls on detailed bases.
  • 💤 Piece Sleep Manager: Puts static building pieces (WearNTear) to sleep after 2 frames of inactivity, freeing up CPU cycles on large, settled bases.
  • ⏳ Asynchronous WearNTear Loading: Spreads out the loading of building block scripts on scene load (default: 20 per frame) to prevent massive freezing when loading into a large base.
  • 🛡️ Structural Support Cache: Caches structural integrity calculations (GetSupport()) with a configurable lifetime. Recalculations and neighbor invalidation are processed asynchronously (maximum of 5 blocks per frame) on structural collapse to prevent base collapses from freezing your game.
  • 🌧️ Weather Decay Control: Optionally disables rain and water rot damage for wooden structures, saving CPU cycles on continuous decay calculations.

🧠 AI, Physics & Animals

  • 🐑 Tamed Idle Optimizer: Puts idle, tamed animals inside player bases (detected by wards or nearby pieces) into a low-power mode, disabling their AI, Animators, Rigidbody movement, and Colliders. It safely restores colliders first when they wake up to prevent them from clipping through floors.
  • 👁️ Line of Sight (LOS) Caching: Caches monster line-of-sight checks per-target with a 10-second timeout, completely bypassing heavy raycast operations on the hot path.
  • 🧭 Pathfinding Scheduler: Restricts the number of active pathfinding searches per frame based on your hardware class (Weak: 3, Medium: 5, Strong: 8), keeping game performance smooth even if a raid spawns a massive wave of enemies.
  • 🤖 AI Throttling: Monsters beyond 60 meters update their AI only every 5 seconds instead of every frame, and physics updates are staggered.
  • 🌫️ Smoke Physics Overhaul: Replaces complex vanilla smoke aerodynamics with a simple, lightweight approximation. It also fixes a critical vanilla memory leak where faded smoke objects would never get destroyed, slowly piling up in the background. Physics AddForce and mass calculations are heavily throttled for maximum CPU savings.

🔊 Audio & Particle System Pooling

Creating and destroying Unity objects at runtime causes micro-stutters. VPO reuses existing objects using high-performance pools:

  • 🔊 Audio Pooling: Reuses AudioSource components for standard spatial 3D effects (excluding loops, UI, music, and long ambient clips).
  • 💥 VFX Object Pooling: Pools high-frequency combat effects (blood splatters, spark hits, arrow impacts) to eliminate instantiation stutter during fights. This uses a strict, optimized whitelist to prevent floating projectile bugs.
  • 💾 Component Caching: Caches all component references (Rigidbody, ParticleSystem, AudioSource, TrailRenderer, ZNetView, Projectile) inside a custom wrapper to bypass GetComponent calls during reuse.
  • 🌬️ Particle System Culling: Automatically pauses and resumes particle systems based on distance from the player, completely skipping simulation for off-screen effects. This uses a time-sliced manager (100 checks per frame) and a throttled action queue (25 toggles per frame) to prevent performance spikes during movement.
  • 🕯️ Torch Optimizer: Reduces the lifetime of torch and brazier particles and optimizes their gravity modifiers, saving rendering cycles on active lights.

🌐 Network & Multiplayer Sync (Crossplay Safe!)

VPO completely rewrites several core network handlers to keep multiplayer gameplay fluid:

  • 🚀 Steam Socket Uncap: Increases P2P data transfer limits (SendRateMin/Max and Receive Buffers) to solve network lag and desyncs on large bases. It safely detects your platform and disables itself gracefully on non-Steam (Game Pass) builds using reflection to prevent crashes.
  • 📉 Adaptive Throttling: Intelligently reduces network updates to players experiencing high ping (>400ms) to avoid choking their connection.
  • 🎯 Smart ZDO Sorting: Prioritizes players, portals, and ships during network synchronization to ensure smooth movement under load, sending distant entity data last.
  • 👑 Smart Zone Ownership: Automatically transfers AI control to the player with the lowest ping in the sector, preventing laggy mob movement.

⏳ Core Engine, Memory & Debug Tweaks

  • 🧠 GC Control: Blocks Unity's Garbage Collector from running while you are moving, swimming, or in combat, shifting memory cleanup to idle moments. A 45-second safety timer forces collection if you remain in combat for too long to prevent Out-Of-Memory (OOM) crashes.
  • ⚡ JIT Warm-up: Pre-compiles heavy game methods (like combat calculations, building hovers, and inventory UI) on first spawn to eliminate action-based micro-stutters.
  • 📊 Frame Budget Guard: Monitors your 1% Low frame times. If a heavy freeze is detected, it dynamically lowers Time.maximumDeltaTime to prevent the physics engine from entering a "death spiral" of lag (lag -> over-simulation -> freeze).
  • 🔇 PhysX Warning Silencer: Blocks the famous Unity console warning flood: "Setting linear velocity of a kinematic body", which spams the log during structural edits and degrades game performance.
  • ⏩ Skip Intro: Skips the logo screens on launch, getting you to the main menu 5 to 10 seconds faster.
  • ⚙️ Engine Tweaks: Disables soft particles and soft vegetation, optimizes animation skin weights per vertex (1, 2, or 4 bones), and disables Physics.autoSyncTransforms for massive physics CPU savings.
  • 📚 Loading Tips Injector: Replaces basic loading screens with over 40 highly informative, localized tips about VPO systems, mechanics, and optimization facts (available in English, Russian, Ukrainian, and Spanish).

⚙️ In-Game Configuration

VPO features a beautiful, built-in settings menu accessible directly from the Main Menu. You can toggle every single optimization module, adjust distances, change limits, and tweak settings on the fly without ever leaving the game or editing raw text files!

📊 Complete Configuration Guide

To help you configure the mod to fit your hardware and server setup, here are the descriptions and default values of all available configuration parameters.

⚙️ General & Engine Settings

These settings control the core optimizations, JIT compiler pre-warming, Garbage Collection, and frame budget protections.

Section Parameter Name Default Value Acceptable Range Description
1. General Enable Debug Logging false true / false Enables highly detailed diagnostic logs. Keep off unless debugging.
1. General Settings Menu Hotkey F6 KeyCode Hotkey to open/close the VPO settings menu.
2. GC Control Enabled true true / false Prevents Garbage Collector sweeps during movement, swimming, or combat.
5. JIT Warm-up Enabled true true / false Pre-compiles critical methods on player spawn to avoid first-use stutter.
19. Engine Quality Settings Enabled true true / false Activates low-level Unity tweaks (disables soft vegetation/particles, optimizes bone weights).
19. Engine Quality Settings Particle Raycast Budget 1024 64 - 4096 Limits maximum physics raycasts allocated for particle systems.
20. Skip Intro Enabled true true / false Skips the startup developer logos to get you to the main menu faster.
21. Frame Budget Guard Enabled true true / false Dynamically limits maximumDeltaTime during frame spikes to avoid freeze cascades.
21. Frame Budget Guard Freeze Threshold (ms) 28f 16f - 100f Frame duration threshold representing a freeze (e.g., 28ms is approx 35 FPS).
21. Frame Budget Guard Throttled MaxDeltaTime 0.045f 0.02f - 0.1f Physics delta time threshold applied during active stutters.
21. Frame Budget Guard Normal MaxDeltaTime 0.07f 0.03f - 0.2f Standard physics delta limit applied during smooth gameplay.

🎨 Graphics & Rendering Settings

Configure the custom GPU Instancing, background LOD generation, static batching, and high-performance texture compression.

Section Parameter Name Default Value Acceptable Range Description
8. Graphics Settings Enabled true true / false Enables custom overrides for shadows, reflections, and skin weights.
8. Graphics Settings Shadow Distance 50f 20f - 150f Maximum rendering range for game shadows.
8. Graphics Settings Shadow Resolution 512 512, 1024, 2048, 4096 Resolution of the main shadow map.
8. Graphics Settings Shadow Cascades 1 0 - 4 Number of shadow splits across distances. Lower values save GPU power.
8. Graphics Settings Terrain Quality Multiplier 0.7f 0.1f - 2.0f Precision multiplier for heightmap terrain error.
8. Graphics Settings Enable Reflections false true / false Enables screen-space reflections on water and surfaces.
8. Graphics Settings Enable Bloom false true / false Enables bloom post-processing glow effects.
8. Graphics Settings Skin Weights (Bones) 2 1, 2, 4 Dynamic bones calculated per vertex. 4 is vanilla, 2 is optimal, 1 is max FPS.
22. GPU Instancing Enabled true true / false Enables instancing on highly repetitive world structures (flora, rocks).
22. GPU Instancing Deduplicate Materials true true / false Merges duplicate materials to maximize GPU instancing batch sizes.
23. LOD Generation Enabled true true / false Enables background runtime creation of LOD groups for high-poly objects.
23. LOD Generation LOD1 Mesh Quality 0.5f 0.1f - 0.9f Vertex reduction target for LOD1 (0.5 means a 50% target).
23. LOD Generation LOD2 Mesh Quality 0.15f 0.05f - 0.5f Vertex reduction target for LOD2 (0.15 means a 15% target).
23. LOD Generation Min Vertex Count 300 150 - 5000 Minimum vertex threshold of a mesh to qualify for LOD generation.
24. Static Batching Enabled true true / false Combines static geometry (dungeons, POI, cliffs) inside active sectors.
24. Static Batching Settle Cooldown (seconds) 2.0f 0.5f - 10.0f Wait time after the last object spawns in a sector before combining them.
24. Static Batching Auto Run false true / false If enabled, static batching runs automatically. Otherwise, run manually with F7 or the console command.
24. Static Batching Max Batches Per Frame 1 1 - 5 Maximum sectors to batch per frame in Auto Run to avoid hitching.
24. Static Batching Batch Now Hotkey F7 KeyCode Pressing this hotkey sets a base anchor at player coordinates.
24. Static Batching Base Anchor Delay (seconds) 10.0f 3.0f - 30.0f Seconds to wait after entering base anchor area before automatic batching begins.
27. Texture Optimization Enabled false true / false Activates background texture downscaling and GPU compression to save VRAM.
27. Texture Optimization Downscale Multiplier 0.5f 0.1f - 1.0f Texture scale factor (0.5 halving width/height cuts VRAM footprint by 75%).
27. Texture Optimization Min Texture Size to Process 512 128 - 2048 Minimum resolution of a texture required to qualify for processing.
28. Terrain Mesh Cache Enabled true true / false Enables caching of heightmap meshes to eliminate biome-border stutters.
28. Terrain Mesh Cache Max Cached Sectors 64 16 - 256 Maximum terrain sectors to hold in memory.
28. Terrain Mesh Cache Memory Limit (MB) 64 16 - 512 Maximum RAM allocated for heightmap meshes before cache eviction triggers.

🏡 Culling, Bases & AI Settings

Fine-tune the distance culling limits, structural integrity caching, and low-power states of monsters and pets.

Section Parameter Name Default Value Acceptable Range Description
3. Distance Culler Enabled true true / false Puts distant game objects and entities to sleep.
3. Distance Culler Creature Cull Distance 80f 40f - 200f Distance at which non-player creatures pause their update logic.
3. Distance Culler Piece Cull Distance 100f 50f - 300f Distance at which static base pieces pause their update logic.
3. Distance Culler Enable AI Throttling true true / false Staggers physics and slows update frequencies for far-away monsters.
3. Distance Culler Exclusions TombStone,portal_wood String (CSV) Comma-separated list of prefab names to never cull under any condition.
4. Object Pooling Enabled true true / false Enables pooling for combat VFX to eliminate spawning stutters.
6. Light Culling Enabled true true / false Actively disables far-away light sources.
6. Light Culling Max Active Lights 15 5 - 50 Maximum number of point lights allowed to cast light simultaneously.
6. Light Culling Light Cull Distance 60f 20f - 150f Absolute distance beyond which lights are turned off.
6. Light Culling Max Shadow Casters 5 0 - 15 Maximum number of active shadow-casting lights allowed near you.
6. Light Culling Shadow Cull Distance 30f 10f - 80f Distance beyond which active lights have their shadow casting disabled.
6. Light Culling Enable Light LOD System true true / false Enables multi-stage Level of Detail (LOD) handling for lights.
7. Audio Optimization Enabled true true / false Enables caching and pooling for standard sound effect playbacks.
7. Audio Optimization Total Pool Size 32 16 - 128 Total number of pooled AudioSource instances.
9. AI Optimization Path Cache Distance 2.0f 0.5f - 8.0f Distance threshold for caching pathfinding routes.
10. Piece Optimization Enabled true true / false Activates structural support caching and sleeping.
10. Piece Optimization Support Cache Duration (seconds) 5.0f 1.0f - 30.0f Time-to-live (TTL) for cached structural support values.
10. Piece Optimization Smart Cache Invalidation false true / false Instantly invalidates support cache of adjacent structures on collapse.
10. Piece Optimization Disable Rain Damage false true / false Completely disables rot and decay on wooden pieces from rain and water.
11. Particle Optimization Enabled true true / false Activates distance culling and lifetime tweaks for particle systems.
11. Particle Optimization Particle Cull Distance 50f 20f - 100f Distance beyond which active particle systems are paused.
11. Particle Optimization Max Active Particle Systems 30 10 - 100 Limit on simultaneously simulating particle systems.
11. Particle Optimization Torch Particle Lifetime 0.8f 0.2f - 2.0f Reduces lifetime of fire particles to save GPU load.
12. Vegetation Optimization Enabled true true / false Enables adjustments for grass density and detail objects.
12. Vegetation Optimization Grass Render Distance 60f 30f - 120f Draw distance of grass details.
12. Vegetation Optimization Grass Density Multiplier 0.7f 0.3f - 1.0f Multiplier for grass density (0.7 means 70% density).
12. Vegetation Optimization Detail Object Distance 80f 40f - 150f Draw distance of minor detail meshes (twigs, small rocks).
12. Vegetation Optimization Detail Density 0.7f 0.3f - 1.0f Multiplier for detail mesh density.
12. Vegetation Optimization Terrain Max LOD 1 0 - 2 Maximum LOD level of heightmap terrain. Higher values are lower poly.
13. Animator Optimization Enabled true true / false Adjusts Animator culling modes on characters based on player range.
14. Minimap Optimization Enabled true true / false Throttles minimap coordinate updates when closed.
16. Tamed Mob Idle Optimization Enabled true true / false Enables low-power state for idle, safe, tamed animals.
16. Tamed Mob Idle Optimization Idle Distance From Combat 5f 3f - 30f Distance from the nearest combat threat to allow sleep mode.
16. Tamed Mob Idle Optimization Base Detection Radius 30f 15f - 60f Search radius around the animal to detect a player base (ward/shelter).
16. Tamed Mob Idle Optimization Wake Up Distance 7f 3f - 20f Distance in meters at which players wake up idle tamed pets.
17. Light Flicker Optimization Enabled true true / false Disables flickering calculations, fixing light values to save GPU.
18. Smoke Physics Optimization Enabled true true / false Replaces heavy aerodynamics simulation on smoke and fixes memory leak.
18. Smoke Physics Optimization Smoke Lift Force 3.5f 1f - 10f Vertical lifting force applied to smoke particles.

🌐 Network & Sync Settings

Network tweaks, Steam uncap, adaptive throttling, and zone management. Safely supports crossplay servers.

Section Parameter Name Default Value Acceptable Range Description
14. Network Optimization Enabled true true / false Activates the network optimization suite (crossplay safe).
14. Network Optimization Uncap Steam Socket true true / false Boosts Steam P2P rate limits. Automatically disables on non-Steam builds.
14. Network Optimization Steam Send Rate Min (KB) 256 Integer Minimum allocated bandwidth rate (vanilla is 153).
14. Network Optimization Steam Send Rate Max (KB) 2048 Integer Maximum allocated bandwidth rate (vanilla is 153).
14. Network Optimization Smart ZDO Sorting true true / false Prioritizes players, portals, and ships during network synchronization.
14. Network Optimization Adaptive Throttling true true / false Intelligently drops updates to clients with poor connections to prevent choke.
14. Network Optimization Smart Zone Ownership false true / false [Server Only] Transfers sector AI control to player with the lowest ping.
14. Network Optimization Zone Ping Threshold (ms) 120 50 - 500 Ping latency threshold required to trigger owner evaluation.
14. Network Optimization Zone Ping Hysteresis (ms) 30 10 - 100 Latency difference required to transfer possession to prevent flickering.
14. Network Optimization Zone Update Interval (sec) 5f 2f - 20f Evaluator tick interval for checking ping latency across active sectors.

📥 Installation

Automatic (Recommended)

  1. Install BepInExPack Valheim.
  2. Install Valheim Performance Overhaul via your mod manager of choice.

Manual

  1. Extract the BepInEx archive into your Valheim installation folder.
  2. Place the ValheimPerformanceOverhaul.dll inside the Valheim/BepInEx/plugins/ directory.
  3. Start the game.

🤝 Compatibility

  • Fully compatible with Jötunn and content expansion mods (Epic Loot, RtD, etc.).
  • Fully compatible with crossplay (Steam and Game Pass players can play together safely).
  • If you prefer the visual flicker of torches, you can disable Light Flicker Optimization in the settings.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.