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

Playing a held session

A session that spawnite play start holds, a game’s page, a room’s page or a replay played back, takes a player’s input from a command: any key, each mouse button, the mouse’s motion and its wheel, a pad, and a finger on a phone-sized page. The pad is the tool’s: it stands one up in the page for a game that reads a pad itself, since the engine reads none. Three reads answer what a player would check by eye: what the camera sees of an entity, where a shot lands against the crosshair, and how a value moves frame by frame. When no command answers a question, spawnite play eval runs a few lines of your own against the page with the engine’s world, scene, input and time in reach.

spawnite play list, or the MCP’s list_playtests, names each playtest that runs for the games under the folder, with its address and what started it. The starter is spawnite play start, which spawnite play stop ends, or an MCP server’s start_playtest, which its stop_playtest ends. Read it before a start, to reuse a session that runs or stop one left behind. spawnite play start refuses while a session of the game that it began runs, and names that session; spawnite play start --replace stops it and starts a new one.

This page covers the input, the reads and the scripts. Directing a moment covers opening, holding, stepping and shooting a session. The MCP’s director tool runs see, aim and eval on the same session, as action, with the same reply; the input commands are the command line’s alone.

Every input command names the control a player touches. The names are the following:

Control Names
A key Its KeyboardEvent.code, such as KeyW, Digit1 or ShiftLeft, or Playwright’s name for it, such as Space, Shift or r
A mouse button MouseLeft, MouseRight, MouseMiddle
The mouse’s motion and its wheel Mouse, Wheel
A standard pad’s buttons, in its own order PadA, PadB, PadX, PadY, PadLB, PadRB, PadLT, PadRT, PadBack, PadStart, PadLS, PadRS, PadUp, PadDown, PadLeft, PadRight, PadHome
A pad’s sticks PadLeftStick, PadRightStick
A finger Touch1 to Touch10

Controls joined by + are a chord, such as Shift+KeyW: pressed in order and let go in reverse.

A control stays held between commands until you let it go, and the session’s time moves only when it steps or runs, as Unity’s InputTestFixture and Godot’s GUT hold input until the next update. So a key held across a step walks the player’s character for that step:

Terminal window
spawnite play hold KeyW
spawnite play step --seconds 1
spawnite play release KeyW

The four commands are the following:

  • spawnite play press <controls...> presses each control and lets it go, in order. spawnite play press Digit1 takes a card where a game binds 1 to one. Without --hold, the control goes down and up at once, which a game that listens for the press takes and one that reads the control held each frame, such as a trigger, misses. --hold 0.3 keeps it down 0.3 s of the game’s time, which a held session steps and a running one runs.
  • spawnite play hold <controls...> holds each control down until release lets it go.
  • spawnite play release [controls...] lets each control go, or with none everything held, the last held first.
  • spawnite play move <control> moves what moves. Mouse --by 400,0 moves the mouse 400 pixels to the right, which turns the camera while the cursor is captured, and --to x,y takes a free cursor to a point on the page. Wheel --by 100 turns the wheel a notch down. PadLeftStick --to 0,-1 stands a stick, each axis from -1 to 1, where it stays until it moves again. PadRT --to 0.5 pulls a trigger halfway. A finger held with hold slides with --to or --by.

Each command prints what is held after it, and spawnite play state prints the same under the engine’s state. --at x,y on press and hold presses a mouse button at a point of the page, in its pixels from the top-left corner, and says where a finger lands. --on <subject> on press presses on an entity instead: where it shows nearest the middle of what shows, the point spawnite play see reads, as Playwright’s locator.click() clicks an element’s middle. The subject picks one entity, and one that picks several fails naming them, as Playwright’s strict locator does; so does one that shows nothing, naming why. --page 2 sends the input to the second player’s page.

spawnite play click "<name>" clicks a control by its accessible name, such as a menu’s Play button, and the MCP’s send_input does the same; the command line page says how a name is matched. A name that matches nothing fails naming the visible controls. A name reaches the game’s own controls only. The devtools’ controls, such as the Spawnite toggle at the top left, are neither clicked by name nor named in that list, so a test of the game never opens the editor by accident and what it reads is about the game. --devtools reaches them by name instead, and names only theirs, for a check of an editor change. A point reaches them too, --at x,y here or a point for send_input, and so does their shortcut, such as ⌘E for edit mode. Playwright’s and Testing Library’s role queries see the whole page and leave the app to scope them to a region; Unity’s and Unreal’s UI automation address the game’s own interface apart from the editor’s, and this click does the same.

On the MMORPG, a click on Mira walks the player’s character to her and opens the talk:

$ spawnite play press MouseLeft --on '[npc.name=Mira]'
Pressed MouseLeft.
Nothing is held. The cursor is free at (412, 301).

On Holdfast, a burst from the character’s gun and a turn of the camera:

$ spawnite play press MouseLeft --hold 0.3
Pressed MouseLeft, each held 0.3 s of the game's time.
Nothing is held. The cursor is captured: the mouse turns the camera, and a button presses at the crosshair.
$ spawnite play move Mouse --by 400,0
Nothing is held. The cursor is captured: the mouse turns the camera, and a button presses at the crosshair.
$ spawnite play state
Camera: position 4.68, 2.17, 2.32; yaw 160.0°, pitch -10.0°, fov 70°; turned 160° since the loop mounted; lock on, third person.

A key reaches only what the game binds to it. A button, an axis or a page action with no key has none to press. Name it instead: press, hold and release take a name the game declares, plugin.key, in place of a control, and the page presses it as its key would. The key alone, such as block for guard.block, does too where one plugin declares that key; where two do, the page names both and asks for the plugin. Each kind of declaration takes the following:

  • A held button: play press taps it for the next step, --hold 0.5 holds it half a second of the game’s time, and play hold holds it until play release.
  • An axis: play hold <name> --value -0.5 holds it at a value inside its range, and play release lets it back to its rest.
  • A page action: play hold runs its listeners’ press and play release their release, as holding its key does.

One command takes controls or declared names, never both. A command is sent, not pressed, as the next section says: pressing a command’s name fails and names the play command line to run. Where a command and a page action share a name, as Holdfast’s siege.ready does, press and hold reach the action. play release with no argument also lets go of every declared input a hold holds. A name the world does not declare fails, naming every input, command and page action it does declare. Unreal’s Enhanced Input injects an input for an action by its name the same way, rather than by its key.

A command is the game’s own request with one result, such as a purchase or an ability’s cast, and many have no key. spawnite play commands lists each one the game declares, and spawnite play command <name> '<json>' sends one through sendCommand, the send a player’s client uses. A page in a room sends it to the room, which runs a predicted one on the tick the player’s page runs it. The command then waits for the answer: a held session steps until it arrives and stays held on that step, and a running one is waited on. Unreal’s Remote Control calls a function by its name and describes its arguments in the same way.

The name is the command’s plugin.key, as the list, the dump and the timeline print it, and no other spelling. The payload is one JSON object in the shape the wire carries:

  • An entity is its dump key, as spawnite play dump lists it, or null where the list says the field takes it. The field itself is always sent.
  • A vector3 is [x, y, z], and a list is an array.
  • A field the command does not declare fails before anything is sent, naming the fields it takes.

A command that acts through an entity goes through the one the player’s keys steer, or the one --entity <subject> names. On the MMORPG, played alone, the mage casts Frost Nova, which costs 25 mana, and a second cast is refused while the first is casting:

$ spawnite play commands
abilities.cast { ability: one of "arcane-bolt" | "crystal-lance" | "frost-nova", target: an entity's dump key or null }; refuses not-held, downed, casting, cooling-down, no-resource, no-target, not-hostile, out-of-range, no-line-of-sight; through an entity, the player's or --entity; predicted; answered by abilities.cast
$ spawnite play command abilities.cast '{"ability":"frost-nova","target":null}'
abilities.cast was accepted by the system abilities.cast, after 1 step.
$ spawnite play eval "JSON.stringify(player().mana)"
{"current":75,"maximum":100,"reserved":25,"spentTick":null}
$ spawnite play command abilities.cast '{"ability":"frost-nova","target":null}'
abilities.cast was refused by the system abilities.cast, after 1 step: casting.

The list above shows one of the game’s commands; it prints a line for each. The exit code says how the command ended:

  • 0: the command was accepted. The line carries what it returned, where it returns a value.
  • 1: it was refused, with the reason, its detail and who refused it: the player’s page before it left, the room, or the system by name. A refusal the game declares, such as too-poor, is the game’s own answer, so a script reads it and moves on.
  • 1, still pending: no answer came within --budget seconds of the game’s time, 10 by default. A pausing modal does not hold a command back: the world steps under it until the command reaches its system. The command may still run, so read the state it changes before you send it again.
  • 2: the command line itself was wrong.

--json carries the result as status, value, reason, detail, settler, system and steps. A replay’s page and a room’s past send no command, since no room answers one there. The MCP’s director tool takes the same pair as its commands and command actions.

Each control reaches the page as the browser hands a player’s input over:

  • Keys, and the mouse over a free cursor, go through Chromium’s own input, as Playwright’s keyboard and mouse send it. The events are trusted, so a focused button presses on Enter, a text box types, and a click lands on whatever stands under the cursor.
  • The mouse while the cursor is captured reaches the canvas as a pointer lock delivers it: every event to the canvas, at its middle where the crosshair is, with the mouse’s motion in movementX and movementY. An automated browser gets no pointer lock, since one would hold the cursor of whoever runs the session, so the engine grants the capture itself. The engine’s state reads it in cursor.captured, and the input layer delivers the mouse as the lock would. A game reads the capture with isCursorCaptured(canvas), not document.pointerLockElement, which stays empty. Replay playback delivers a recorded move the same way.
  • A finger goes through Chromium’s touch input, every finger on the screen in each event, as a touch screen reports them. A finger stays on the screen: one moved past the page’s edge stands at the edge.
  • A pad is a standard pad the page’s navigator.getGamepads() returns, connected on its first use with a gamepadconnected event. No browser takes a pad’s input from a tool yet, so the pad lives in the page, as Unity’s InputSystem.AddDevice<Gamepad>() adds a virtual one. The engine itself reads no pad; a game that reads one does.

--press on spawnite play step lands inputs on moments of the step, in seconds of its game time: control@seconds presses a control there, and control@from-to holds it between the two. A press on the step’s last moment or past its end fails the step, naming it, since no step is left to take it; a hold may end with the step. The session holds between the moments, so each lands on its step exactly. --keys holds controls down for the whole step. On Holdfast, walk forward for a second, jump at 0.3 s and fire from 0.5 s to 0.9 s:

Terminal window
spawnite play step --seconds 1 --press "KeyW@0-1,Space@0.3,MouseLeft@0.5-0.9"

A replay played on takes the input too, on top of the input it recorded, which it plays as it goes. What the page would send a room goes nowhere, so the input changes only what the page computes: its camera, its HUD and its own prediction.

spawnite play start --device <name> opens the session’s pages as a device Playwright names, such as "Pixel 7" or "iPhone 15". The page takes its screen’s size and pixel ratio, a touch screen, and a phone’s coarse pointer, so the game lays itself out and picks its controls as it does on a phone. On Holdfast as a Pixel 7, the page is 412 by 839 at a pixel ratio of 2.625, (pointer: coarse) matches, and the shooter camera holds its touch lock. A finger dragged on the canvas turns the camera:

Terminal window
spawnite play start --device "Pixel 7"
spawnite play hold Touch1 --at 150,250
spawnite play move Touch1 --by 120,0
spawnite play release Touch1

spawnite play see [subject], or the MCP’s director with action see and subject, prints what the player’s camera sees of each entity a subject picks, or of every entity it draws, most showing first. For each it prints the share of it that shows with the rest of the scene in front, its pixels, the box they fill on the page, and its share of the screen. --part <name> narrows each entity to the objects inside its drawn object whose name holds the text, such as the gun in a character’s hand. A part that matches nothing fails with the names the entity’s meshes carry.

On Holdfast, the character’s gun from the player’s camera over the character’s shoulder:

$ spawnite play see 18 --part blaster
What the player's camera sees of 18:
18 (blaster-d): 97% of it shows, 3,849 of the 3,963 pixels it covers in view, in a 45 by 171 box at (313, 308); 0.7% of the screen.

The camera draws each entity once in a flat colour of its own, with the scene in front, and once alone, at most 960 pixels wide, as three.js’s GPU picking draws. What a player sees through, glass, a flame or a glow, hides nothing behind it. A vertex shader’s own motion, such as grass that sways, is left out, since the flat colour draws the mesh as it stands. Roblox’s WorldToViewportPoint says whether a point is on screen and GetPartsObscuringTarget what stands in front of one.

spawnite play hide <subject> takes a part of the scene off the session’s page until spawnite play show draws it again, so a screenshot settles which object draws a region. The subject is an entity, a row of instances by its id, or a model by its file, which hides every batch that draws it at any level of detail. --part <name> hides the objects whose name holds the text, and --background draws flat magenta in place of the sky. The MCP’s director takes hide and show the same way.

On Last Light’s forest edge:

$ spawnite play hide --background
Hid the background: scene.background, sky. It draws flat magenta, #ff00ff; the scene's lights and fog stay, and an effect that reads the drawn frame, such as bloom, takes the magenta in its place, so colours elsewhere shift.
$ spawnite play hide spruce-a-far.glb
Hid spruce-a-far.glb: assets/forest/spruce-a.glb:_r_4o_ level 1, assets/forest/spruce-a-far.glb:_r_4t_ level 0. Physics and the world's step run on; the live shadows go with it, and a baked far shadow keeps a hidden instance's until that map draws again.

spawnite play dump lists each hide under hidden, with what it matches now, and a screenshot’s reply ends with a line naming what is hidden. A load of the page shows everything again.

spawnite play instances <model> prints how tall a model’s instances stand on the page by distance from the camera, the numbers a level of detail’s distance is chosen from. Each band lists the level that draws its instances and their height, as a share of the page’s height and in pixels:

$ spawnite play instances spruce-a-far.glb
assets/forest/spruce-a-far.glb:_r_4t_, 887 instances; its levels: assets/forest/spruce-a-far.glb.
Distance Instances In view Levels in view Height in view: least, median, most
40-80 m 30 8 0 ×8 88%, 112%, 155% (473.9, 602.7, 834.6 px)
80-160 m 268 153 0 ×153 12%, 22%, 101% (62.4, 120.7, 544.1 px)
160-320 m 589 217 0 ×217 6.3%, 9.8%, 18% (33.9, 53.2, 99.6 px)

spawnite play paints lists the GroundPaints over a cell or a rectangle of the page’s ground, which Read what is painted says a game reads too.

spawnite play screenshot --reference <image> --region lake=0.66,0.32,0.24,0.12 shoots the game’s camera at the image’s size and writes a sheet: the frame beside the image, and each region cut from both at 100%. Unity’s Scene view hides an object with its visibility toggle and Godot’s hide() takes a node off the screen; Unity’s LOD Group reads the screen height these heights follow.

spawnite play aim, or the MCP’s director with action aim, prints where the crosshair points and each shot the page sent, the newest twenty, beside where the crosshair pointed as the shot left. A shot sent to a room and a shot a game played alone fires as a command both count. The engine’s Weapon records each shot with recordSentShot and each refusal with recordRefusedShot; a game’s own weapon component calls the same two to appear here.

The crosshair’s point is the first thing the camera’s ray through the canvas’s middle meets by the engine’s own reads: the targets as the page draws them and the cover a shot meets, so grass and a model’s render mesh, which no shot meets, are not it. For each shot, the command prints how far its line passed that point, in metres and degrees. A shot that lands on what the crosshair shows passes a few centimetres from it at most. Where the room refused a shot, the line says under which rule and why, since a shot on the crosshair’s point that the room refused dealt nothing.

It also prints what the aim assist and auto-fire decided on the page’s last frame: whether the touch lock holds and the last input that turned the camera. It names the assist’s target by its dump key with its angle, strength and friction, and each weapon’s auto-fire clock. The assist and auto-fire stand still while the devtools hold the world, so read them while it runs, such as with spawnite play step --sample "aim()". The devtools ring the assist’s target in its margins beside the hit zones window.__GAME_HIT_ZONES__(true) draws.

On Holdfast, after a burst at the ground:

$ spawnite play aim
The cursor is captured, so the crosshair is the canvas's middle: from (8.15, 2.14, 11.71) it meets cover at (8.15, 0.35, 1.52), 10.35 m from the eye.
The last input that turned the camera was keyboard-and-mouse; the aim assist helps toward nothing.
The shots the page sent, oldest first, beside where the crosshair pointed as each left:
Shot 0 of blaster, at step 423, from (7.57, 1.08, 10.19): it passed 0.000 m from the crosshair's point, 0.00° off; the crosshair met cover at (8.15, 0.35, 1.52), 10.35 m from the eye.

The page keeps each shot as it sends it, in a development build alone.

--sample <expression> on spawnite play step reads the expression on each frame the page draws while the step runs, as eval reads one, and prints each frame’s value beside the world’s step and the canvas’s clock. A room session runs with its page at real time for it, so each frame is one a player would see; a frame that repeats the one before it, its step, its clock and its value, is left out. --json carries every frame as samples. A recoil’s curve is --sample camera.pitch over the burst, and a hit’s knockback is the monster’s transform.position over the half second after it.

On Holdfast, the player’s character walking and jumping:

$ spawnite play step --seconds 0.5 --sample "player()?.transform.position"
Stepped 30 steps.
Sampled player()?.transform.position on 143 frames, the world's step and the canvas's clock beside each:
frame step clock value
3889 69 1.987 s [7.3708,1.2729,9.3992]
3913 74 2.083 s [7.4541,1.0237,9.5435]
3929 82 2.218 s [7.4541,0.4835,9.5435]
3945 90 2.346 s [7.4541,0.385,9.5435]

spawnite play timeline <control> presses the control, then shoots the page every --every seconds of the game’s time, 0.1 by default, for --seconds, 2 by default, and tiles the frames into one PNG, each under its time. It answers the question a clip’s numbers do not: which frame an effect should land on. A person reads the sheet, picks the frame where the hands are highest or the wand points, and the label under it is the second to write as the clip’s release mark in registerClip, which is the ability’s cast time, as the abilities page says. Each frame is cropped round the player’s character, where the page shows it on the first frame, so the sheet stays small; --crop '[monster.kind=wolf]' crops round another entity, and --crop none keeps the whole page, shrunk to the cell. The session is held for the sheet, so each frame is exact to its step, and a session that ran runs on after. The gap snaps to whole steps, 60 a second, and the labels count the gap stepped.

--clip <name> plays a clip the game registered on the player’s character in place of a press, so a clip with no ability yet shows its frames too, and the output ends with the registerClip line to write the second into, as its release mark. spawnite model check on the clip’s .vrma prints its motion in numbers first, where the arms peak, which a mark starts from; the sheet settles it. The MCP’s timeline tool is the same for an agent, with keys or clip. For a person to pick the frame by eye, the model viewer scrubs a bundled clip with its marks drawn on the track: tools.spawnite.com/model?avatar=chifa&clip=charged-spell-cast&marks=release:1.4, and the time under the track is the second to write.

--command <name> sends one of the game’s commands in place of a press, as spawnite play command does, with --payload and --entity, and starts the sheet on the step the room accepts it. One call shows what a command draws, such as a tree rising where a planting command put it. A refusal ends the call before the first frame, with the reason the command printed. The MCP’s timeline tool takes the same command, payload and entity.

On the mmorpg, the player’s mage’s third spell from beside a wolf:

$ spawnite play timeline Digit3 --every 0.1 --seconds 2 --out timeline.png
Saved to /…/timeline.png: 21 frames, one every 6 steps, 0.1 s of the game's time, from the press of Digit3, cropped round [controlled].

spawnite play text-chat <text> sends a message from the page’s own seat, as a player types one. --as <player> sends it from any seat of the room instead, such as --as "Bot 1", by the name it joined under or its key. --channel <name> writes to another channel than the game’s first. The command prints the room’s answer, the message as the sender reads it or why the room refused it, and whether the page then shows it.

spawnite play start --age-groups "page=13-15,Bot 1=21-plus" gives seats an age group, page naming the session’s own page, so a check reads chat as a young teen does. Chat runs on the room’s own clock, so a held session still sends chat. spawnite play state prints the chat the page holds after the input held: its state, channels, level and last 10 messages. The MCP’s send_text_chat and read_text_chat do the same. Text chat shows a run.

A room game’s development room keeps its deliveries beside its saves, in .spawnite/saves/deliveries.json, as the platform keeps its rows. spawnite play deliver gift '{"coins":5}' --to Ada sends a deposit of the kind gift to Ada’s record, and --purchase sends a purchase of a product instead, its payload the purchase’s context. The room is handed it within a second while it holds that record, applies it through the record’s onDepositReceive hook or the product’s grant, and its next checkpoint delivers it.

A purchase of a durable product is no delivery, as on the platform: the development store records that the player owns it, beside its deliveries. The room takes what the player owns as the player joins and within a second of each change, as a hosted room takes its seat’s answers. spawnite play deliver sword --purchase --to Ada gives Ada the sword, so ownsProduct answers true, and spawnite play deliveries <key> --return takes it back, as a refund does.

spawnite play deliveries lists each delivery as it stands: waiting, handed, applied and waiting for its commit, delivered, or returned. With a delivery’s key, --delay <seconds> holds it back from the room, --drop loses its next hand on the way, and --return returns it as its clock passing would. Two development rooms on one folder pass a deposit between them. The MCP’s deliver and read_deliveries do the same.

spawnite simulate --scene <name> --seconds 1 --buy potion grants a purchase to the player once the scene mounts, with no room, and prints how its grant went above the dump; --buy plot-upgrade='{"plot":"3"}' passes a context.

The room a spawnite play session holds keeps each frame it sent each player’s page, so you can check what a page was told without a script. spawnite play frames --player Ada prints every frame the room sent Ada’s page, the welcome and each rejoin’s included, decoded as the page decodes it. A player is named by the name the player joined under, such as "Bot 1", or by key. Each frame is one JSON line:

{"frame":0,"tick":7,"welcome":true,"changed":{"28181286":{"player":{"name":"Ada","seat":0},"wallet":{"coins":0}}},"spawned":["28181286"]}
{"frame":1,"ack":{"sequence":9,"owned":{"28181286":{"viewTarget":{"entity":"159021269"}}}}}
{"frame":22,"tick":29,"changed":{"180915929":{"owner":{"entity":"28181286"}}},"spawned":["180915929"],"ack":{"sequence":30,"owned":{"180915929":{"secretsHand":{"cards":"ace"}}}}}

The lines above are shortened. A line holds the following, each left out where the frame carried none:

  • frame counts the page’s frames from the first the room sent it, and tick is the room’s tick the frame’s state stands at.
  • welcome marks the welcome, and resync a frame that sent the page the world whole after it fell behind.
  • changed holds each trait the frame wrote, by the entity’s key and the trait’s name, as a dump names both. A Reach.Audience trait is here too, in the frames of the pages it reaches. A trait that left the entity reads null.
  • spawned lists the keys the page did not hold before the frame, and removed the keys the frame took off the page.
  • rewound, controlled and results hold what came outside an acknowledgement: the player’s predicted values and controls as the welcome carried them, and the player’s commands’ results from before a rejoin or as the player left.
  • events lists each event with its id.
  • ack is the player’s acknowledgement: under owned the traits that reach the player alone, such as a Reach.Owner hand, then the player’s controls and commands’ results.

--trait secretsHand keeps only the frames that carry that trait, by the name a dump writes it under. A trait that shows in another player’s frames reached that player’s page. The room keeps the last 3,600 sends to each page, a minute of a page that hears every send. A room that spawnite play room or spawnite play bench holds keeps none. Past that, the first line says how many older frames it dropped, and no frame lists spawned, since what the page held before the oldest kept frame is unknown. Two players who joined under one name are told apart by key.

spawnite play why <entity> --player Bo says in one line whether Bo’s page holds an entity and the rule that decided it, then each trait’s reach. The entity is a dump key, or a selector one entity answers, such as '[npc.name=Mira]':

Bo's page and the entity 180915929: held: its visibility is everyone
owner: Reach.Everyone, reaches the page
secretsHand: Reach.Owner, does not reach the page

The first line reads one of the following:

  • held: its visibility is everyone, or the audience or the player its visibility names.
  • not held: its visibility is the audience 118232490, and the player is not a member.
  • held: in interest, 6 m from the player's nearest origin and not held: culled, 280 m past the 20 m radius, in a room that culls by interest. An origin is an entity the player controls or looks through.
  • not held: the room streams no trait of it, so no page holds it.
  • not held yet: the player's page may hold it, and it waits for one of the room's next sends to the page, for an entity the page’s allowance has not reached.

The MCP’s read_page_traffic reads both: with entity it answers why, and without it the frames. A development room also checks every frame against its own privacy rules before the frame leaves, as the room’s guarantees say. To keep the check in a test, use capturePageTraffic.

spawnite play record start starts a video clip of what the game’s canvas draws, spawnite play record stop saves it, and any play command between them moves the world. The clip is the one the dev tools’ Record button writes, as the devtools page describes it: an H.264 MP4 in the game’s .spawnite/clips, with its stills, contact sheet and clip.json. The clip holds the canvas alone, with no HUD and no other element of the page, unless --hud records the HUD too.

The clip runs on the world’s steps, one frame a tick, so the video shows the game’s time, with no pause while a command waits and no frame dropped: a held world waits for the encoder. Its time is not the replay’s, so it keeps no replay window. Holding the world pauses the clip, so there is no pause command: a held session records nothing between commands, and spawnite play pause stops a running one’s clip until the next step or resume.

Every frame in the clip is one the game rendered onto its canvas. A frame whose render the game skipped, as a useFrame that renders the scene itself does when it leaves out gl.render, is never encoded. A held world’s step waits until a frame renders it, and the clip fails after 10 s with none; a running world’s skipped frame is left out, and the clip’s warnings count it. A clip with the HUD shoots each frame only once the canvas has rendered two frames since its step.

A look, a set or a from-here while held shows on the next step’s frame, as a cut. A step that fails, such as a press past its end, drops the clip, and a pausing modal that ends the steps early ends the clip there, which the output says. A step that holds a press records the press. --shape 9:16 letterboxes the page to a tall clip. spawnite play record --seconds <s> records that much of the game’s time in one go, with --press as play step takes it. The stop prints the clip as spawnite clip show does.

spawnite play record --hud, with start or --seconds, records the page as the player sees it: the game’s own HUD, its glass and its animations, with the devtools hidden. Each frame is a shot of the page, so a 2-second clip takes about 40 seconds to record on Sled, and a room game’s takes longer, since its room steps beside the page: 20 seconds of Volleyball took 12 minutes (measured 2026-10-20). The session takes no other command until the clip ends, so a spawnite play state from another terminal waits for it. While it records, the page’s clocks, timers and CSS animations move one tick a frame, so the HUD moves at the game’s speed in the video. While the world waits between commands, the page’s clocks run on as they do with no clip, and the clip takes no frame. The page shows in the clip’s shape, as large as the viewport holds, and gets its size back at the stop. Only a headless session records the HUD; the creator’s own tab refuses it.

The MCP’s record_clip does the same for an agent, with hud: true for the HUD: action start and stop around other playtest calls, or seconds with keys held, and the reply carries the contact sheet.

$ spawnite play record start --shape 9:16
Recording 9:16 on the world's steps: each tick is one frame. spawnite play record stop saves it.
$ spawnite play step --seconds 3 --press Space@0.2
Stepped 180 steps.
$ spawnite play record stop
Clip 20261003-041307: 3.0 s, 1080x1920 at 60 fps, 3.7 MB.
Sheet: …/games/sled/.spawnite/clips/20261003-041307/sheet.webp

Godot’s Movie Maker and Unity’s Recorder in its Constant mode record the same way, on the game’s own fixed step rather than the wall’s clock.

When no command answers a question, spawnite play eval, or the MCP’s director with action eval and expression or file, runs your own lines on the page. An expression reads the engine’s scope, the names below, before the page’s own globals, as a browser’s console does. A function is called with the scope and a promise is awaited, for 30 s at most unless --timeout says otherwise.

Name What it is
entities, count, has, player The world as spawnite play dump files it, as a step’s --until reads it.
camera, loop, cursor The engine’s state, as spawnite play state prints it.
views What each view exposes through useInspect.
steps, at The steps a step’s condition has taken, and the moment a replay stands on in seconds.
world, find(subject) The Koota world the page runs, and the entities a subject picks, as dump --where reads one.
three React Three Fiber’s state: the scene, the camera, the renderer and the canvas’s size.
engine(), load(path) The engine’s module, and a promise of one of the game’s modules by its path from the game’s folder, as the game runs them: find('[npc]')[0].get(engine().Transform).
args The JSON value --args passed the read, or the director’s args; undefined with none.
see(subject, { part }), aim() What spawnite play see and aim read.
input press, hold, release and move, as the commands above take them.
time step({ steps, seconds, until }), frames(count) to wait for drawn frames, and sample(read, { steps, seconds }).

input and time reach the director through the page, so they work on a session spawnite play start opened. A step from a script runs from the session’s own page, not from --page 2.

On a page playing without a room, the eval scope’s writable world can provide an authority. Use it to try a camera setting without an edit or restart:

Terminal window
spawnite play eval "() => { const { CameraTrait, readCameraOrbit, requireAuthority, setTrait } = engine(); const rig = world.queryFirst(CameraTrait); if (rig) setTrait(requireAuthority(world), rig, CameraTrait, { fov: 55, shoulderOffset: 0.7, pivotRise: 0.15 }); readCameraOrbit(world)?.dollyTo(2.2, false); }"

--file <path> runs a script’s default export with the scope in place of an expression. The game’s dev server compiles the script, TypeScript or JavaScript, and resolves its imports to the modules the game runs, so a script in the game’s folder imports the game’s own traits as its code does. --args '<json>' hands the script a JSON value as args in its scope, as spawnite play eval --file checks/place.ts --args '[3,4]' does, so one script serves many calls. PlayScope from @spawnite/engine/devtools types the scope. The following script turns to the nearest entity with a monster trait, as Holdfast’s monsters hold, fires a half-second burst and reads where the monster stands on each frame. The dump files a transform as { position, rotation, scale }, so the script reads transform.position, and engine<typeof import("@spawnite/engine")>() types the engine’s module for CameraTrait:

packages/engine/test/outside/shootNearestMonster.ts
import type { PlayScope } from "@spawnite/engine/devtools";
/** A transform as the dump files it. */
interface DumpedTransform {
position: number[];
}
/** Turns to the nearest monster, fires a half-second burst, and reads
* where the monster stands on each frame. */
export default async function shootNearestMonster({
entities,
camera,
input,
time,
world,
engine,
}: PlayScope) {
const [x, , z] = camera?.position ?? [0, 0, 0];
const [key, monster] = Object.entries(entities)
.filter(([, traits]) => traits.monster !== undefined)
.map(([key, traits]) => {
const [mx, , mz] = (traits.transform as DumpedTransform).position;
return [key, { mx, mz, far: Math.hypot(mx - x, mz - z) }] as const;
})
.sort(([, a], [, b]) => a.far - b.far)[0];
// Yaw 0 looks down -Z and 90 down -X, as the engine's state reads it.
const yaw =
(Math.atan2(-(monster.mx - x), -(monster.mz - z)) * 180) / Math.PI;
const turn = ((yaw - (camera?.yaw ?? 0) + 540) % 360) - 180;
// The lock turns the camera lookSpeed radians a pixel, the other way.
const { CameraTrait } = engine<typeof import("@spawnite/engine")>();
const rig = world.queryFirst(CameraTrait)?.get(CameraTrait);
const pixels = -((turn * Math.PI) / 180) / (rig?.lookSpeed ?? 1);
await input.move("Mouse", { by: [pixels, 0] });
await input.hold("MouseLeft");
try {
const frames = await time.sample(
({ entities }) =>
(entities[key]?.transform as DumpedTransform | undefined)
?.position,
{ seconds: 0.5 },
);
return { key, frames };
} finally {
// Let go even where the step failed, so nothing stays held.
await input.release("MouseLeft");
}
}

Saved in the game’s folder as checks/shootNearestMonster.ts, it runs with the following command:

Terminal window
spawnite play eval --file checks/shootNearestMonster.ts
  • Playwright gives a page a keyboard and a mouse with down, up, press, move and wheel, device descriptors such as devices["Pixel 7"], and a tap on a touch screen. It has no relative mouse motion under a lock, no pad, and no multi-finger touch; Chromium’s DevTools protocol has the touch.
  • Unity’s InputTestFixture presses, releases, moves and sets any control by its path, such as <Gamepad>/leftStick, begins, moves and ends a touch by its number, and adds virtual devices. Input waits for the next InputSystem.Update().
  • Unreal drives its UI with the Automation Driver’s sequences of presses, clicks and waits, injects gameplay input into Enhanced Input for one frame or every frame, and runs whole sessions with bots under Gauntlet. Its CSV profiler records a stat each frame.
  • Roblox’s VirtualInput sends keys, the mouse, a pointer and text in a test, and Studio simulates a phone’s profile, orientation and resolution. RunService.Heartbeat reads a value each frame.

The director takes Unity’s model: named controls held between commands, virtual devices where the browser has none, and time that moves only when the session steps. It takes Playwright’s names for keys and devices, which an agent already knows, and Unreal’s per-frame sampling. It differs from all four in two ways. The input reaches the page as the browser would hand a player’s input over, with the engine’s own capture standing in for a lock. And a check that needs more than a command is a few lines against the engine’s own scope, run from the command line, with no test project to build.