Networking · interface

AuthorityOptions

Explained in Networking and rollback.

interface AuthorityOptions<S>
import type { AuthorityOptions } from '@driftengine/network';

Properties

NameTypeDescription
transportreadonlyTransport
loopreadonlyRewindLoop<S>
inputsreadonlyInputLog
replicatorreadonlyReplicator
stateEveryreadonlyoptionalnumberHow often the authoritative state is published, in ticks.
More

Three at 60 Hz is twenty a second, which is what most shipped netcode settles near: often enough that a correction is small, rare enough that the bandwidth is a fraction of what a per-tick broadcast costs. A consumer whose state is tiny can publish every tick and one whose world is large should publish less and send deltas.

maxStateBytesreadonlyoptionalnumberRoom for one encoded state. 8 KB by default; a state that does not fit is a state to delta.