Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

AuthoritativeStep

A step on a world that decides outcomes: a room’s, or a game played alone. A system with no runsOn receives one, and if (step.authoritative) narrows a SystemStep to it. It is the Authority every outcome function takes first, dealDamage(step, target, damage), and a call that only the room may make, such as a knockback through pushCharacter from a system that is not a predicted system, takes it too.

Property Modifier Type Description
[authorityBrand] readonly true -
[entityAuthorityBrand] readonly true -
authoritative readonly true True: this world decides outcomes, as isAuthoritative says.
deltaSeconds readonly number The step’s length in seconds: one tick of the world, 1/60 at 60 ticks a second and 1/30 at 30, as readTickRate names the rate.
input? public StepInput What the characters under the client’s authority read. Left out where the caller steers none, as a room’s server does: each character keeps what it was last sent.
moverRecords? public readonly MoverRecords[] Where the movers keep this step’s calls: one list an entity, the one whose entity names it, holding a record for each of its first four mover calls. A re-run call takes its record in place of sweeping where nothing the call reads has changed, and a page keeps one list for each entity of the player’s set on each step it may re-run. Left out, the movers keep none.
pushes? public boolean On a re-run, whether a character pushes a dynamic body it walks into, as the world’s own step does: a client’s replay, which does not rewind the body, leaves it.
rerunEntities? public readonly Entity[] The entities a re-run steps: the player’s page’s predicted set, as the room’s last word names it, re-run together after a correction. Only the predicted systems run on such a step, each once a tick over every entity of the set and nothing else, and input is left out: each steps on the InputTrait it holds. Left out on the world’s step.
tick readonly number The room’s tick the step is for: on a room, its own step; on the player’s page, the tick the player’s page leads the room on, a replayed step the tick it first ran on; in a game with no room, its own step, from 0.
world readonly World The world the step runs on, to read, as a hook that receives a step, such as onPlayerDisconnect(step, player), reads it: a step writes through itself, never through its world.