Valheim
You are viewing a potentially older version of this package. View Latest Version
Install with App

Details

Date Uploaded
2 days ago
Downloads
185
Size
27KB
ADDatHost Valheim hosting
30% off

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.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.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.