
InnangardServerLagFix
Multiplayer patches aimed at Innangard 0.1.9 (improves fps / eliminate network delay / desync)Install on both Server and Client, with Innangard- These are patches/safeties I believe Innangard should have by default
CURRENT BEHAVIOR
----------------
1. Station reservations no longer steal station ZDO ownerships merely because a settler is planning, walking to, waiting for, renewing, or releasing a job reservation. This is not needed for the most part and is what caused stations to de-sync.
2. StationClaim.Take is deduplicated when the same valid claim is already present.
3. StationClaim.Renew only rewrites the lease when <=15 seconds remain.
4. StationClaim.Release uses a 1-second same-station retake grace period to avoid needless release/take churn when AI immediately chooses the same station again.
5. Innangard's existing mutation-time Ownership.Take calls remain at their audited real action callsites. Actual world/inventory/machine mutations still acquire authority when they genuinely need it.
6. On a dedicated server, the ordinary-object JIT (Just In Time) ownership guard prevents an Innangard mutation path from stealing a ZNetView already owned by a connected client. It also conservatively leaves an ownerless ordinary object alone while a player is within HandoffRadius so normal Valheim/client ownership can handle it.
7. Locally-owned Innangard_Settler replication is throttled to reduce redundant ZDO writes while preserving normal local movement, animation and AI execution:
transform: 20 Hz
velocity: 20 Hz
animation float: 20 Hz per parameter
Immediate writes bypass the rate limit for meaningful changes:
transform distance: >=0.25 m
transform angle: >=10 degrees
velocity delta: >=0.50
animation delta: >=0.10
This saves up to 70% networking deltas that don't change anything visually. Big contributor to network delays/desync if you fill the pipe. Could probably be reduced to 10hz fine.
8. Settler ownership and simulator selection remain Innangard/Valheim default. This plugin does not alter Innangard's normal resident ownership logic.
9. Client death/respawn safety: on player clients, station-lease overrides are inactive whenever there is no live local player, and pending deferred releases / shadow leases are discarded on entry to that state. On every non-dedicated peer, settler replication throttling is inactive without a live local player. Sync-write scopes are finalizer-protected so they are restored even if a patched sync method throws. Dedicated-server behavior is unaffected by this safety gate.

