Valheim: Eliminating Desync & Better Networking
In **Valheim**, the networking system uses a "Peer-to-Peer within a Dedicated Server" hybrid model. This often leads to the infamous **Desync**—where one player sees a door as closed while another sees it as open. This is primarily caused by strict internal limits on the "Data Rate" (packet size) the game is allowed to send per second.
1. The Packet Cap
By default, Valheim caps data transfer at roughly 64KB/sec. In large bases with 5,000+ building pieces, this cap is reached instantly, causing everything to "freeze" for the player.
2. Crossplay Conflicts
Using the **PlayFab** (Steam/Xbox Crossplay) backend can sometimes introduce higher latency than the pure Steam socket. Switch to Steam-only if all players are on PC.
3. Building Density
Each building piece is a "ZDO" (Z-Data Object). The more ZDOs in a 64m radius, the more data the server has to push to your client every time you move.
The "Better Networking" Solution
To fix these issues permanence, we recommend installing the **Better Networking** mod on both the server and the client.
- Increased Data Rate: It raises the internal cap from 64KB to 150KB+, allowing large bases to load without stuttering.
- Compression: It compresses the ZDO data packets, effectively doubling the amount of world info sent in the same bandwidth.
- Queue Management: It fixes how Valheim handles outgoing packets, preventing "overflow" disconnects during heavy boss fights.
Manual Fix (The assembly_valheim.dll Hack)
If you don't want to use mods, you can manually increase the data rate in the game's assembly file. Warning: This must be redone every time the game updates!
| Setting | Default Value | Recommended Value |
|---|---|---|
m_dataPerSec | 61,440 | 245,760 (4x Increase) |
m_dataPerSecLow | 30,720 | 122,880 |
m_minSendQueueSize | 2,048 | 8,192 |
Network Debugging (F5 Console)
To see your current network health in-game:
- Press F5 to open the console (ensure
-consoleis in your Steam launch options). - Type
pingto see your latency to the server. - Type
lqd(Log Quiet Desync) to see if you are losing packets. If you see high numbers here, your internal buffer is overflowing.
Pro Tip: Most desync is caused by the player with the Worst Internet Connection entering a zone first. In Valheim, the first person in an area becomes the "Network Owner" for that zone. Always let the player with the best ping lead the way into the base.
Build without fear of the "Desync Devil." Host your Valheim server with Supercraft and enjoy high-bandwidth routing optimized specifically for large-scale Viking architecture.