Networking · type

SimStep

One fixed step. The signature LoopHooks.simulate has, so a consumer passes theirs straight in.

Explained in Networking and rollback.

type SimStep = (dt: number, tick: number) => void
import type { SimStep } from '@driftengine/network';

In depth

It may be called more than once for the same tick. That is the mechanism rather than an edge case: every correction reaching back past a tick replays it. A step that only reads and writes simulation state is re-runnable by construction; one that plays a sound, sends a packet or appends to a log is not, and will do that thing again. See this file's header.