Skip to content

feat: the debugger links to the game, holds the script and steps it - #23

Merged
vdmkenny merged 2 commits into
mainfrom
feat/debugger
Oct 14, 2026
Merged

vdmkenny merged 2 commits into
mainfrom
feat/debugger

Conversation

@vdmkenny

Copy link
Copy Markdown
Contributor

The first stage of the debugger's design, which this PR adds with its Editor link settings page: the editor links to OpenReliant, holds the mission's script at line breakpoints, and steps it.

  • Linking: Play starts the game with --editor-link and links to it, Link to game links to a game started by hand, and Unlink closes the link while the game plays on. The link's state shows on the toolbar's chip, the status bar and the start screen.
  • Breakpoints: placed by the build's map of statements to lines, which OpenReliant's compiler gives, while the game plays the build of the text as it is. A breakpoint on a line that can't hold moves to the next one that can. They're kept per source file in the settings folder.
  • Holding and stepping: Continue, Step over, Step into, Run to cursor and Pause; the held line in the gutter, the outline, the inspector and the chip; Threads and Variables from the game's state.
  • The connection answers each mission's file with the flags from a task of its own, since the game holds the mission's start until they come.
  • On-screen text is terse: Unlink, Link to game, State polling at 1 Hz or 4 Hz. The design pages and pictures say the same.

Checked: tests including a game made of messages over TCP, make check, --check-missions over the 44 stock missions, and the real game headless, holding mission 90's start part at a breakpoint.

Depends on OpenReliant/openreliant#1208: build.zig.zon pins its head, to repin to main once it merges.

Left for later: conditions, log points and Watch (#19), the timeline (#20), the live scene (#21) and live changes (#22).

Closes #5

The plan for the debugger and its link to the game (#5), before it's built: what it does and
shows, the editor link's messages it uses, what the editor checks itself, how it fits the editor's
modules and the game's profile, what OpenReliant still needs, and the stages to make it in. The
Settings' Editor link page gets its design page and picture.
The first stage of the debugger's design: the editor links to
OpenReliant over its editor link, places line breakpoints in the game's
script by the build's map of statements, shows where the game holds the
script, and steps it.

- Play starts the game with --editor-link and links to it; Link to game
  links to a game started by hand; Unlink closes the link and the game
  plays on.
- A connection task answers each mission's file with the breakpoints'
  flags at once, since the game holds the mission's start until they
  come.
- The session matches the game's mission with the build of the text
  as it is, and places breakpoints and shows holds only while they
  match.
- Breakpoints move to the next line that can hold, and are kept per
  source file in the settings folder.
- Continue, Step over, Step into, Run to cursor and Pause; the held line
  in the gutter, the outline, the inspector and the toolbar's chip;
  Threads and Variables from the game's state; the link's states on
  the toolbar, the status bar and the start screen; the Editor link
  settings.
- The on-screen text is terse: Unlink, Link to game, State polling at
  1 Hz or 4 Hz.

Closes #5
vdmkenny added a commit to OpenReliant/openreliant that referenced this pull request Oct 14, 2026
…#1208)

What the editor's debugger
([openreliant-editor#5](OpenReliant/openreliant-editor#5))
needs from OpenReliant:

- **The compiler's line map.** `compileMapped` gives, with the mission
file, each statement's offset in the script, its line and column, and
whether the VM stops before it. `source_parser.buildMapped` parses and
compiles with it.
- **The link's records.** `link.Hello`, `link.MissionStarted` and
`link.State` write OpenReliant's own payloads and read them back,
passing over keys they don't know. The game writes them and `openreliant
debug` reads them, replacing the hand-parsed fields. The default port
moves into the library beside them.
- **The start's wait.** While an editor is linked, the mission's start
waits for the editor's flags, for a second at most by the clock,
checking the link every millisecond, instead of a fixed fifth of a
second. Without an editor it doesn't wait. Marked as an improvement.

Checked: tests, `make check-missions` (44 missions, 75 bound, the
guide's change), and headless with a fake editor that answers the
mission file half a second late: mission 1 still stops before its start
part's first instruction, with the clock at 0. The editor's
[#23](OpenReliant/openreliant-editor#23) builds
on it, and its `--check-missions` builds all 44 stock missions again
through the mapped build.

Left for later: the script's events for the editor's timeline (#1207).

Closes #1206
@vdmkenny
vdmkenny merged commit a467fb6 into main Oct 14, 2026
3 checks passed
@vdmkenny
vdmkenny deleted the feat/debugger branch October 14, 2026 16:55
vdmkenny pushed a commit that referenced this pull request Oct 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.1.0](v0.0.1...v0.1.0)
(2026-10-14)


### Features

* the debugger links to the game, holds the script and steps it
([#23](#23))
([a467fb6](a467fb6)),
closes [#5](#5)


### Documentation

* where to get the editor and what it needs
([#16](#16))
([523d384](523d384))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The debugger on the editor link

1 participant