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.
模組介紹 作者原文
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
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: