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.
SmoothServer
Networking and performance tuning for Valheim dedicated servers: send cadence, adaptive per-peer budgets, async save, telemetry. Optional client half adds zstd compression and a shared map.
| Date uploaded | 6 hours ago |
| Version | 0.3.1 |
| Download link | Nosferatu-SmoothServer-0.3.1.zip |
| Downloads | 16 |
| Dependency string | Nosferatu-SmoothServer-0.3.1 |
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
SmoothServer
Networking and performance tuning for Valheim dedicated servers — and, since 0.3.0, an optional client half in the same DLL.
The server half is the point of the mod and it still needs zero client installs:
[General] EnforceClientMod defaults to false, so vanilla players can always join. Install the
same package on players' machines as well and you additionally get packet compression, a client
send budget and a server-wide shared map.
Installing
Server admins — install into the server's profile
(BepInEx/plugins/SmoothServer/). Everything under "Server modules" below starts working
immediately; nobody has to install anything. Config file: Nosferatu.SmoothServer.cfg in the
server's BepInEx/config/.
Players — install into your own profile only if the server also runs SmoothServer 0.3.0+.
[General] Mode is Auto: a dedicated server runs the server half, your game runs the client
half. You get compression, the client send budget and the shared map; server-owned settings are
pushed to you by the server.
The package contains six DLLs, not one: SmoothServer.dll plus ZstdSharp.dll,
System.Memory.dll, System.Buffers.dll, System.Numerics.Vectors.dll and
System.Runtime.CompilerServices.Unsafe.dll (the zstd codec and its dependencies — none ship
with Valheim or BepInEx). A mod manager handles this; hand-installers must copy all six.
Mods this replaces — uninstall them first
| Uninstall | Replaced by | Where |
|---|---|---|
| CW_Jesse / BetterNetworking | Compression + SteamRates + SendQueueGuard |
server and clients |
| Mydayyy / ServerSideMap | SharedMap |
server and clients |
Both must go from every machine. If BetterNetworking is still installed, Compression refuses
to patch (FAILED(...) in the module summary) and the rest of SmoothServer loads normally — it
will not break your server, it just will not compress. SharedMap imports an existing
<world>.mod.serversidemap.explored file once on first start, so no exploration is lost.
Server modules
Each module has its own Enabled toggle in its config section.
- Telemetry
[Telemetry]— periodic fps / frame-time / ZDO-rate log line. No gameplay effect. - FrameRate
[FrameRate]— raises the dedicated server's Unity frame cap. 60 is a good default on modern hardware: roughly +4pp of one CPU core for half the tick latency. - SendCadence
[SendCadence]— sends ZDO updates to every peer on a fixed interval (SendHz, default 20) instead of vanilla's one-peer-per-frame round robin. Scales with player count. - SendBudget
[SendBudget]— the ZDO send-queue high-water mark and minimum chunk size, exposed as config:HighWaterBytesdefaults to 65536 (vanilla 10240),MinChunkBytesto 2048 (same as vanilla). Acts as the fallback when AdaptiveBudget is off. - CreateBudget
[CreateBudget]— objects created per frame, exposed as config (default matches vanilla, i.e. a no-op until raised). - PeerTelemetry
[PeerTelemetry]— per-peer ping, throughput and Steam send-queue sampling. No patches; feeds AdaptiveBudget. - AdaptiveBudget
[AdaptiveBudget]— a per-peer send budget from each peer's measured bandwidth-delay product, clamped, EMA-smoothed, and backed off while Steam's pending byte count says the pipe is congested. A player on fibre next door and one on satellite no longer share one number. - SteamRates
[SteamRates]— raises Steam'sSendRateMax(default 1 MB/s).SendRateMinstays at vanilla on purpose: it is a floor on Steam's own bandwidth estimate, and raising it stops the congestion controller backing off for weak connections. - SendQueueGuard
[SendQueueGuard]— defers, never drops, while a peer's Steam send queue is backed up, and survives the Steamworks throws that can occur mid-handshake. - SyncListCache
[SyncListCache]— caches the per-peer sector scan inZDOMan.CreateSyncListbriefly; the filter and sort still run on every send. - VPOServer
[VPOServer]— the server-safe parts of ValheimPerformanceOptimizations (MIT):WearNTearsupport caching and a fasterReleaseNearbyZDOSscan. - AsyncSave
[AsyncSave]— pre-sizes the save clone list. Measured on a 136 000-ZDO world, main-thread autosave stall 67 ms → 47 ms and 78 ms → 45 ms. - GcThrottle
[GcThrottle]— rate-limitsResources.UnloadUnusedAssetson an idle server. - OwnershipRelease
[OwnershipRelease]— shortens the ZDO ownership-release interval from vanilla's 2 s (default 0.5 s) so objects change hands faster as players move. - MapSelfTest
[MapSelfTest]— headless unit tests for the shared-map codec at load; shows up asapplied PASSin the module summary. - StatsLog
[StatsLog]— writesstats-YYYY-MM-DD.jsonl(fps/frame time, ZDO counts, per-peer network/budget/compression state) everyIntervalSec(default 10s) andevents-YYYY-MM-DD.jsonl(joins/leaves, save stalls, GC sweeps, AdaptiveBudget backoff transitions, SendQueueGuard drops, config reloads) as they happen, toBepInEx/config/smoothserver/stats/by default. Rotates daily, prunes pastRetentionDays(default 30). Runtools/analyze.pyagainst a few days of these files for a markdown report — see the repo'stools/README.md.
What the client half adds
- Compression
[Compression]— both ends. zstd over Steam sockets using BetterNetworking's trained dictionaries, with an explicit per-message frame tag and anSS_Caps/SS_Readycapability handshake, so the receiver always knows whether a message is compressed. Peers without the mod stay uncompressed with no penalty. Typical self-test ratio on real ZDO traffic: ~8 % of the original size. - SharedMap
[Map]— both ends. The whole server shares map exploration and pins. The store is bit-packed and compressed (1.7 KB where ServerSideMap wrote 4.2 MB for the same world), the map size is read from your client rather than hardcoded, and updates are batched at 1 Hz into sparse chunks instead of one RPC per explored pixel. Merging goes through vanillaMinimap.Explore, so shared terrain bakes into your own map file and nothing is lost if the module is turned off. Pin sharing is configurable per pin type; death pins are off by default. - ClientNet
[Client]— client only. Your client's own ZDO send high-water mark (default 48 KB, vanilla 10 KB) and SteamSendRateMax. Inactive on a dedicated server.
Config
One file, Nosferatu.SmoothServer.cfg. Edits are picked up live on a running server
([General] HotReload) — no restart. Settings the server owns are pushed to clients that run the
mod (ServerSync); [General] entries stay machine-local.
Dependencies
- BepInExPack_Valheim 5.4.2333
Credits
- zstd dictionaries and the compression idea: CW_Jesse's BetterNetworking (MIT).
VPOServer: ValheimPerformanceOptimizations (ontrigger, MIT).- Config sync: blaxxun-boop's ServerSync (MIT-0).
SharedMapis a clean-room reimplementation inspired by Mydayyy's ServerSideMap (MIT/Unlicense).- Server-authoritative ownership idea: ddormer's Serverside Simulations (no published license — idea only, no code taken).
Source & issues
https://github.com/MJensen01/SmoothServer — MIT licensed.
CHANGELOG
Changelog — SmoothServer
0.3.1 (2026-09-07)
Fix: server-side Steam socket modules used the client Steam interface on dedicated servers
(connections failed). The two builds of assembly_valheim.dll are compiled differently:
ZSteamSocket calls SteamNetworkingSockets on the client and SteamGameServerNetworkingSockets
on the dedicated server, and only the matching half of Steamworks is initialised in each process.
SendQueueGuard re-implemented vanilla's send drain with the client interface hard-coded, so on a
dedicated server every send threw Steamworks is not initialized., no client could finish its
handshake, and joiners were dropped with "Socket closed by peer". It no longer re-implements the
drain at all: it wraps the vanilla one with a prefix/finalizer pair, so the game picks the
interface its own build was compiled for. Back-off and once-per-episode logging are unchanged
(progress is now measured through m_totalSent instead of the EResult). PeerTelemetry probes
the build's own interface first and stops calling GetConnectionQuality where vanilla itself
calls the wrong one, taking ping/quality/throughput off the real-time status instead. SteamRates
no longer warns on the missing client interface — the first refusal per interface is noted once at
Info and that interface is never touched again. New [General] SteamSelfTest (off by default,
machine-local) logs which half of Steamworks is live and, straight out of ZSteamSocket's IL,
which interfaces this build actually calls — turn it on once after a game update to re-prove it.
StatsLog: persistent JSONL stats + events for multi-day analysis. [StatsLog] (server-side,
on by default) writes stats-YYYY-MM-DD.jsonl every IntervalSec (default 10s) — fps/frame
time, ZDO/scene counts, per-peer RTT/pending/in-flight/queued bytes, AdaptiveBudget target +
congestion, Compression framing state, and compression byte deltas — plus events-YYYY-MM-DD.jsonl
for player join/leave, world-save stalls, GC sweeps, AdaptiveBudget backoff transitions,
SendQueueGuard drops and config reloads, as they happen. Files land in
BepInEx/config/smoothserver/stats/ by default, flush on every write, rotate daily (UTC) and are
pruned past RetentionDays (default 30). IntervalSec/RetentionDays hot-reload. A companion
tools/analyze.py (stdlib-only) turns a few days of logs into a markdown report — sessions,
frame-time percentiles, per-player RTT/pending-bytes, AdaptiveBudget backoff time, compression
ratio, save stalls, ZDO growth, and the worst 10-second windows.
0.3.0 (2026-09-07)
SmoothServer is now a both-ends mod. The same SmoothServer.dll runs on a dedicated server
and in a player's BepInEx profile; [General] Mode (Auto/Server/Client) picks the half, and a
module that does not belong to the running half reports disabled(side) and patches nothing.
[General] EnforceClientMod defaults to false, so nothing changes for existing server
admins: SmoothServer still works as a pure server-side mod with zero client installs, and
vanilla clients can still join. Turn it on only if your whole group installs the mod.
Read this before updating
- BetterNetworking must be uninstalled — on the server and on every client. SmoothServer's
Compressionmodule replaces it and the two cannot coexist (both wrapZSteamSocket's send queue). If BetterNetworking is present,Compressionrefuses to patch and reportsFAILED(...); the rest of the plugin still loads. - ServerSideMap must be uninstalled — on the server and on every client.
SharedMapreplaces it. On first start SmoothServer imports your existing<world>.mod.serversidemap.exploredfile automatically (once), so no exploration is lost. - The zip now contains six DLLs, not one.
SmoothServer.dllplusZstdSharp.dll,System.Memory.dll,System.Buffers.dll,System.Numerics.Vectors.dllandSystem.Runtime.CompilerServices.Unsafe.dll. A mod manager installs all of them; if you copy files by hand, copy all six intoBepInEx/plugins/SmoothServer/.
New server modules
- PeerTelemetry
[PeerTelemetry]— per-peer ping, throughput and Steam send-queue sampling. No patches; it is the input to AdaptiveBudget and the source of the per-peer log line. - AdaptiveBudget
[AdaptiveBudget]— per-peer ZDO send budget derived from each peer's measured bandwidth-delay product, clamped and EMA-smoothed, backing off while Steam's pending byte count says the pipe is congested. SendBudget's configured value becomes the fallback. - SteamRates
[SteamRates]— raises Steam'sSendRateMaxon the game-server networking interface (default 1 MB/s).SendRateMinis deliberately left at vanilla. - SendQueueGuard
[SendQueueGuard]— defers (never drops) sends while a peer's Steam queue is backed up, and swallows the "Steamworks is not initialized" throws that can happen mid-handshake. - SyncListCache
[SyncListCache]— caches the per-peer sector scan inZDOMan.CreateSyncListfor a short window; the filter and sort still run on every send. - VPOServer
[VPOServer]— server-safe parts of ValheimPerformanceOptimizations (MIT):WearNTearsupport caching and a fasterReleaseNearbyZDOSscan. - AsyncSave
[AsyncSave]— pre-sizesZDOMan.GetSaveClone()'s list from the live ZDO count. Measured on a 136 000-ZDO world: main-thread autosave stall 67 ms → 47 ms and 78 ms → 45 ms. - GcThrottle
[GcThrottle]— rate-limitsResources.UnloadUnusedAssetson an idle server. - OwnershipRelease
[OwnershipRelease]— shortens the ZDO ownership-release interval from vanilla's 2 s (default 0.5 s), so objects change hands faster as players move.
New both-ends / client modules
- Compression
[Compression], both ends — zstd (ZstdSharp, pure managed) over Steam sockets using BetterNetworking's trained dictionaries. Explicit 1-byte frame tag and anSS_Caps/SS_Readyhandshake, so the receiver never guesses and never uses an exception as a signal; a peer without the mod simply stays uncompressed. Self-tested at load. - SharedMap
[Map], both ends — server-side shared map exploration and pins, replacing ServerSideMap. Bit-packed and compressed store (1.7 KB where ServerSideMap wrote 4.2 MB for the same world), map size read from the client instead of hardcoded, deltas batched at 1 Hz into sparse chunks instead of one RPC per pixel. Merges through vanillaMinimap.Explore, so shared pixels bake into your own map file. Optional death-pin sharing. - MapSelfTest
[MapSelfTest], server — headless unit tests for the map codec, run at load. - ClientNet
[Client], client only — the client's own ZDO send high-water mark (default 48 KB) and SteamSendRateMax. Never active on a dedicated server.
Other
- Modules are now discovered by reflection: one
[BepInPlugin], one config file, one module summary line, hot reload covering every module. - Config sharing via ServerSync — the server's values win on clients that run the mod.
SendBudget's high-water hook now defers to AdaptiveBudget per peer;[AdaptiveBudget] UseCallSiteSwapis a legacy path and now defaults tofalse.
0.2.0 (2026-09-06)
- Renamed from
OrionNet. New plugin GUIDNosferatu.SmoothServer, new config fileNosferatu.SmoothServer.cfg. Oldnet.mjensen.orion.net.cfgsettings are not migrated — re-apply them once. - Live config reload (hot reload): edits to the cfg file are picked up on a running server
without a restart (
[General] HotReload).
0.1.0 (2026-09-06)
- Initial release. Modules:
Telemetry,FrameRate,SendCadence,SendBudget,CreateBudget. - Server-only; no client install required.