
You are viewing a potentially older version of this package. View Latest Version
SmoothSync
Client-side smoothness and safety: smooth remote ships/players, no zone-border hitches, lighter Drakkar sail, actions pause when the server connection stalls. Optional.SmoothSync
Client-side fix for movement jitter in multiplayer Valheim. Optional: only the players who install it benefit, the server does not need it and nothing is enforced.
Why vanilla jitters
- Objects owned by another player (ships, carts, players, creatures) are positioned in
FixedUpdate(50 times a second) by writing the transform directly. That bypasses Rigidbody interpolation, so on a 144-240 Hz screen they move in steps. - Standing still on a ship you do not own teleports your own character onto the ship every physics step, which makes your character and the camera step as well. Only the ship's owner gets the smooth (velocity) path.
- Owners send their state 20 times a second.
- The Drakkar's cloth sail is told its parameters changed on every physics step, on every client.
What it does
- Remote ships, carts, players and creatures are driven with velocity (owner's velocity + a short time-based correction) and rendered with Rigidbody interpolation: smooth at any frame rate, robust to packet timing.
- Standing on someone else's ship uses the same velocity correction the owner uses instead of the teleport.
- Your client sends the objects it owns twice as often (40/s).
- Taking the helm makes you the ship's owner (no input delay for the driver).
- Ships with a cloth sail (Drakkar): vanilla re-applies the cloth parameters every physics step even when nothing changed; now only while the sail is actually being furled or unfurled.
- Logs frames slower than 50 ms with garbage-collection and object-creation counts (diagnostics, can be turned off).
All parts can be toggled in the config (nuckflare.smoothsync.cfg).
Changelog
- 1.3.0 - Connection guard: when no ping has arrived from the server for 3 s, player input for interacting, building, removing, repairing and hotbar use is ignored, attacks/mining, picking up and dropping are blocked, and the inventory/container/crafting window closes and cannot be opened, with a message, until pings return. Valheim only drops a dead connection after 30 s, and everything done in between never reaches the server (rocks come back, items vanish or duplicate, you can respawn inside rock). Walking stays possible. The block sits at the input, so other mods' actions (e.g. grid planting) are stopped as well. 0 = off.
- 1.2.0 - World streaming: after crossing into a new zone, what vanilla loads around the zone you just left is kept until you are half a zone (32 m) past that border, so moving back and forth no longer rebuilds the same row of zones; removal is spread over frames (at most 80 objects per pass; Unity destroys at the end of the frame, so it is a count, not a time budget); dungeon rooms are placed over several frames (the zone stays locked as loading until the last room exists). Characters and synced physics objects keep vanilla behaviour. Each part can be switched off. Removed the Unity warnings 'Setting linear/angular velocity of a kinematic body' (ownership handover and creature death animation).
- 1.1.2 - Fixed: other players could shove and launch you. Remote characters are now moved kinematically (MovePosition, still interpolated) instead of by velocity, so they carry no momentum into collisions and cannot get stuck on obstacles the owner passed. Ships and carts unchanged. Original kinematic state is restored on hand-back.
- 1.1.1 - Fixed: the player at the helm (and anyone standing on a moving ship) jittered for others: Valheim stores the ship's world velocity in the key that should hold the velocity relative to the ship, so the mod added the ship's speed twice. The relative velocity is now measured from the relative position. Objects handed back to vanilla (Lox riders, smoothing turned off, objects you take ownership of) get their original Rigidbody interpolation back. 'Smooth standing on other players ships' only works together with smoothing (otherwise you would slide on a remote ship).
- 1.1.0 - Fixed: 1.0.x never loaded (a config key contained an apostrophe, which BepInEx rejects, so the mod stopped before applying its patches). Drakkar cloth sail: parameters are re-applied only while the sail is furled/unfurled (vanilla did it every physics step). Per-minute frame-time summary in the log (fps, p50/p95/p99, ship code time).
- 1.0.0 - First release.