Skip to content

PredictionOptions

Defined in: net/replication/client.ts:51

Client-side prediction for owned entities. apply is the same input-to- state logic the server’s gameplay runs (register one function, use it on both ends — the single source of the movement rules); with it enabled, sendInput also applies the command locally and unacknowledged commands replay on top of every authoritative update.

apply: (world, entity, actions, dt) => void

Defined in: net/replication/client.ts:54

Advance one owned entity by one fixed tick of actions. Must depend only on world state + actions + dt (it re-runs during reconciliation).

World

number

Record<string, unknown>

number

void


optional maxPendingInputs?: number

Defined in: net/replication/client.ts:56

Cap on unacknowledged commands kept for replay (default 120).


optional smoothing?: PredictionSmoothing

Defined in: net/replication/client.ts:64

Ease reconciliation corrections out instead of hard-snapping: the numeric fields of owned entities keep a decaying visual error toward their pre-correction value. Purely presentational — the simulation rebuilds from the authority copy every tick regardless, so the error can never accumulate. Off by default (corrections snap).