Skip to content

API Interface SystemDef

github-actions[bot] edited this page Nov 24, 2026 · 3 revisions

Interface: SystemDef

Defined in: src/engine/core/systems.ts:36

Properties

after?

readonly after?: readonly string[];

Defined in: src/engine/core/systems.ts:40


before?

readonly before?: readonly string[];

Defined in: src/engine/core/systems.ts:41


name

readonly name: string;

Defined in: src/engine/core/systems.ts:38

Unique name, e.g. game.ScrollSystem. Other systems can order against it.


phase

readonly phase: Phase;

Defined in: src/engine/core/systems.ts:39


predicted?

readonly predicted?: boolean;

Defined in: src/engine/core/systems.ts:65

A predicted system (ADR 0033 §6, T13; Unity's PredictedSimulationSystemGroup): it moves the state the owning client predicts. fixedUpdate only. Default false.

On servers and in Worlds that aren't networked it runs like any other system. On a network client it runs on the prediction timeline (net/prediction.ts):

  • its rows are only the ghosts this client predicts (Replicated.isPredictedLocally), not their children or any other node;
  • it runs once per predicted tick (time.network.serverTick), so a fixed step can run it more than once (catching up skipped ticks) or not at all (its tick was already simulated);
  • when a snapshot corrects a prediction, it runs again for the ticks since that snapshot (re-simulation), with Move.of(node) returning each tick's input. So keep it deterministic, and let it change only its rows' predicted values (the transform, data fields listed in replicate(def, { predicted }), behavior fields declared { predicted: true }). On a client, predicted systems always run after engine.PredictionTick.

query?

readonly query?: readonly QueryTerm[];

Defined in: src/engine/core/systems.ts:43

Rows include only nodes that are active in the hierarchy and have every term.


worlds?

readonly worlds?: readonly WorldTag[];

Defined in: src/engine/core/systems.ts:48

Tags of the Worlds this system is meant for (ADR 0032): it runs in Worlds with any of them ("*": every World). Default ["default", "local"]. Adding it to a World by name works regardless.

Methods

run()

run(rows, ctx): void;

Defined in: src/engine/core/systems.ts:67

rows iterates row by row, and gives typed-array columns for hot loops (rows.column, ADR 0064).

Parameters

rows

Rows

ctx

SystemContext

Returns

void

Clone this wiki locally