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

core

const core: Readonly<{ saves: CoreSaveHandles; systems: CoreHandles<FlatHandles<object & object>>; }>

The core: the step’s own machinery, which every world runs. A game never lists it, omits it or replaces it, and anchors to its systems by their handles: after: [core.systems.physics]. Every other system is an engine plugin’s, reached on its factory, behaviours.systems.chase, or a game’s own.

The step runs them in this order with every engine plugin listed:

Phase System Plugin Runs on What it does
input core.placeFlights the core room and page, predicted system Places each body a flight drives at its pose for the tick, from its last launch.
input tracks.copyInput tracks() room and page Copies the player’s steer and jump into each track mover under the client’s authority.
input core.copyInput the core room and page Copies the player’s input into each entity the player controls under the client’s authority.
input core.noteActivity the core room Notes each player’s last input off its rest, or a turn of the look, which readIdleSeconds reads.
input characters.walk characters() room and page, predicted system Sends each character a walk command names along the navmesh to its point, and stops each a stop command names: on the sender’s page at once, and on the room on the same tick.
input abilities.approach abilities() room and page Walks each caster toward the target of its pending cast, as a click to walk does, and stops it once the target is in range.
motion stats.expireModifiers stats() room and page Counts down each timed stat modifier, and drops it once spent.
motion stats.copyFields stats() room and page, predicted system Sets each field a stat is registered to from the entity’s stat.
motion core.move the core room and page, predicted system Moves each entity by its velocity.
motion core.blendCorrections the core page Closes the drawn offset of each character the room corrected, so the correction eases in.
motion tracks.move tracks() room and page Moves each track mover along its track, and stands its entity there.
motion tracks.markTriggers tracks() room and page Marks the track triggers a mover stands in, enters or leaves.
rules core.markUnseen the core room Throttles or suspends each character no player controls that no page wants under interest culling, as its unseen says, and wakes each a page wants or that needs physics.
rules cooldowns.countDown cooldowns() room and page, predicted system Counts down each entity’s cooldowns, and ends each: a character’s on the player’s page too, which predicts them.
rules inventory.takeItemCommands inventory() room Runs each item verb a player asked of their character.
rules inventory.useItems inventory() room Runs the uses asked of each entity’s items.
rules behaviours.spin behaviours() room and page Turns each spinning entity round y.
rules behaviours.bob behaviours() room and page Rises and falls each bobbing entity.
rules behaviours.pickup behaviours() room Credits each pickup to the wallet behind the nearest target it reaches, and removes it.
rules inventory.loot inventory() room Puts each loot the nearest of its targets reaches into that target’s bag as far as it fits.
rules behaviours.interact behaviours() room and page Marks each Interact one of its targets stands near.
rules behaviours.choose behaviours() room Chooses the one exclusive Interact each player’s press fires: of those within their distance tolerance of the nearest, the one the player faces most.
rules behaviours.takeInteracts behaviours() room Takes each interact command within its Interact’s reach.
rules behaviours.trigger behaviours() room and page Marks each trigger its targets stand within, and raises each one’s enter and exit.
rules behaviours.capHealth behaviours() room Clamps each health under its maximum.
rules behaviours.reapDead behaviours() room Removes each entity at zero health, and downs a player’s character or one with a respawn instead.
rules behaviours.respawnDowned behaviours() room Stands each downed entity with a respawn that is no player’s character, such as a crate, an NPC or a kart, again once its wait is spent.
rules characters.teamChange characters() room Downs each living player’s character whose player switched teams or was moved by a balance, or moves it as teamChange says, and spawns a character for each player who waited for a team.
rules characters.respawn characters() room Stands each downed player’s character, one a player may control that the character controller moves, again once its respawn’s wait is spent, and runs each plugin’s onCharacterRespawn.
rules behaviours.chase behaviours() room Points each chaser’s velocity at its set target or the nearest of its targets, and parts chasers that overlap.
rules resources.regenerate resources() room and page, predicted system Regenerates or decays each resource, such as mana, between 0 and its maximum: a character’s on the player’s page too, which predicts it, health aside.
rules abilities.cast abilities() room and page, predicted system Starts or refuses each cast a player sent, and winds each cast down to its release, its cancel or its fizzle: on the player’s page too, up to the release’s outcomes, which the room alone decides.
rules weapons.takeFireCommands weapons() room Fires each shot a player sent in a game played alone.
rules weapons.flyProjectiles weapons() room and page Flies each projectile, and damages the first target it meets.
rules npcs.takePicks npcs() room Takes each pick a player sent in their conversation.
rules matches.takeRequests matches() room Takes each page’s start, restart, reset, join, leave, ready, forfeit and spectate.
rules matches.advance matches() room and page Admits, seats, scores, decides and resets each match.
rules npcs.converse npcs() room and page Starts a conversation on each press of an NPC with a Dialog, and moves each conversation on.
rules npcs.runRoutines npcs() room and page Sends each NPC’s routine what happened to it, and does the step it is on.
rules machines.advance machines() room and page Moves on each state machine whose wait the step’s tick has spent or whose when holds.
rules abilities.keepRefusals abilities() room and page Files each cast refusal for the devtools’ ability inspector.
physics characters.outOfWorld characters() room and page, predicted system Does what outOfWorld says to each living player’s character that fell below the scene’s killBelowHeight at the last step and still stands below it: downs the character, stands it at its respawn’s place, or leaves it. On the player’s page it stands the player’s own character at its respawn’s point on the room’s tick.
physics characters.aim characters() room and page, predicted system Writes each character’s strafe and the pitch its input aims at into its pose, which other pages draw.
physics characters.npcMovement characters() room Steers each character no player controls along its path, and moves it with moveCharacter, or along the navmesh for a chaser that does not walk, bases before riders.
physics characters.movement characters() room and page, predicted system Steers each player’s character on its input, or along its path while that input is not steering, and moves it with moveCharacter, bases before riders.
physics characters.countDown characters() room and page, predicted system Counts down each character’s timed speed modifiers, and ends each: on the player’s page too, which predicts them.
physics matches.reportTeamChanges matches() room Emits TeamChangedEvent on each player whose team the team question answers differently from its last report.
physics core.physics the core room and page Steps the physics scene once: builds and drops bodies, places each stand-in at its streamed pose, hands each body moveAndSlide moved its move as a kinematic target, steps Rapier, reads each dynamic body back, and destroys what fell out of the world.
physics core.follow the core room and page, predicted system Stands each attached entity at its parent’s pose and its offset, parents before children.
physics core.restColliders the core room and page Marks each kinematic collider that has stood still half a second, so the navmesh bakes it in, and unmarks it as it moves.
physics core.rebakeNavMesh the core room and page Rebakes the navmesh tiles each changed collider meets, two a tick, and swaps them in: a placed block reaches the navmesh without a whole bake.

“Runs on” is where a system runs in a game with a room, as its entry’s runsOn says; a predicted system also runs on the player’s page’s replay of the player’s steps. A game with no room runs every system.