# The editor

Coldwave, the editor, is a desktop app for making your game: the running game in the
middle, with its things, its code, its assets and its timeline around it, and AI agents
working in the same game beside you. Everything the editor shows comes through
[the protocol](../concepts/protocol.md), so `frost` and an agent can ask for all of it
too.

> **Note.** Coldwave is in private development, and there is no download of the editor
> yet. Everything on this page can also be done with `frost`. See
> [what works today](../status.md).

## Opening a game

The editor opens on the game you left, at the moment you left it: press **Continue**.
Under it are your games as cards; their recorded runs play under the pointer. At the
right are the templates to start from (what `frost new --list` names): pick one, give it a
name, and the editor makes it as `frost new` does.

## Two views: Game and Code

The title bar switches between **Game** and **Code**, with the game's search in the
middle (files and actions) and **Undo** and **Redo** on the right.

| Part | Shows |
| --- | --- |
| The game | The running game, played and picked in place. A press on a thing picks it |
| Scene | The scene's things as a tree, by name and by parent |
| Inspector | The picked thing's components and fields, as the engine declares them. With nothing picked, the game itself: its `[tuning]` numbers as they run, its window, input, physics, clips and interface |
| Files and Assets | The game's files, each drawn as what it is: a sheet as its frames, a sound as its wave, a font in its own letters. Drag a picture into the game to make a thing of it |
| The timeline | The recorded run under the game: drag to scrub back and forth, with lanes for events and for what each step cost |
| Profiler | Where the time of the step on the timeline went |

## Who wrote this value

Ask **Why?** of a field in the Inspector. A card tells you who wrote it (the scene or
script line, which opens in Code), what it was before, and its value over the whole run
on the timeline. Ask it of the picture, and it tells you what is drawn at that point and
how it is lit. On the command line the same answers come from `frost blame`
([debugging](../guides/debugging.md)).

## The profiler

A bar of the timeline's cost lane is one step; a press opens the **Profiler** at that
step. On the left, the step as an icicle on a time axis: the whole step, its stages in
the order they run (input, interface, physics, scripts, animation, layout, events), and
under the scripts each script, down to each function and the engine calls it made at
their lines; a press on one opens that line. One sentence says what took the most. On
the right, the run's worst steps (a press moves the timeline there) and each script's
share of the run. When a game cannot keep up with sixty steps a second, **Why?** in the
dock says how many it makes and where a median step goes. Every number is the engine's
own, and `frost bench` prints the same: see [profiling](../guides/profiling.md).

## Debugging

The **Debug** layout shows a stop: the game above, and under the timeline where it
stopped and in what, the moves (**Next line**, **Into**, **Out**, **Go on**), the
script's lines around the stop and the call path. A script stops at a breakpoint, when
paused, or where it raises an error. Because your game replays, you can reach a stop
again by scrubbing back. [Debugging](../guides/debugging.md) has the rest.

## AI agents in your game

An agent never edits your game directly: it works in its own copy. The **Copies** group
lists each copy: whose it is, what it is about, what it changed, what it said it would
change, its last test, and the buttons **Test**, **Land**, **Rebase** and **Drop**.

- **Land** merges a copy into your game, thing by thing and field by field. The
  **Landing** tab is the log, and you can [undo one landing](../guides/undo-landing.md) on its own.
- A change on trial shows over the picture, with the game as it was on the other side of
  a divider you drag, and **Keep** or **Not this one** under it.
- The timeline has a lane for everyone working in the game, with a mark at each change.
- You choose what each agent may do: an agent in plan mode can read and changes nothing.

## Exporting

**Where the game goes**, on the right of the title bar, exports your game. For the web,
the exported page plays in the editor itself.
