Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
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
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2333README
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):
- Install BepInExPack for Valheim (the dependency listed above).
- Put
kou_fixdesync.dllintoBepInEx/plugins/. - 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(defaulttrue) — enlarge the per-player send window.WindowBytes(default61440) — window size in bytes. Clamped 10240-262144.MinWindowBytes(default2048) — minimum free window before a batch is sent.PingAdaptive(defaulttrue) — scale each player's window with measured ping so high-ping players are not starved. Strongly recommended for international servers.TargetRateKBps(default300) — per-player target rate used by the adaptive scaling.
[2.SendCadence]
Enabled(defaulttrue) — service all players every tick instead of one per frame.SendIntervalMs(default50) — tick interval. Lower = snappier, more CPU/bandwidth. Clamped 20-200.
[3.SteamRates]
Enabled(defaulttrue) — raise Steam's socket rate limits.SendRateMinKBps(default256) /SendRateMaxKBps(default1024) — keep max above min so Steam's congestion control can adapt to bad routes.
[4.DistantSync]
Enabled(defaulttrue),DistantThreshold(default30) — how eagerly distant-zone objects are synced. Raise if far-away builds appear late.
[5.SmartOwnership] — server only
Enabled(defaulttrue) — ping-aware mob simulation assignment.PingCeilingMs(default150) — migrate mobs away from owners above this ping.PingFloorMs(default80) — only migrate when a player below this ping is nearby.CooldownSec(default10) — per-object cooldown between migrations.
Suggested tuning
- Still choppy with many players? Raise
TargetRateKBpsto 400-500 andSendRateMaxKBpsto 2048 (needs server upload bandwidth to match: ~0.5 MB/s per active player at the defaults). - Weak server upload? Lower
TargetRateKBpsto 150-200. - Isolating a problem? Toggle features off one at a time — each
Enabledflag 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.