Skip to content

Play here and test ​

Play the map inside the editor, use cheats, save test points, edit the map while it runs, watch replays, and run your project's scripts.

Play the map here ​

  1. Press ▶ in the top bar (or Ctrl+P).
  2. Pick who you play as, and fog on or off, in the Play menu.
  3. While it plays: Ctrl+Shift+P pauses, Ctrl+Alt+P steps one tick, Ctrl+P (■) stops and returns to the map as it was.

If the map is a project file with unsaved changes, Play writes the file first. The game plays with its own play scene, from where the view is. A map with an error in Problems does not start.

While it plays, the Hierarchy lists everything in the running world, the Inspector shows what you select live (change a number in place), and the Console shows what the game says.

Play (Ctrl+Enter) instead saves the map and opens the game's play scene with its menus.

Use cheats ​

  1. Play the map here: the Cheats panel (the wand on the right rail) appears.
  2. Click a cheat, or press its key (Alt+Shift and a letter, over the game).
CheatKeyIn code (editor.played.debugTools)
No fog for your teamAlt+Shift+Rreveal(on), revealed
Invulnerable: what you own takes no harmAlt+Shift+Icheat('invulnerable', on)
No cooldowns, no mana costsAlt+Shift+C, Mcheat('noCooldowns' | 'noManaCosts', on)
Resources, experience (as much as the panel says)Alt+Shift+G, HgiveResources(amount), giveExperience(amount)
An hour laterAlt+Shift+TsetHour(hour)
Speed: paused to 8×Alt+Shift+= and -played.speed
Spawn a unit type, for whom, how manyAlt+Shift+SsetSpawnTool({ player, unitType, count })
An item for the selected unitAlt+Shift+BgiveItem(item, entities?)
Selected heroes to a level, or a level upAlt+Shift+J, UsetLevel(level, entities?), levelUp(entities?)
Win, loseAlt+Shift+W, Xwin(), lose()

In a game with grass (foliagePack), Grass has four brushes: Ignite, Extinguish, Cut and Regrow. Pick one and its reach, then click or drag over the game's map; Esc lets it go. Wind sets how strong the wind blows and where towards, for everyone. Each is a debug command (debug.foliage, debug.wind), so replays hold it. See Grass and bushes in the editor.

Spawn arms the game's spawn tool: the next click on the game's map puts the unit down (Shift keeps placing, Esc stops). The game must allow its debug tools (debug: true).

Save a test point and play from it ​

  1. While the map plays, reach the moment you want (before the boss, the third wave).
  2. Press Ctrl+Shift+S, or Save here in the Cheats panel's Test points, or Play › Save a test point.
  3. Later, pick Play from in the Play menu (or the button beside the point) to start from there.

A test point is saved in the map's own files as tests/<name>.save.json, named by the time (2m05s) or what you type. It holds the whole ground, so it still plays after you edit the map's ground; things placed since are not in it.

Fast-forward to a moment ​

  1. Open Play › Play to….
  2. Pick a time (seconds), an objective given, done or failed, or a wave sent by a computer player.
  3. The game runs as fast as the page can, then pauses there. Stop leaves it paused where it got to.

It gives up if the game ends first, or after an hour of game time.

Edit the map while it plays ​

  1. While playing, change the map: place, move or delete units, paint, raise the ground.
  2. Each change goes into the running game at once.
  3. Press Ctrl+Shift+E to see the map in the game's place (the game keeps running), and again to go back.

A style of grass changed in the Terrain panel (its name, colour, Gameplay) goes into the game at once, whether edits are pushed or not: grass that stops hiding shows who stands in it.

Things dropped from Place or Content onto the game itself go onto the map and into the game. Regions, points, paths, cameras, scenery, camps, players and map settings are read only when the world is made: play again for those. Push map edits into the game in the Play menu turns this off.

Watch a replay ​

Every game played here for more than ten seconds is recorded into the map's files as replays/<date>.json (kept out of git).

  1. Open Play › Replays.
  2. Pick one: it plays in the game's place with the replay bar (hold, step, faster, slower, jump).
  3. Press Ctrl+P to go back to the map.

Edits and cheats made while it played are in the replay, so it plays back the same.

Run the project's scripts ​

  1. List the scripts the editor may run in your vite.config: editorFiles({ run: ['dev', 'server', 'app:editor'] }).
  2. Open the Run panel (left rail).
  3. Press start or stop beside a script. Its last lines show there, and all of them in the Console.

Stopping a script stops everything it started. All of them stop with the dev server. A desktop project has app:editor, which opens the desktop shell on the dev server the editor runs on.

Open the game in a tab ​

  1. In the Run panel, press Open the game and pick a scene and a map.
  2. The panel lists the open tab with its scene and frames a second (quiet after five seconds of silence).
  3. Close it with its ✕.

Make a play scene for editor maps ​

The scene the editor's Play button opens is your game's mapPlayScene:

ts
export const towerDefenseOnMap = mapPlayScene({
	id: 'td-map',
	name: 'Tower defense, on a map of the editor',
	rules: towerDefense,
	view: towerDefenseView,
	editor: 'td-editor',
	player: () => DEFENDER,
	onStart: (world) => startTowerDefense(world)
})

With saves, the HUD saves and loads: a load opens the scene again from the save, runs the game's afterLoad (not start), and seats the computer players again.

In code ​

ts
editor.plays.playOrStop()
editor.plays.pausePlay(true)
editor.plays.stepPlay(1)
editor.playState // 'stopped' | 'starting' | 'running' | 'paused'
editor.played // the game's client while it plays

await editor.plays.saveTestPoint('boss')
await editor.plays.playFrom('boss')
editor.plays.playTo({ objective: 'td.hold', status: 'done' })

editor.plays.showMap(true)
editor.plays.watchReplay('2026-10-29-0715')

await editor.run.start('server')
editor.run.openGame({ scene: 'td-map', map: 'road' })

Reference ​

Play here ​

APIWhat it does
editor.plays.playOrStop(), pausePlay(paused?), stepPlay(ticks?)Play, pause, step (a game played in the page, LocalSession)
saveTestPoint(name?), testPoints(), testPoint(name), playFrom(name), removeTestPoint(name)Test points
playTo(until), stopPlayingTo(), playingToPlayTo: { time }, { objective, status?, player? }, { wave, player? }
pushEdits(), pushingEdits, showMap(on?), mapShown, followEdits()Edits while it plays
replays(), replay(name), watchReplay(name), watching, keepReplay(replay), removeReplay(name)Replays
editor.testComputer(player)Play with the Inspector on a computer seat
  • Test points are the engine's save (saveWorld), loaded with loadWorld. One made with other rules is the game's to refuse (Rules.saves.onMismatch).
  • Play to runs LocalSession.runUntil(until, { most, deadline }), 40 ms of each frame.
  • Edits go in as debug commands (debug.mapObject, debug.place, debug.unplace, debug.ground), so replays hold them. A layer's styles go in whole as debug.cellStyles (plays.pushStyles()); the grass brushes and the wind as debug.foliage and debug.wind (editor.grassBrush.arm({ act, layer, radius }), setPlayedWind(editor, { strength, around })). mapPushCommands(before, after, registry) makes them. The engine reshapes the ground with world.reshapeGround(patch) and Navigation.reshape(); world.fromMap maps each map object to its entity.
  • Decals changed while playing go to the screen only (client.setEnvironment({ decals })).
  • Paths: testPointPath, isTestPointPath, testPointsIn(pack), replayPath, isReplayPath, replaysIn(pack), replayName(date).
  • A page's own shell plays with shell.playHere(from) and shell.watchReplay(replay, name) (the client's watchReplay(replay, { game, canvas, overlay })).

Run panel ​

APIDev server
editor.run.load(), scripts(), start(script), stop(script)GET, POST, DELETE __editor/run
editor.run.openGame({ scene, map }), games(), closeGame(id)/?run=<id>&scene=<id>&map=<name>

The __editor/run routes answer only a connection from this machine with a localhost Host and a same-origin Origin, so a web page cannot start a script. POST takes { "script": "<name>" } from the project's list and nothing else. A page with its own shell reports itself to the panel with watchRun(id, scene). None of this is in a built page.