BetterNetworking Valheim
Improve multiplayer network performance using compression, queue size, send rate, and other features. Valheim 1.0 fork with guarded patches, legacy config migration. With optional portal ghost fix.
About this mod Author’s original text
Better Networking - Valheim 1.0
An updated networking mod for Valheim 1.0, based on
CW-Jesse's Better Networking.
This is not an official continuation of the original project. It is a compatibility-focused fork compiled against Valheim 1.0.15 (network version 40).
Do you need this on Valheim 1.0?
Not always. If you have network issues give it a try. It can compress network traffic maybe it help a bit.
Install on both on the clients and on the server too.
The mod has some improvements in the but you can configure to only compress the network data with the VanillaSafe setting.
Valheim 1.0 can work perfectly well without a networking mod, especially with one or two players and stable connections. Start with vanilla networking if your server has no noticeable lag or desync.
This mod can still be useful when:
- several players are online at the same time;
- players explore or use portals together;
- large bases or heavily modified worlds generate many ZDO updates;
- a player with limited upload bandwidth becomes the simulation owner of an area;
- the server or clients benefit measurably from network compression.
It cannot fix every multiplayer problem. Valheim distributes parts of world simulation between peers, so a slow or overloaded player can still cause lag for the area they own.
Why was a new build needed?
The commonly available tibijczyk release describes itself as a rebuild of the old mod for Valheim 0.221.10.
Valheim 1.0 changed relevant networking code, while that rebuild kept the original patch logic.
Simply recompiling the old source is not enough because:
- Steamworks packages left in the send queue could be compressed again after a failed send attempt;
- PlayFab now reports its queue using a scaled 0.25 × inFlightBytes value, which the old queue patch treated as raw bytes;
- PlayFab's direct compression and reconnect paths changed;
- the old connection buffer used one shared package list instead of keeping buffers separated per connection;
- private Harmony targets can still exist after a game update while their surrounding logic has changed.
This fork updates those paths instead of only rebuilding the old DLL.
What this version changes
- Compresses each Steamworks packet only once.
- Handles Valheim 1.0's PlayFab worker, direct compression and reconnect paths.
- Changes the ZDO send budget directly instead of spoofing PlayFab's queue measurement.
- Keeps the experimental new-connection ZDO buffer disabled by default.
- Uses a separate buffer for every connection when that feature is enabled.
- Verifies sensitive IL patterns before modifying them.
- Logs every patch as PATCH OK, PATCH SKIP or PATCH FAILED.
- Provides a VanillaSafe mode for troubleshooting/only compressing without any changes in the networking.
- Optional portal ghost fix - refreshes teleported player and linked status-effect ZDOs to work around portal ghosts, including magic barrier left at the source portal.
Installation
- Remove the old BetterNetworking.dll from the server and every client.
- Copy DIT.BetterNetworking10.dll into:
BepInEx/plugins/BetterNetworking_Valheim/
- Install it on the dedicated server and on every modded client.
- Restart the server and all clients completely.
Compression is negotiated per connection and is used only when both peers run this compatible build. Do not keep the old and new Better Networking DLLs installed together.
The configuration file is created after the first launch:
BepInEx/config/DIT.BetterNetworking10.cfg
If this is the first launch and BepInEx/config/CW_Jesse.BetterNetworking.cfg
exists, compatible settings are imported automatically into the new file. The
legacy file is not modified. The experimental connection buffer is deliberately
left disabled during migration.
The new plugin keeps its own GUID and configuration filename so BepInEx can
reliably detect an accidentally installed old Better Networking DLL. Delete the
new configuration file and restart if you intentionally want
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.
Install these first, or the mod will not work: