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.
Properties
Section titled “Properties”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).
Parameters
Section titled “Parameters”entity
Section titled “entity”number
actions
Section titled “actions”Record<string, unknown>
number
Returns
Section titled “Returns”void
maxPendingInputs?
Section titled “maxPendingInputs?”
optionalmaxPendingInputs?:number
Defined in: net/replication/client.ts:56
Cap on unacknowledged commands kept for replay (default 120).
smoothing?
Section titled “smoothing?”
optionalsmoothing?: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).