# Changelog, part 6

Part 6 of 7: [newer](5.md) · [older](7.md).

- **`Mover.step` is new**: the highest ledge a mover walks up onto, 0 when left out, so
  a game that does not write it plays as before; the checksum of a game with a mover
  moves once, the field being new in each. The numbers on softness and swing moved
  from the scripting reference to `docs/physics.md`.
- **`Collider.surface` is new**: a belt's speed. A game that does not write it plays as
  before; the checksum of a game with colliders moves once, the field being new in each.
- **A game has the physics' components only when it has the physics, and `Font` only
  with a `[fonts]` table or a `Font` in a scene.** A game has the physics when its project file has a
  `[physics]` table or one of its scenes gives an entity a `Body`, `Collider`,
  `TileCollider`, `Mover` or `Joint`. Scripts are not read to decide it: **a game whose
  scripts make colliders in scenes that have none must add `[physics]`** (an empty
  table will do) to `game.toml`; without it the script's first use stops with the
  unknown-component error, which says so. No recorded game's checksum moves and none
  of the test games or templates needed the table. `world.components` lists fewer for a
  game without them, and a client naming one there is refused (E0415) with the same
  advice. `frost export` links the physics by the same rule.
- **A field can say that its text names an entity, and `frost check` warns when it names
  none (`W0436`).** A game marks its own in the project file as `{ entity = "" }`; the
  engine's are marked: `Node.parent`, `Node.up`, `Node.down`, `Node.left`, `Node.right`,
  `Slider.fill`, `Slider.label`, `Choice.label`, `Toggle.mark`, `Bar.fill`, `Joint.from`
  and `Joint.to`. `world.components` reports `"role": "entity"` for such a field. The
  warning is new for games that already had a focus neighbour that is not there, or, in
  a scene the game does not start in, a parent, a part or a joined body that is not
  there. It reads the scene as its files say: an entity a script spawns later is not
  seen. No value and no checksum changed.
- **`profile.steps` says what each step took**: the time of each of the last 3,600
  steps, and the slowest of a range with where their time went (each stage, each
  script, the picture drawn of the step). It is kept in `frost dev`, `frost serve` and
  `frost mcp` whether or not anybody asks, at about a tenth of a microsecond a step; an
  exported game keeps nothing. No checksum and no frame changes.
- **A hit of `frame.at`, `frame.in` and `blame.pixel` has its `box`**: `{x, y, w, h}`
  in the frame's pixels, around everything the entity draws with that component, so a
  tool can outline a sprite drawn at its picture's own size. Nothing else changed.
- **A failing shot in `frost test` says where the game changed.** When the run holds and a
  picture does not, and the folder has changes git has not committed, the line leads
  with the first step and value that differ from the committed game, as a failed
  checksum does; when the world is the same at every step it says so and names the
  files that changed.
- **`frost check` warns of a script variable a snapshot does not hold (`W0309`)**: a
  `local` declared outside a script's or a library's functions that a function writes,
  or writes a field of, with the line of the first write. Such a game goes wrong after
  `game.restore` and `game.try`, which `frost test --restore` finds by running it; move
  the variable into `state`. The game loads and runs as before. The platformer and
  the brick breaker templates kept their tilemap that way; they now read it once a
  step into `state.land` and take it out when the step ends, on the same checksums.
- **A failing `frost test` says the step, the value and the line.** When the game's folder
  is in a git repository and has changes that are not committed, the failure is:
  "FAILED: at step 131 ball.Transform.x is 131.5 and was 131.0; last written by script
  go.luau:5 in step. That is the first step that differs from the game as committed (git
  HEAD a1b2c3d)." The two checksums are not printed then.
  The committed files are played in memory beside those on disk; nothing is stored, and
  a game that passes is not played twice. Without git, or with nothing changed since the
  commit, the message is the one it was.
- **`frost test` fails a game that cannot be put back to a snapshot.** It plays one
  stretch of the recording twice (from the checkpoint nearest the middle to the next,
  put back from a snapshot in between) and both times have to come to the same worlds.
  A game that kept part of what it is in a script's own variable (a `local` outside its
  functions) passed before and fails now, with the step and what to do: move it into
  `state`. `frost test --restore` does the same at every checkpoint.
- **`frame.at` and `frame.in` say what is drawn at a pixel and inside a box of the
  frame**, the one in front first, with no blame on and no picture taken: what an
  editor asks to pick the thing under the pointer. `blame.pixel` answers the same
  hits with who made and placed each, so its hits have four fields more (`tile`,
  `node`, `coverage`, `fills`); nothing it answered is gone.
- **A node with a `Text` and no `w` or `h` has the size of its words**, where before
  it was a point. One anchored by its middle is where it was; one anchored by an edge
  (`Anchor = { y = 1, dy = -14 }`) now has that edge of its words there, not their
  middle: move `dx` and `dy` by half the text's size. In a stack it takes its room,
  and a press on it is the interface's (`Node = { pointer = false }` lets it through).
- **A `Stack` or `Grid` with no `w` or `h` is as big as what is shown in it**: before,
  it was a point and its nodes hung from that. Write the size for the old layout.
- **`Anchor.stretch_x` and `stretch_y` are read in a stack and a grid**: a node
  stretched across its stack fills it, those stretched along it share what is left,
  and one in a grid fills its cell. Before, both were ignored there.
- **A fill node with an `Anchor.dx` keeps that much clear at both ends** of its slider
  or bar: before, only at its left, and a full bar ran past the right end by `dx`.
- **A tween of the `Transform` of a node the interface places is an error** (`E1306`):
  before, it did nothing. Tween `Anchor.dx` or `dy`, `Scale` or `Opacity`.
- **The pointer uses a button, a choice or a toggle when it lets go on it**, not when
  it presses: sliding off first cancels. A recording made with the pointer sends its
  events as many steps later as the press was held, and one that pressed here and let
  go there no longer uses anything. Keys and a gamepad are as they were.
- **The focus is remembered.** A screen that is hidden and shown again has the focus
  where it was left, and when a modal node closes the focus is back on the node that
  had it; before, both went to `[ui] start`. A modal node still opens on `start`.
  For the old behaviour call `ui.focus(find("play"))` when showing the screen.
- **A direction no longer jumps to a far node.** The focus goes only to a node that
  is level with the one it is on, or no further to the side than ahead; with none it
  stays, unless it is in a stack that runs that way, which still goes round. In a
  `Grid` it keeps to the row or the column. Where a menu relied on a far jump, name
  the neighbour: `Node = { down = "back" }`.
- **A menu a script shows is laid out and has its focus in that same step**, not the
  next: the interface runs again at the end of every step. `ui.tree` never reports
  `focus: null` for a menu that is up, and every recorded game with a menu that opens
  has a new checksum. `Node` has five new fields (`locked`, `up`, `down`, `left`,
  `right`), so every game with a node has one too.
- **`frost test --restore` finds a game that cannot be put back to a snapshot.** It plays
  the recording and, at each checkpoint, takes a snapshot, plays on, puts it back and
  plays the same steps again; a game that goes another way the second time keeps
  something in a script's own variable (a `local` outside its functions), which a
  snapshot does not hold, and the line says to move it into `state`. Nothing changes
  for a game that never asks for `game.restore` or `game.try`.
- **`frost test --write` writes which engine wrote a `replay`** (`engine = "0.0.1 r27"`:
  the version, and the revision, which is how many entries this file has), also into
  a replay that still holds and names an older engine or none. `frost test` says, when a
  checksum no longer holds, whether the engine is the one that wrote it, and
  `frost changes 27` prints the entries added since revision 27. `frost --version` prints
  the revision after the version (`frost 0.0.1 r27 (commit 0123456789ab, source N)`). A project file with no
  `engine` is read as before.
- **`blame.on` no longer plays the game again while snapshots are kept**, since that
  would forget them: its answer then has `whole: false` and `since` the step it was
  turned on at. `game.forget` first, for an answer that is whole.
- **`tuning` is a name scripts are given**: the numbers of the project file's new
  `[tuning]` table, read as `tuning.jump`. A script that kept a global of its own
  called `tuning` still reads its own; one that only looked whether `tuning` was there
  now finds it. `local tuning = ...` is untouched.
- **`game.step` answers `reached`, and `game.info` answers `scene`.** Two more fields
  in two protocol answers; a client that refuses fields it does not know must learn
  them. Nothing changes in a game.
- **`frost export` from a checkout keeps the players it has built**, by their parts: two
  games that use different parts of the engine, exported in turn, no longer compile it
  each time. The eight sets used last are kept for each kind of player, about 10 MB a
  set for all three, under `target/players/kept/`. Its first line says `is kept from an
  earlier build` where it said `is built already`.
- **A `frost` with a `players` folder beside it exports without building.** `frost export`
  copies the players that came with it (every part of the engine in each) and needs no
  checkout, no Rust and no Emscripten SDK; `--slim` builds a player with only what the
  game uses, as before. Players of another source than `frost` are refused (`E0517`), and
  one that lacks a part the game uses is `E0518`. A `frost` built by `cargo` has no such
  folder and exports as it did. `frost --version` also prints the commit and the source
  number.
  `frost new` reads its templates from a `templates` folder beside `frost` in the same way,
  and from the checkout when there is none.
- **`frost check` warns of a game's name written only under `[web]`, or twice
  (`W0439`).** `title` at the top of the project file names the window, the exported
  program, the browser tab and now the loader too; the `[web]` one is only needed for
  a page named otherwise. The game loads and plays as before.
- **A save keeps a table with gaps, or with numbers beside names**, as it is
  (`{ [3] = 41.5 }` is written `3 = 41.5`); such a table was refused. A list at the top
  of a slot is kept too. An error of `save.set` names the slot and
  the lines that called. `frost serve` and `frost mcp` take `--saves DIR`. A save that could
  not be read or written is a warning in `log.since`, and a browser that gives a page
  no storage has the player say that saves last for the visit only.
- **A save that cannot be written is told of once** (`E0604`), not once a write: a game
  that saves in every step no longer fills the log when a disk or a browser refuses.
  The next failure is told of after a write has worked again.
- **The Cinder template remembers its best time** in the slot `best` and shows it on
  the title and the end screen. A game started from the old template is not changed.
- **`save` is a name the engine gives scripts**: `save.get`, `save.set`, `save.delete`
  and `save.slots` keep tables between runs. A script that had a global of its own
  called `save` now writes over the engine's; give it another name. `id` at the top of
  a project file and `saves` under `[input]` are new keys, and the text `input.history`
  returns starts with a `saves` line when the session started from saves.
- **`frost serve --port N --stdio` serves standard streams and the port at once**, so a
  program that runs the engine on its streams can let a debugger join the same game;
  the address is printed on standard error. `game.info` answers one field more,
  `stopped`: null, or where a debugger holds a script. `game.step` answers the same
  field, so a client knows why fewer steps ran than it asked for. A debugger's values
  say which entity a number is the handle of (`entity`, `entity_name`), and its
  answers carry a `note` while scripts have no local names; `debug.evaluate` on such
  scripts fails with `E0444`, which says why, where it failed with `E0302`.
- **A script can be debugged from an editor**: `frost dap` is a debug adapter (the Debug
  Adapter Protocol on standard streams) for any editor with a DAP client: breakpoints
  in the game's .luau files, steps, the stack, locals, tables, a console, and what the
  scripts print. It starts the game with or without a window, or joins a running
  `frost dev` (`frost dap --help`).
- **A script can be debugged over the protocol**: the `debug.` commands of `frost dev`,
  `frost serve` and `frost mcp` set breakpoints, stop a script part way through a step,
  step it, and show its stack, its locals and what a line of Luau gives there
  (`frost protocol debug.attach`; the engine's `debug` example is a game to try it on). An exported
  game has no debugger. Nothing changes for a game nobody debugs: a debugger that is
  attached and stops nothing leaves every checksum and frame as it was. `log.since` reads what
  scripts printed and the game's warnings, each `print` with its file and line, for a
  client that does not read standard error. `script.reload`
  answers one field more, `queued`, which is false unless a debugger holds a script
  stopped.
- **`frost export` refuses a checkout that is not the source `frost` was built from**
  (`E0517`, naming the commit of each): the player it would build is another engine
  than the one `frost run` and `frost test` are, and could come to another checksum. Build
  `frost` again, or pass `--any-engine` to export all the same. A project may give its
  name as `title = "..."`: the window, the browser tab and the exported program are
  named by it (before: by the folder, which is still what a project without one gets).
  A project with `libraries` and no `scripts` exports a player that can load it.
- **`frost test` warns of a recorded game whose sound goes over full scale (`W0438`).**
  It is cut off there, which crackles. The game passes as before; play fewer sounds at
  once or turn them down. `frost run --wav` warns the same and prints the run's `peak`.
- **A played sound says where it is heard from.** `audio.requests` and a session's
  record give each `play` a `pan` (0 is the middle, which every sound was), and
  `frost run --sounds` ends a line with it when it is not 0. Nothing to write.
- **At most 4 of one sound are heard at once, and 32 in all.** One more takes the
  place of the quietest of them (the oldest of those as quiet), which is eased out; past
  32 it was the new sound that was dropped. A pile of one sound in one step is quieter
  than it was and no longer sums past full scale. Nothing to write.
- **`frost check` warns of a sound over three minutes in a project with a `[web]`
  table (`W0437`).** A browser holds it decoded, 21 MB a minute of stereo. The game
  loads and plays as before.
- **In a browser, held music is stopped and started again where it stood.** It was
  played at no speed, which not every browser does alike. Like a desktop, the page now
  eases a hold, a let-go, a replaced track and `sound.volume` over a few milliseconds
  where it cut them. Nothing to write.
- **`music.stop(seconds)` fades the music out and then stops it.** `music.stop()`
  stops at once, as before. A tool that reads requests sees the time on every stop:
  `frost run --sounds` prints `stop 0` where it printed `stop`, and `audio.requests` and
  a session record give a stop its `seconds`.
- **A sound never moves a checksum, with one exception.** Playing, stopping, fading
  and panning are output only and are no part of the world. `vary` on `sound.play` is
  the exception: it draws the pitch from the game's random source, so adding or
  removing it changes what `math.random` gives afterwards, and the checksum with it.
- **`frost run` prints two checksums, named apart**: `world checksum:` (the world after
  the last step; the line was `checksum:`) and `run checksum:` (every world from the
  start, the number a project's `replay` holds). A tool that read the `checksum:` line
  reads `world checksum:` now. `frost test` says which of the two a line is about. The
  protocol's `checksum` field is unchanged: it is the world's.
- **`frost check` and `game.check` call `on_scene` for the scene a game starts in**, in a
  game of their own that is thrown away, and report a failure as an error with its
  line: a game that cannot start no longer checks as "no problems". A check still
  runs no step. An `on_scene` that is slow or prints is now slow and prints in a check.
- **`frost test FOLDER` tests every project file with a `replay`**, not only those named
  `game.toml`: a second recording of a game kept beside it (`game-pad.toml`) is found.
  `frost reference --types GAME.toml` no longer needs the scripts to load, and `frost
  changes` prints this file.
- **A bare scene names its pictures from its own folder**, not from the folder `frost`
  was started in, and a `Font` that asks for a text style the game does not have is
  found by `frost check` and as the game loads (`E0429`), not at the first step. A scene
  that was run from its own folder is unchanged.
- **An exported game with scripts always has animation.** Before, `frost export` looked
  for the text `tween(` in the scripts, and a tween started under another name or from
  a library the search missed failed in the exported game only. `frost export desktop`
  lists a font file two styles share once.
- **`on_scene` is called for the scene a game starts in**, as the game is loaded and
  before its first step (since the change "Small fixes from the second outside game,
  first part"). A script written before that, which fills `state` in a first-step
  branch of `step` and reads it in `on_scene`, stops at load with `E0302`. Fill `state`
  at the top of the script or in `on_scene` itself. Games made from the platformer, arena or breaker
  template before then are of this kind.
- **The interface no longer writes `Opacity`.** What hides a node, and what a panel's
  `Opacity` and `Scale` do to the nodes in it, is written to a component of its own,
  `Inherit`, which the renderer multiplies in. A node needs no `Opacity = {}` to be
  hidden (`E1303` is retired; the lines can go), a node that was hidden in the scene
  with an `alpha` of its own comes back at that alpha and not at 1, and a panel that
  fades or grows takes its children with it. A script that read `Opacity.alpha` to
  learn whether a node is hidden reads `Node.shown`. Every recorded game that hides a
  node has a new checksum.
- **An empty `Bar` or `Slider` hides its `fill` node** (`Node.shown`): before, the fill
  kept its last width. **A stick pushed both ways moves the focus or the slider, the
  way it is pushed further**: before, left and right always won. **The theme's
  `pressed` colour no longer stays on a button** whose use opened a modal node.
- **The Ballast template has a pause menu** (Escape, P or Start): Resume, Restart room,
  Quit to title, made of `frost_ui` nodes in `common.toml` and held still by
  `physics.pause`. Its title has a band behind the name and its end screen three lines.
  A game started from the old template is not changed.
