McPack
Evenly paced world updates for every player, with a bounded work budget, plus an unpinned Steam send rate.McPack
Every player gets an evenly paced turn to receive world updates, and Steam is allowed to pick its own send rate again.
Install it, leave the defaults alone, and put it on whatever machine is hosting.
The problem
Valheim hands out world updates in rounds. It waits 0.05 seconds, then serves exactly one connection per frame, always starting the walk from the same end of the peer list, then waits again.
Two things follow from that shape:
- A round costs one frame per connection. The gap between a given player's turns grows with the player count, and again with a slower server loop. The server is not busy during that gap; it is idle by design.
- The walk restarts from the same index every round, so the connection that happens to be first is structurally favoured and the last one starved.
That is what stale doors, late-arriving dropped items, rubber-banding ships and choppy map markers on a full server tend to come from.
What McPack does
Connections accrue credit at a fixed rate, and the cursor carries across frames. Turns rotate evenly and the pace per player stops collapsing as the server fills.
Measured against stock, at a 30 Hz server loop, with default settings:
| Players | Stock, per player | McPack, per player | Stock, total | McPack, total |
|---|---|---|---|---|
| 5 | 4.95/sec | 19.95/sec | 24.9/sec | 100/sec |
| 15 | 1.85/sec | 10.00/sec | 28.1/sec | 150/sec |
| 30 | 0.95/sec | 5.00/sec | 28.9/sec | 150/sec |
| 50 | 0.55/sec | 3.00/sec | 29.4/sec | 150/sec |
Note the last column. The total is capped, so the extra work does not grow with the player count. Small sessions run at the full rate; large ones stretch the per-player interval to stay inside the budget rather than overrunning the host. That ceiling is the setting to turn down if the host is struggling, and the one to turn up if it has headroom.
McPack also unpins Steam's send rate. Valheim sets the minimum and the maximum to the same number, 153600 bytes/sec, which does not just cap throughput — it removes Steam's ability to estimate bandwidth at all, because a range with equal ends has nothing to choose from. McPack restores a real range so Steam can climb on a healthy link and back off on a struggling one.
What it costs
Roughly five times stock's total send passes per second, bounded and predictable.
Each pass rebuilds and sorts one player's nearby-object list inside the game's
own code, so it is real CPU and real upload. That is the trade: more frequent
updates cost more work. TotalPassesPerSecond is where you decide how much.
McPack cannot fix packet loss, bad routing, slow hardware, or an uplink that is already saturated.
Where to install it
The scheduler matters on whichever machine is hosting — a dedicated server, or the player hosting the world. That is where the peer list lives and where the round-robin happens.
Clients can install it too; the Steam send-rate change applies to any machine running it. Unmodded clients can still join a server running McPack. Nothing is enforced and nobody is kicked for not having it.
Configuration
BepInEx/config/joaorodrigues.valheim.mcpack.cfg, written on first launch.
1 - General
| Setting | Default | What it does |
|---|---|---|
Enabled |
true |
Master switch. Off restores stock behaviour without uninstalling. |
2 - Send Scheduler
| Setting | Default | What it does |
|---|---|---|
FairScheduler |
true |
The even pacing described above. Off leaves the game's own scheduling alone. |
SendInterval |
0.05 |
Best-case seconds between one player's turns. Never goes faster than this. |
TotalPassesPerSecond |
150 |
The budget. Ceiling on send passes per second across all players. Stock lands near 30/sec at a 30 Hz loop. |
MaxPeersPerFrame |
8 |
Most players served in one frame, capping a single spike. 0 removes the cap and is not recommended on a busy server. |
If the host is struggling, lower TotalPassesPerSecond first — it is the one
that controls total cost. Lower MaxPeersPerFrame if the symptom is frame
spikes rather than sustained load.
3 - Steam
Ignored on crossplay connections, which use PlayFab rather than Steam sockets.
| Setting | Default | What it does |
|---|---|---|
TuneSteam |
true |
Restore a real min/max range instead of the game's pinned pair. |
SendRateMax |
1048576 |
Highest rate Steam may choose, in bytes/sec. A ceiling, not a constant rate. The game sets 153600. |
SendRateMin |
153600 |
Lowest rate Steam may choose. Keeping this low is good — it is the floor Steam backs off to. Raising it does not make a bad connection faster. |
SendBufferSize |
1048576 |
Bytes Steam may hold queued per connection. Too small rejects bursts; too large lets stale updates pile up. |
Compatibility
McPack takes exclusive ownership of the game's send-scheduling method while its scheduler is on. Another mod that replaces the same method will conflict; run one or the other. The prefix is registered at low priority so another mod's patch gets to decide first.
Each feature is patched independently. If a game update moves one of the two targets, that feature turns itself off and says so in the log, instead of taking the other one down with it. A send pass that throws for a single peer is logged and skipped rather than disabling the scheduler, and repeated failures fall back to stock scheduling for the rest of the world session.
Nothing about what gets sent, how it is chosen, or how it is serialised is touched — only how often each player gets a turn.
Installation
Install with a mod manager, or drop McPack.dll into BepInEx/plugins. A
dedicated server needs it in the server's own BepInEx/plugins folder;
installing it only in your personal profile does not install it on the server.
Requires BepInEx for Valheim.
Source
https://github.com/jcastro09/McPack
MIT licensed. Built from the game's own decompiled networking code; no other mod's source was used.
