Kou-kou_fixdesync icon

kou fixdesync

A mod that helps desync/lag in valheim. Server can tune configs to find the best setup.

By Kou
Last updated 2 weeks ago
Total downloads 58
Total rating 0 
Categories Server-side
Dependency string Kou-kou_fixdesync-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2333 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2333

README

kou_fixdesync

Quality-of-life mod that fixes multiplayer desync and lag in Valheim by removing the game's artificial network throttles. Built for Steam/PC dedicated servers and clients. Players without the mod can still join — the mod never changes the network message format.

The problem

Valheim syncs the world through ZDOs (zone data objects). By default the game:

  • Caps outstanding sync data at 10 KB per player — including bytes already sent but not yet acknowledged. On any connection with real latency this throttles world updates to a trickle, and high-ping players (overseas friends) get starved almost completely. This is why chests take 10-30 seconds to open, mobs freeze or teleport, and other players rubber-band.
  • Updates one player per frame, round-robin — the more players online, the less often each one gets updates.
  • Pins Steam's send rate to a fixed 150 KB/s and disables its congestion control by setting min = max.
  • Only syncs distant-zone objects when almost nothing else is queued, so far-away terrain and builds stay stale.
  • Hands mob simulation to whichever nearby player claims it first — regardless of that player's ping — so one laggy player makes mobs lag for everyone.

What the mod does

Feature Default game With mod
Send window 10 KB fixed 60 KB default, automatically scales with each player's ping (window = target rate x round-trip time), hard-capped at 256 KB for safety
Update cadence 1 player per frame Every player, every 50 ms tick
Steam send rate 150 KB/s pinned 256 KB/s - 1 MB/s, congestion control active
Distant object sync Threshold 10 Threshold 30
Mob simulation ownership First-come Lowest-ping player; migrates mobs off players over 150 ms ping when a player under 80 ms is nearby (10 s cooldown so it never flaps)

Every feature can be turned on/off and tuned individually.

Install

Server (required):

  1. Install BepInExPack for Valheim (the dependency listed above).
  2. Put kou_fixdesync.dll into BepInEx/plugins/.
  3. Start the server once to generate the config, then tune BepInEx/config/kou.fixdesync.cfg.

Clients (recommended): same steps. Server-only already fixes most of the lag (everything you receive); installing on clients also fixes what others see of you, because each client sends its own player/mob data through the same throttled path. Players without the mod can still join normally.

The server dictates the config

You only ever need to edit the server's config file. When a modded client joins, the server pushes its settings to that client automatically over a custom RPC; the client applies them for the session and reverts on disconnect. Clients can never push settings to the server.

This makes A/B testing configs easy: change the server's .cfg, restart the server, and every modded client follows the new settings on their next join — no client-side editing at all.

Restart required: the config is read at startup. After any config change, restart the server (and clients should rejoin) for the new values to apply.

Configuration (BepInEx/config/kou.fixdesync.cfg)

[1.SendWindow] — the main desync fix

  • Enabled (default true) — enlarge the per-player send window.
  • WindowBytes (default 61440) — window size in bytes. Clamped 10240-262144.
  • MinWindowBytes (default 2048) — minimum free window before a batch is sent.
  • PingAdaptive (default true) — scale each player's window with measured ping so high-ping players are not starved. Strongly recommended for international servers.
  • TargetRateKBps (default 300) — per-player target rate used by the adaptive scaling.

[2.SendCadence]

  • Enabled (default true) — service all players every tick instead of one per frame.
  • SendIntervalMs (default 50) — tick interval. Lower = snappier, more CPU/bandwidth. Clamped 20-200.

[3.SteamRates]

  • Enabled (default true) — raise Steam's socket rate limits.
  • SendRateMinKBps (default 256) / SendRateMaxKBps (default 1024) — keep max above min so Steam's congestion control can adapt to bad routes.

[4.DistantSync]

  • Enabled (default true), DistantThreshold (default 30) — how eagerly distant-zone objects are synced. Raise if far-away builds appear late.

[5.SmartOwnership] — server only

  • Enabled (default true) — ping-aware mob simulation assignment.
  • PingCeilingMs (default 150) — migrate mobs away from owners above this ping.
  • PingFloorMs (default 80) — only migrate when a player below this ping is nearby.
  • CooldownSec (default 10) — per-object cooldown between migrations.

Suggested tuning

  • Still choppy with many players? Raise TargetRateKBps to 400-500 and SendRateMaxKBps to 2048 (needs server upload bandwidth to match: ~0.5 MB/s per active player at the defaults).
  • Weak server upload? Lower TargetRateKBps to 150-200.
  • Isolating a problem? Toggle features off one at a time — each Enabled flag independently returns that mechanic to its original game behavior.

What it cannot do

Latency itself is physics: a player at 300 ms ping still acts 300 ms late, and mobs simulated on a player's PC carry some of that player's delay when they are alone in an area. The mod removes the artificial starvation stacked on top of ping — the difference between unplayable rubber-banding and playable delay.