Merge origin/main into feat/java-packs-photon-chocapic
# Conflicts: # crates/horizon-shaderpack/src/translate.rs # docs/shader-packs.md
This commit is contained in:
@@ -4,6 +4,7 @@ To play, use [the launcher](../launcher/README.md); the project site is [playhor
|
||||
|
||||
## Build and run
|
||||
|
||||
- [AGENTS.md](../AGENTS.md) and [Architecture](architecture.md): where each part of the code lives, how `Game` is organised, which harness checks which area.
|
||||
- [Build from source](../README.md#build-from-source): your own copy of the game, resource preparation, `cargo run`.
|
||||
- [Native client](native-client.md): options, controls, the dedicated server, `horizon-ctl` scripting, packaging, architecture.
|
||||
- [Host a server](hosting.md): install `horizon-server`, prepare the game files, first run, `server.toml`, the commands, the web panel, backups, services and Docker; what works today and what doesn't yet.
|
||||
|
||||
+257
-197
@@ -1,237 +1,297 @@
|
||||
# Agent control: driving the launcher and the game
|
||||
|
||||
AI agents and scripts control Horizon through four surfaces:
|
||||
A player's own AI agent (Claude Code, Codex, Cursor, any MCP client) or a script can do
|
||||
everything a player does with the mouse and keyboard, in the launcher and in the game. This page
|
||||
covers developers: the surfaces, the full inventory, and the rules every new command follows.
|
||||
Players read [Control Horizon with your AI agent](../website/docs/agents.md)
|
||||
(playhorizon.dev/docs/agents).
|
||||
|
||||
The command lists are generated, so they can't drift:
|
||||
|
||||
- [launcher-commands.md](launcher-commands.md): every `horizon-launcher` command, its arguments
|
||||
and its MCP tool. It comes from the CLI's clap definition (`cli_tools::markdown`), and the
|
||||
launcher test `the_launcher_reference_is_up_to_date` fails when it is stale or a tool is missing.
|
||||
- [horizon-ctl-commands.md](horizon-ctl-commands.md): every `horizon-ctl` command, its MCP tool
|
||||
and its arguments. It comes from the command table (`horizon-ctl help --markdown`), and the
|
||||
test `the_generated_reference_is_up_to_date` fails when it is stale.
|
||||
|
||||
## Surfaces
|
||||
|
||||
| Surface | Where | Transport |
|
||||
| --- | --- | --- |
|
||||
| Game control socket | `horizon-client --control` (`crates/horizon-client/src/control.rs`, commands in `src/game/control.rs`, `agent.rs` and friends) | text line in, one JSON line out; Unix socket, or localhost TCP + token where there is none |
|
||||
| `horizon-ctl` | `crates/horizon-client/src/bin/horizon-ctl/` | CLI over the socket: one table of commands (`commands.rs`) gives help, argument checks and the MCP tools |
|
||||
| `horizon-ctl mcp` | same | MCP over stdio, a tool per `horizon-ctl` command |
|
||||
| Launcher CLI and MCP | `launcher/src/cli.rs`, `launcher/src/mcp.rs` | `horizon-launcher <cmd> [--json]`; `horizon-launcher mcp` (stdio) |
|
||||
| Game control socket | `horizon-client --control` / `--control-socket PATH`, or Agent Control on in Horizon Settings > AI Agent (`crates/horizon-client/src/control.rs`; commands in `src/game/control.rs`, `agent.rs`, `ui_control.rs`, `saves_control.rs` and friends) | text line in, one JSON line out; Unix socket, or localhost TCP and a token where there is none |
|
||||
| `horizon-ctl` | `crates/horizon-client/src/bin/horizon-ctl/` | CLI over the socket; one table of commands (`commands.rs`) gives the help, the argument checks, the MCP tools and the reference |
|
||||
| `horizon-ctl mcp` | same | MCP over stdio, one tool per command of the table |
|
||||
| Launcher CLI | `launcher/src/cli.rs` | `horizon-launcher <command> [--json]` |
|
||||
| Launcher MCP | `launcher/src/mcp.rs`, `cli_tools.rs`, `game_tools.rs` | `horizon-launcher mcp` (stdio): every CLI command as a tool, the session tools, and the game's tools as `game_*` |
|
||||
| Connecting | `launcher/src/agents.rs`, `agents_page.rs`; `src/game/agent_settings.rs` | `horizon-launcher agent-config`; Settings > AI in the launcher; Horizon Settings > AI Agent in the game |
|
||||
| No AI | `crates/horizon-core/src/no_ai.rs` | `noAi:true` in `<game home>/horizon-extras.txt`, read by every surface |
|
||||
|
||||
This page is the inventory of what each surface can do and the design every new command
|
||||
follows. Quick start for players and scripts: [native-client.md](native-client.md#agent-control-horizon-ctl-and-mcp).
|
||||
## One MCP server for everything
|
||||
|
||||
## What exists today
|
||||
An agent adds one server, `horizon-launcher mcp`. It holds:
|
||||
|
||||
Legend: **yes** complete, **part** partial (see note), **no** missing, **—** not applicable.
|
||||
"Socket" is the game's own command; `horizon-ctl` and its MCP offer the subset in its table
|
||||
(`horizon-ctl help --game` lists everything the game takes, test hooks included).
|
||||
- **The launcher's CLI, generated.** `cli_tools.rs` walks the clap definition. Each command is a
|
||||
tool named after its words (`mods search` is `mods_search`). Its arguments are the command's,
|
||||
in snake_case, with clap's help, choices and defaults. A call runs that command with `--json`
|
||||
as a child process and returns what it printed. A new CLI command is a new tool with no extra
|
||||
code.
|
||||
- **Session tools**, which keep something running between calls:
|
||||
- `play` (the game, under control: `world`, `creative`, `join`, `offscreen`, `arg`);
|
||||
- `server`, `server_command`, `server_log`, `server_stop`;
|
||||
- `account_sign_in`, `account_list`.
|
||||
- **The game's tools.** It runs the selected version's `horizon-ctl mcp` (shipped beside the
|
||||
game) as a child. It lists that server's tools as `game_<name>`, all but `launch`, and passes
|
||||
calls and results through, images included. `play` starts the game with a control socket in
|
||||
the launcher's data folder. While no game answers, `game_*` calls say to call `play`.
|
||||
|
||||
Why one server rather than two: the game's tools stay defined once, in horizon-ctl's table. The
|
||||
agent's client needs one entry and one approval. The version that plays is always the one the
|
||||
launcher selected, so the game's tools always match the game. `horizon-ctl mcp` stays available
|
||||
on its own, for a game started by hand or by a script.
|
||||
|
||||
## Inventory, before and after
|
||||
|
||||
Before is `main` at 2026-10-23, before #1342, #1343, #1344, #1345 and #1353. After is with
|
||||
them. CLI is `horizon-launcher` for the launcher and `horizon-ctl` for the game. MCP is
|
||||
`horizon-launcher mcp` (the game's tools as `game_*`) and `horizon-ctl mcp`. **part** means only
|
||||
through a generic command (`ui` and `click` by widget, or a raw socket line that horizon-ctl
|
||||
passes on without checking it).
|
||||
|
||||
### Launcher
|
||||
|
||||
| Capability | Window | CLI | MCP | Notes |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| Releases, installed versions, select | yes | yes | yes | `versions`, `list_versions`; selecting happens on install only (no `select` command) |
|
||||
| Install / remove a version | yes | yes | yes | |
|
||||
| Prepare resources | yes | yes | yes | |
|
||||
| Start the client | yes | yes (attached) | yes | MCP starts it detached and cannot reach it afterwards |
|
||||
| Dedicated server: start, console, log, stop | yes | yes | yes | |
|
||||
| Accounts (no secrets) | yes | yes | yes | names and UUIDs only; sign-in is a device code the player enters |
|
||||
| Launcher settings (game folder, auto-install, opening animation, desktop entry) | yes | part | no | CLI has `desktop-entry`; the rest only in the window |
|
||||
| Logs, crash report | yes | yes | yes | |
|
||||
| Updates (Horizon and launcher) | yes | yes | yes | MCP only checks |
|
||||
| Patch notes, links | yes | yes | yes | |
|
||||
| Benchmark | — | yes | no | |
|
||||
| Telemetry consent | PR #250 | PR #250 | PR #250 | opt-in, in review |
|
||||
| Friends: join by invite code | yes | yes (`play --join`) | no | |
|
||||
| Profiles, packs, mods | no | no | no | the launcher has none yet |
|
||||
| The running game's controls | — | no | no | an agent needs a second MCP server (`horizon-ctl mcp`) |
|
||||
| Capability | Window | CLI before | MCP before | CLI after | MCP after | Notes |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| Releases and installed versions | Play, version picker | yes | yes | yes | yes | `versions [--installed]` |
|
||||
| Install, remove a version | Play | yes | yes | yes | yes | `remove` needs `confirm` in MCP |
|
||||
| Pick the version that plays | Play | no | no | yes | yes | `settings selected-version TAG` |
|
||||
| Prepare resources | Play | yes | yes | yes | yes | |
|
||||
| Start the game | Play | yes | yes | yes | yes | `play --world --creative --join --arg`; MCP `play` adds `offscreen` |
|
||||
| Join a friend by invite code | Play | yes | no | yes | yes | `play --join CODE` |
|
||||
| Dedicated server here: start, console, log, stop | Servers | yes | yes | yes | yes | `server`; MCP `server`, `server_command`, `server_log`, `server_stop` |
|
||||
| Hosted servers: list, create, set up, run a command, forget | Servers | yes | no | yes | yes | `servers ...`; `servers_forget` needs `confirm` |
|
||||
| Accounts: list, sign in, sign out, select, offline | Settings | yes | part | yes | yes | names and UUIDs only; sign-in is a device code; `account_offline` was missing |
|
||||
| Game folder, server folder, install new versions, opening animation | Settings | no | no | yes | yes | `settings [KEY VALUE]` |
|
||||
| Extra game arguments | Settings | yes | no | yes | yes | `game-args` |
|
||||
| Applications menu entry (Linux) | Settings | yes | no | yes | yes | `desktop-entry` |
|
||||
| Updates: check and install | Settings | yes | part | yes | yes | MCP could only check |
|
||||
| Patch notes, links | Patch notes, footer | yes | yes | yes | yes | |
|
||||
| Game log, crash reports | Settings | yes | yes | yes | yes | `logs [--crash]` |
|
||||
| Data collection: status, allow, deny, show, delete, send, bug, benchmark upload | Settings > Data | yes | part | yes | yes | sending was missing in MCP; `data_delete` needs `confirm` |
|
||||
| Mod browser: search, check, install, update, remove, list (mods, resource packs, shader packs, modpacks) | Mods | yes | no | yes | yes | `mods ...`; `mods_remove` needs `confirm` |
|
||||
| Modpacks: import, port, play, remove, list | Modpacks | yes | no | yes | yes | `modpack ...`; `modpack_remove` needs `confirm` |
|
||||
| Launcher benchmark | (none) | yes | no | yes | yes | |
|
||||
| The game it started | (the game) | (horizon-ctl) | yes | (horizon-ctl) | yes | `game_*` |
|
||||
| Connect an AI agent | Settings > AI | no | (none) | yes | (none) | `agent-config [--client] [--test]`; the agent is already connected, so there is no tool |
|
||||
| No AI | Settings > AI | no | (none) | yes | (none) | `no-ai [on\|off]`; the player's switch, never an agent's |
|
||||
|
||||
### Game
|
||||
|
||||
| Capability | Socket | horizon-ctl / MCP | Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| Session: launch, wait until ready, open/create a world, save, quit, logs | yes | yes | `launch`, `wait-ready`, `open`, `save`, `quit`, `logs` |
|
||||
| Player and world state | yes | yes | `state`, `status` (renderer, streaming, memory) |
|
||||
| Crosshair target | yes | yes | `looking-at` |
|
||||
| Blocks: one, a box, nearest of a kind | yes | yes | `block`, `blocks`, `find-block` |
|
||||
| Entities near the player | yes | yes | `entities [RADIUS] [TYPE]`; no single-entity detail |
|
||||
| Inventory, armor, offhand, carried stack | yes | yes | `inventory` |
|
||||
| Containers and stations: read, click slots | yes | yes | `screen`/`menu`, `click-slot ID`, `container X Y Z` |
|
||||
| Crafting (grid, result, recipe book) | part | part | grid by `click-slot`; the recipe book only by `click-at` |
|
||||
| Movement, look, path-finding | yes | yes | `move`, `goto`, `look`, `look-at`, `turn --over`, `mouse-move` |
|
||||
| Act on the world | yes | yes | `break`, `place`, `interact`, `use-item`, `attack`, `select`, `drop` |
|
||||
| Raw input: keys, mouse buttons | yes | yes | `key`, `mouse`, `release`; `key w down` stays held through `wait` until `key w up`, `release` or `stop` |
|
||||
| Controllers | yes | yes | `pad` button/stick/trigger/status (a virtual pad) |
|
||||
| Chat and commands | yes | yes | `chat`, `command`, `type`, `messages`, `chat-log` |
|
||||
| Screens: which is open | yes | yes | `screen` gives a label (`title`, `options`, `inventory`...) but not the options page or sub-screen |
|
||||
| Screens: widgets | part | part | `screen` lists **labelled buttons** only (label, bounds, enabled); sliders, fields, list rows, tabs and switches are invisible |
|
||||
| Screens: act on a widget | part | part | `click-button LABEL` (buttons only), `click-at X Y`; no slider set, no field focus, no row select by id |
|
||||
| Options | part | no | `options PAGE` opens a page and `render-distance N` sets one value; no read, no set of the other ~120 options |
|
||||
| Packs (resource packs) | no | no | only through the Packs screen by pixel |
|
||||
| F3 debug data | part | part | `status` has the overlay flags and the renderer; not the F3 lines |
|
||||
| Screenshots | yes | yes | PNG of the next frame (works `--offscreen`) |
|
||||
| Recording video | no | no | |
|
||||
| Benchmarks and frame stats | yes | yes | `bench`, `stats`, `fly`, `--benchmark` |
|
||||
| Multiplayer: connect, disconnect, respawn | yes | part | `connect`/`disconnect` are socket-only |
|
||||
| LAN and friends hosting | yes | no | `lan open/close/status`, `friends host/stop/status` socket-only |
|
||||
| Cheats and test hooks | yes | part | `give`, `time`, `setblock`, `summon`, `effect`; `xp`, `enchant`, `potion`, `trade`, `fill`, `particle`, `sculk` socket-only |
|
||||
| Waits | part | part | `wait TICKS`, `wait-ready`; no "until screen X", "until chunks loaded", "until chat says Y" |
|
||||
| Events | no | no | everything is polled |
|
||||
| Errors with reasons | part | part | `{"error": "text"}`; horizon-ctl adds `kind` (`usage`, `connection`) to its own errors only |
|
||||
| Capability | Screen | CLI before | MCP before | CLI after | MCP after | Notes |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| Start, wait until ready, save, quit, log | (all) | yes | yes | yes | yes | `launch`, `wait-ready`, `save`, `quit`, `logs` |
|
||||
| Every widget of every screen, by id; click, set, type | (all) | yes | yes | yes | yes | `ui`, `click ID`, `set ID VALUE`, `type`; `click-at`, `drag-at`, `scroll-at` by pixel |
|
||||
| Title menu, pause menu | Title, Pause | yes | yes | yes | yes | `ui`/`click`, `pause`, `resume` |
|
||||
| Worlds: list | Select World | part | part | yes | yes | `worlds` |
|
||||
| Worlds: create, open | Create New World | yes | yes | yes | yes | `open WORLD [SEED] [creative]` |
|
||||
| Worlds: rename, back up | Edit World | part | part | yes | yes | `world-rename`, `world-backup` |
|
||||
| Worlds: delete | Select World | part | part | yes | yes | `world-delete FOLDER --confirm`; it was possible through `click` without any confirm |
|
||||
| Servers list | Multiplayer | part | part | yes | yes | `servers` (names and addresses; reads servers.dat) |
|
||||
| Join a server or an invite code, leave | Multiplayer | part | no | yes | yes | `connect`, `disconnect` |
|
||||
| Open to LAN | Pause > Open to LAN | part | no | yes | yes | `lan open\|close\|status` |
|
||||
| Play with Friends: host, stop, status | Pause | part | no | yes | yes | `friends host\|stop\|status` |
|
||||
| Vanilla options, every page | Options | yes | part | yes | yes | `options-get`, `options-set` (all of options.txt, typed); `options PAGE` was socket-only |
|
||||
| Horizon Settings: Graphics, Shader Packs, Controller, Extras, Mods, AI Agent | Horizon Settings | part | part | yes | yes | `options horizon\|graphics\|extras\|agent...`, then `ui`/`click`/`set` |
|
||||
| Agent control on or off, status, connection details | Horizon Settings > AI Agent | no | no | yes | yes | new page (#1353) |
|
||||
| Key binds | Controls > Key Binds | yes | yes | yes | yes | `options-set key_key.jump key.keyboard.j` |
|
||||
| Resource packs, shader packs | Options > Resource Packs, Shader Packs | part | part | yes | yes | `options packs`, `options shader-packs`, then `ui` rows and `click`; `options-set resourcePacks` |
|
||||
| Chat and commands | Chat | yes | yes | yes | yes | `chat`, `command`, `messages`, `chat-log` |
|
||||
| Inventory, containers, stations | Inventory, Chest... | yes | part | yes | yes | `inventory`, `screen`, `click-slot`; `container X Y Z` was socket-only |
|
||||
| Crafting, recipe book | Crafting | part | part | yes | yes | the grid by `click-slot`; the recipe book by `ui`/`click` |
|
||||
| Trading, riding, shearing (right-click an entity) | Merchant, Horse | part | no | yes | yes | `interact-entity ID`; `mouse` was CLI-only |
|
||||
| Horse, llama inventory | Horse | no | no | yes | yes | `mount-menu` |
|
||||
| Books, lecterns, signs | Book, Sign | part | part | yes | yes | `book [next\|back\|take\|done]`, `signedit X Y Z` |
|
||||
| Move, look, find a path | (playing) | yes | yes | yes | yes | `move`, `goto`, `look`, `look-at`, `turn`, `jump` |
|
||||
| Mine, place, use, attack, hotbar, drop | (playing) | yes | yes | yes | yes | `break`, `place`, `interact`, `use-item`, `attack`, `select`, `drop` |
|
||||
| Raw keys and mouse buttons | (all) | yes | part | yes | yes | `key`; `mouse`, `release` were CLI-only |
|
||||
| Controllers | (all) | yes | no | yes | yes | `pad` |
|
||||
| Respawn | Death | yes | yes | yes | yes | `respawn` |
|
||||
| Screenshots | (all) | yes | yes | yes | yes | PNG of the next frame, `--offscreen` too |
|
||||
| F3 data | F3 | yes | part | yes | yes | `key f3`; `status` (renderer, chunks, memory) was CLI-only |
|
||||
| Waits and events | (all) | yes | yes | yes | yes | `wait`, `wait-for`, `events` |
|
||||
| Effects, experience, enchantments, potions, fill | (cheats) | part | no | yes | yes | `effect`, `effects`, `xp`, `enchant`, `potion`, `fill` |
|
||||
| Benchmarks and frame stats | (all) | yes | part | yes | yes | `bench`, `stats` were CLI-only; `fly` |
|
||||
|
||||
### After the PRs in [Status](#status)
|
||||
## No AI
|
||||
|
||||
| Capability | Before | After |
|
||||
| --- | --- | --- |
|
||||
| Screens: widgets | labelled buttons only | every widget of every screen (`ui`): id, kind, label, bounds, slider value, tab selected, slots with stacks |
|
||||
| Screens: act on a widget | `click-button LABEL`, `click-at X Y` | `click ID [right\|middle] [shift]`, `set ID VALUE` (sliders), `click` focuses fields |
|
||||
| Options | open a page; `render-distance` only | `options-get` all 193 `options.txt` options typed with ranges/choices; `options-set` validates, applies, saves |
|
||||
| Waits | `wait TICKS`, `wait-ready` | `wait-for screen\|widget\|loaded\|chat\|event` with timeout errors |
|
||||
| Events | none (poll) | `events [--since SEQ]`: screen, chat, death, respawn, item, dimension, world |
|
||||
| Launch headless | `--offscreen` by hand | `launch --offscreen` in horizon-ctl and its MCP; `launch_client {offscreen}` |
|
||||
| The running game from the launcher's MCP | no (a second server) | every game tool as `game_*` through `horizon-launcher mcp` |
|
||||
One switch hides and turns off every AI feature: `noAi:true` in `<game home>/horizon-extras.txt`.
|
||||
The game home is `HORIZON_HOME`, else the data dir's `horizon`. The game reads its extras from
|
||||
its working directory, which is that folder. `horizon_core::no_ai` reads and writes the switch:
|
||||
|
||||
## Design
|
||||
- `is_on(home)` and `check(home)` read it;
|
||||
- `set(home, on)` keeps the file's other lines, and writes no file to turn off a switch that was
|
||||
never on;
|
||||
- `REFUSAL` is the one line every surface prints.
|
||||
|
||||
### One vocabulary, four surfaces
|
||||
The switch is in three places: Settings > AI in the launcher, Horizon Settings in the game
|
||||
(`Item::NoAi`), and `horizon-launcher no-ai on|off`. When it is on:
|
||||
|
||||
| Surface | What happens |
|
||||
| --- | --- |
|
||||
| Game | opens no control socket, even with `--control` (it logs the refusal); Horizon Settings hides AI Agent...; turning it on in a running game closes the socket at once |
|
||||
| `horizon-ctl` | every command refuses: exit status 4, `{"error": REFUSAL, "kind": "denied"}` |
|
||||
| `horizon-ctl mcp` | refuses to start (exit 4, REFUSAL on stderr); a session already running refuses each call |
|
||||
| `horizon-launcher mcp` | refuses to start; a running session answers each `tools/call` with error -32000 and REFUSAL |
|
||||
| Launcher CLI | `mcp` and `agent-config` are hidden from the help and refuse |
|
||||
| Launcher window | Settings > AI shows only the No AI switch, without Connect an AI agent |
|
||||
| Companion (#1068) | uses the same switch (see horizon-parity companion-notes.md) |
|
||||
|
||||
Every other launcher command stays usable: versions, install, remove, prepare, play, server,
|
||||
notes, links, account, settings, game-args, logs, update, desktop-entry, data,
|
||||
modpack, mods, servers, no-ai and benchmark. None of them drives the game for an agent. The
|
||||
launcher itself, packagers, the docs and players' scripts need them, and `no-ai` has to stay to
|
||||
turn the switch off.
|
||||
|
||||
## Connecting
|
||||
|
||||
- **Launcher, Settings > AI > Connect an AI agent:**
|
||||
- a client picker (Claude Code, Codex, Cursor, any MCP client) with its config and a Copy button;
|
||||
- for clients with a CLI, the add command, shown and run only on **Add to ...**:
|
||||
`claude mcp add --scope user horizon -- <exe> mcp`, `codex mcp add horizon -- <exe> mcp`;
|
||||
- **Test the connection** (`agents::self_test`) starts `<exe> mcp`, lists its tools and says
|
||||
how many answered.
|
||||
- `horizon-launcher agent-config [--client ID] [--json] [--test]` prints the same thing.
|
||||
- **Game, Horizon Settings > AI Agent:**
|
||||
- **Agent Control** (`agentControl` in horizon-extras.txt, off by default) opens the default
|
||||
endpoint (`$HORIZON_CONTROL`, else `horizon-control.sock` in the runtime directory) in a game
|
||||
the player started. Turning it off closes the endpoint and stops its listener.
|
||||
- The page shows whether a client is connected (`Server::clients`), when the last command came,
|
||||
and the socket's name.
|
||||
- **Copy Connection Details** copies the socket path, a `horizon-ctl --socket ... state` line
|
||||
and an `mcpServers` config for this game's `horizon-ctl mcp`.
|
||||
- **The default:** a game an agent starts (`play` in MCP, `horizon-ctl launch`, `--control`) is
|
||||
under control. A game the player starts from the window is not, until they turn Agent Control
|
||||
on. An open socket lets any program of that user drive the game, so it opens only when an agent
|
||||
asked for the game, or when the player chose it.
|
||||
|
||||
## Design rules for a new command
|
||||
|
||||
### One vocabulary
|
||||
|
||||
- **A command has one name**, kebab-case, the same on the socket, in `horizon-ctl` and in the
|
||||
launcher CLI. Its MCP tool is the name with `_` for `-` (`click-slot` → `click_slot`).
|
||||
The launcher's MCP offers the game's tools under a `game_` prefix (`game_click_slot`) so they
|
||||
never collide with its own (`logs` exists on both sides).
|
||||
- **Arguments** are positional words then `--flags`; the `horizon-ctl` table (`Param`) is the
|
||||
source of truth and generates the MCP `inputSchema`. A new game command is not done until it
|
||||
is in that table.
|
||||
launcher CLI. Its MCP tool is the name with `_` for `-` (`click-slot` is `click_slot`). In the
|
||||
launcher, a subcommand's words are joined (`mods search` is `mods_search`). The launcher's MCP
|
||||
offers every game tool as `game_<name>`, so none collides with its own (`logs` is on both
|
||||
sides). A launcher tool whose name starts with `game_` (`game_args`) is matched first.
|
||||
- **Arguments:** positional words, then `--flags`.
|
||||
- The game: the `horizon-ctl` table (`Param`) is the source of truth. It generates the MCP
|
||||
`inputSchema` and the reference. A game command is not done until it is in that table.
|
||||
- The launcher: the clap definition is the source of truth. Give every argument a help line;
|
||||
it becomes the tool's description.
|
||||
- **Replies are one JSON object.** A query returns its data; an action returns
|
||||
`{"ok": true, ...}` plus what changed (`clicked`, `screen`, `drops`...).
|
||||
- **Errors** are `{"error": "<sentence an agent can act on>", "kind": "<reason>"}`. Kinds:
|
||||
`usage` (bad or missing argument), `unknown` (no such command, widget, option, entity),
|
||||
`state` (the game is not in a state that allows it: no world, wrong screen, disabled
|
||||
widget), `busy` (another action or benchmark runs), `timeout`, `connection` (game not
|
||||
reachable), `denied` (needs consent, below). The message names what to do next
|
||||
("no world open; use: open WORLD").
|
||||
- **Shapes are shared**: a position is `[x, y, z]`; a block is
|
||||
`{"pos", "block", "state", "loaded"}`; an item stack is `{"item", "count", "damage"?,
|
||||
"components"?}`; a slot is a stack plus `"slot": ID` (the slot ids of
|
||||
`click-slot`); bounds are `[x, y, w, h]` in GUI pixels, the coordinates of `click-at`.
|
||||
- **Errors** are `{"error": "<sentence an agent can act on>", "kind": "<reason>"}`. The kinds:
|
||||
- `usage`: a bad or missing argument;
|
||||
- `unknown`: no such command, widget, option or entity;
|
||||
- `state`: the game is not in a state that allows it (no world, wrong screen, disabled widget);
|
||||
- `busy`: another action or a benchmark is running;
|
||||
- `timeout`;
|
||||
- `connection`: the game can't be reached;
|
||||
- `denied`: No AI is on (exit status 4).
|
||||
|
||||
### Structured UI: the widget tree
|
||||
The message names what to do next ("no world open; use: open WORLD").
|
||||
- **Shapes are shared:**
|
||||
- a position is `[x, y, z]`;
|
||||
- a block is `{"pos", "block", "state", "loaded"}`;
|
||||
- an item stack is `{"item", "count", "damage"?, "components"?}`;
|
||||
- a slot is a stack plus `"slot": ID` (the slot ids of `click-slot`);
|
||||
- bounds are `[x, y, w, h]` in GUI pixels, the coordinates of `click-at`.
|
||||
|
||||
`ui` returns every interactive element the last frame drew, on every screen (title menus,
|
||||
pause, options pages, inventories and stations, chat, death, Play with Friends):
|
||||
### Safety
|
||||
|
||||
- **Local only.** The socket is a Unix socket in the user's runtime directory, or a TCP port on
|
||||
127.0.0.1 behind a 128-bit token in a file only the user can read. It is never `0.0.0.0` and
|
||||
never a network listener. Both MCP servers use stdio.
|
||||
- **Confirm what can't be undone.** A command that deletes the player's things requires
|
||||
`confirm` and carries the MCP `destructiveHint`. In the game these are `world-delete`, `fill`
|
||||
and `setblock` (the table's `DESTRUCTIVE`); in the launcher, `remove`, `modpack remove`,
|
||||
`mods remove`, `servers forget`, `account sign-out` and `data delete` (`cli_tools::DESTRUCTIVE`).
|
||||
Without `confirm: true` the call is refused and the message says to ask the player. In the game
|
||||
CLI the flag is `--confirm`. The launcher CLI asks nothing: a person typing `remove` meant it.
|
||||
- **Ask before reaching out.** A command that sends data or reaches other people carries
|
||||
`openWorldHint`, and its description says "only when the player asks". In the game these are
|
||||
`connect`, `lan`, `friends`, `chat` and `command`; in the launcher, `data allow`, `data send`,
|
||||
`data bug`, `data benchmark` and `servers create`. `play`'s `join` argument says the same.
|
||||
Telemetry stays opt-in, and only `data allow` turns it on.
|
||||
- **No secrets.** No surface returns tokens, session files, keychain entries or invite secrets
|
||||
the player didn't ask to share:
|
||||
- accounts are names and UUIDs;
|
||||
- sign-in is a device code the player enters;
|
||||
- `--session-file` is read once and deleted;
|
||||
- `servers` reads names and addresses only.
|
||||
- **Vanilla behaviour untouched.** Control code reads state and synthesizes the input events a
|
||||
player produces; registering widgets for the tree draws nothing. A change to game files runs
|
||||
`tools/parity.py --changed origin/main`.
|
||||
|
||||
### The widget tree
|
||||
|
||||
`ui` returns every interactive element the last frame drew, on every screen:
|
||||
|
||||
```json
|
||||
{"screen": "options", "gui_size": [427, 240], "frame": 3061,
|
||||
"widgets": [
|
||||
{"id": "fov", "kind": "slider", "label": "FOV: 70", "bounds": [40, 50, 150, 20], "enabled": true, "value": 0.5},
|
||||
{"id": "video-settings", "kind": "button", "label": "Video Settings...", "bounds": [...], "enabled": true},
|
||||
{"id": "row-2", "kind": "row", "bounds": [...], "enabled": true},
|
||||
{"id": "done", "kind": "button", "label": "Done", "bounds": [...], "enabled": true}]}
|
||||
```
|
||||
|
||||
- **Ids are stable and readable**: the label up to its `:` as a slug (`FOV: 70` → `fov`,
|
||||
`Video Settings...` → `video-settings`); a repeated slug gets `-2`, `-3` in draw order;
|
||||
unlabelled elements are `<kind>-<n>` in draw order. The id of a slider does not change
|
||||
when its value (and so its label) does. World, server and language rows carry their
|
||||
names; inventory, creative and menu slots are `slot-<ID>` with
|
||||
their stack (an item tab's display slots are `slot-900` up).
|
||||
- **Kinds**: `button`, `slider` (`value` 0..1 as drawn), `field` (text box), `row` (list
|
||||
entry: world, server, pack, language), `tab` (`selected`), `slot`.
|
||||
- **Actions by id**: `click ID [right|middle]` (move the pointer there and click, exactly as a
|
||||
player would; `middle` is the pick block button, which clones a stack in creative), `set ID VALUE` (a slider to a 0..1 position, a click on its track, as vanilla
|
||||
`AbstractSliderButton.onClick` reads the pointer). `type TEXT` keeps typing into the focused
|
||||
field; `click` on a field focuses it. After a click or a set, the next `ui`, `click` or
|
||||
`set` waits for a redrawn frame, so it never reads the screen the click left.
|
||||
- **No new code paths in screens**: the tree is built from what the draw functions already
|
||||
register for the controller's focus navigation (`widgets.rs`), so every screen that a
|
||||
controller can drive is in it, and clicks go through the same window events as the mouse.
|
||||
- **Ids are stable and readable.** An id is the label up to its `:`, as a slug (`FOV: 70` is
|
||||
`fov`, `AI Agent...` is `ai-agent`). A repeated slug gets `-2`, `-3`; unlabelled elements are
|
||||
`<kind>-<n>`. A slider's id doesn't change with its value. Slots are `slot-<ID>` with their
|
||||
stack.
|
||||
- **Kinds:** `button`, `slider` (`value` 0..1), `field`, `row` (a world, server, pack or
|
||||
language), `tab` (`selected`), `slot`.
|
||||
- **Actions:**
|
||||
- `click ID [right|middle] [shift]` clicks where the mouse would.
|
||||
- `set ID VALUE` moves a slider.
|
||||
- `type` types into the focused field.
|
||||
|
||||
### Options
|
||||
After a click, the next `ui`, `click` or `set` waits for a redrawn frame.
|
||||
- **No new code paths in screens.** The tree is built from what the draw functions already
|
||||
register for controller navigation (`widgets.rs`).
|
||||
|
||||
- `options-get [KEY...]`: every option of `options.txt` by its vanilla key, with its value
|
||||
and what it accepts: `{"key": "fov", "value": 70, "type": "int", "min": 30, "max": 110}`,
|
||||
enums with `choices`, key bindings as `key.keyboard.w`. Next: Horizon's own files
|
||||
(`horizon-graphics.txt`, `horizon-controller.txt`, extras) under their own keys.
|
||||
- `options-set KEY VALUE`: validated like vanilla's `OptionInstance.set` (out of range is an
|
||||
error here, not a silent reset), applied at once as the options screen would apply it, and
|
||||
saved. Reply: the new value.
|
||||
- `options [PAGE]` keeps opening a page for screenshots and for `ui`.
|
||||
### Waits and events
|
||||
|
||||
### Inventory, containers, world, entities
|
||||
- `wait-for screen NAME|widget ID|loaded|chat TEXT|event KIND [--timeout S] [--since SEQ]`
|
||||
replies when the condition holds, or with `kind: timeout`.
|
||||
- `events [--since SEQ]` returns what happened since SEQ: screens, chat, deaths, respawns, items,
|
||||
dimensions and worlds (the newest 256). Take `last` before an action, and wait with `--since`,
|
||||
so the action's event can't slip in before the wait.
|
||||
|
||||
The existing commands stay and keep their shapes: `inventory`, `screen`, `click-slot`,
|
||||
`block`, `blocks`, `find-block`, `entities`, `looking-at`. Planned additions: `entity ID`
|
||||
(full detail: equipment, effects, passengers, AI state), `entities` filters by position and
|
||||
radius around any point (`--at X Y Z`), and `blocks --of BLOCK` to keep a box query small.
|
||||
## Tests
|
||||
|
||||
### Waits
|
||||
- **Unit tests:**
|
||||
- horizon-ctl: the table, the schemas, the reference, the No AI refusal, the destructive and
|
||||
network annotations;
|
||||
- the launcher: generated tools, `confirm`, the reference, the agent configs;
|
||||
- `horizon_core::no_ai`;
|
||||
- `options_ui`: the AI Agent page, and that No AI hides it.
|
||||
- **`tools/agent_control_e2e.py`** drives a real game, offscreen on macOS and on a virtual screen
|
||||
on Linux, through the CLI and MCP:
|
||||
- `survival`, `ui`, `options`, `events`, `consume`, `pick`, `suggestions`;
|
||||
- `manage`: worlds, servers, effects, books, LAN, the options pages and `confirm`;
|
||||
- `no-ai`: every surface refuses;
|
||||
- `setting`: Agent Control on opens the endpoint, the AI Agent page, Copy, and off closes it.
|
||||
- **`tools/launcher_mcp_e2e.py`** drives `horizon-launcher mcp`: the generated tools, `play` and
|
||||
the `game_*` tools, `confirm`, `agent-config` and `--test`, and No AI.
|
||||
|
||||
`wait-for CONDITION [--timeout S] [--since SEQ]` replies when the condition holds, or with
|
||||
an error of kind `timeout` saying what screen it ended on (`wait TICKS` waits for ticks):
|
||||
## Later
|
||||
|
||||
- `screen NAME` (the label `state` shows), `widget ID` (a widget is on screen),
|
||||
- `loaded` (a world is open, the player exists and no chunk is pending),
|
||||
- `chat TEXT` (a new chat line containing TEXT), `event KIND` (an event of that kind);
|
||||
both count from `--since SEQ`, else from now: take `last` from `events` before an action
|
||||
so its event can't slip in before the wait starts.
|
||||
These are tracked in FEATURES.md (LATER):
|
||||
|
||||
### Events
|
||||
|
||||
`events [--since SEQ]` returns what happened since SEQ, oldest first, and `last`, the SEQ to
|
||||
pass next time (the game keeps the newest 256):
|
||||
|
||||
```json
|
||||
{"event": "world", "seq": 1, "tick": 0, "state": "opened", "name": "Survival"}
|
||||
{"event": "screen", "seq": 2, "tick": 0, "from": "title", "to": "playing"}
|
||||
{"event": "item", "seq": 3, "tick": 110, "item": "minecraft:oak_log", "delta": 3}
|
||||
{"event": "chat", "seq": 4, "tick": 140, "text": "[Player] hello"}
|
||||
{"event": "death", "seq": 7, "tick": 300}
|
||||
{"event": "respawn", "seq": 9, "tick": 330}
|
||||
{"event": "dimension", "seq": 12, "tick": 900, "from": "minecraft:overworld", "to": "minecraft:the_nether"}
|
||||
```
|
||||
|
||||
Events are found by comparing state once per event loop turn on the game thread, and only
|
||||
under `--control` (no hooks inside game logic), so they cannot change what the game does.
|
||||
Next: `subscribe [KIND...]`, the same events as a stream on one connection, for clients that
|
||||
keep one open (MCP tools reply once, so `events` is what MCP offers).
|
||||
|
||||
### The launcher's MCP proxies the game
|
||||
|
||||
An agent configures one MCP server, `horizon-launcher mcp`. It runs the selected version's
|
||||
`horizon-ctl mcp` (shipped beside the game) as a child and lists every one of its tools as
|
||||
`game_<name>` (all but `launch`), passing calls and results (images included) through, so
|
||||
the game's tools are defined once, in horizon-ctl's table. `launch_client` starts the game
|
||||
with a control socket in the launcher's data folder (`world`, `creative`, `offscreen`
|
||||
optional) and returns once it answers. While no game listens, `game_*` calls fail with
|
||||
`kind: "state"` and say to call `launch_client`. A game the player starts from the window
|
||||
is not under control.
|
||||
|
||||
### Safety
|
||||
|
||||
- **Local only.** The socket is a Unix socket in the user's runtime directory, or a TCP port
|
||||
on 127.0.0.1 behind a 128-bit token in a file only the user can read. Never `0.0.0.0`,
|
||||
never a network listener; the launcher's MCP is stdio.
|
||||
- **No secrets.** No surface returns tokens, session files or keychain entries: accounts are
|
||||
names and UUIDs, `--session-file` is read once and deleted, and `options-get` leaves out
|
||||
nothing secret because `options.txt` holds none (server addresses are in `servers.dat`,
|
||||
which no command reads).
|
||||
- **Consent for anything that sends data.** Commands that reach the network (`connect`,
|
||||
`chat`/`command` on a server, `lan open`, `friends host`, `install_version`,
|
||||
`check_updates`, telemetry) carry the MCP `openWorldHint` annotation and their description
|
||||
says "only when the player asks". Telemetry stays opt-in (PR #250); no agent command turns
|
||||
it on. Destructive ones (`remove_version`, `sign_out`, `fill`, `setblock`) carry
|
||||
`destructiveHint`.
|
||||
- **Vanilla behaviour untouched.** Control code reads state and synthesizes the same input
|
||||
events a player produces; registering widgets for the tree draws nothing. Every PR that
|
||||
touches game files runs `tools/parity.py --changed origin/main`.
|
||||
|
||||
## Status
|
||||
|
||||
| Step | PR |
|
||||
| --- | --- |
|
||||
| This document | #321 |
|
||||
| `ui`, `click ID`, `set ID VALUE`: the widget tree of every screen | #349 |
|
||||
| `options-get` / `options-set` | #350 |
|
||||
| `wait-for`, `events` | #351 |
|
||||
| The launcher's MCP proxies the game (`game_*`), `launch_client` under control | #342 |
|
||||
| Next: `subscribe` (a stream), error `kind` on every game error, MCP annotations (`openWorldHint`, `destructiveHint`) | |
|
||||
| Next: `entity ID`, `entities --at`, packs (`packs list|enable|disable`), F3 lines, Horizon's own option files, launcher settings over CLI/MCP | |
|
||||
|
||||
Each PR adds its tests: unit tests next to the code, and scenarios in
|
||||
`tools/agent_control_e2e.py` (`survival`, `ui`, `options`, `events`; CLI and MCP) and
|
||||
`tools/launcher_mcp_e2e.py`, which drive the real game offscreen on macOS or on a virtual
|
||||
screen on Linux. `tools/lan_e2e.py` runs two games at once, a host that opens its world to LAN
|
||||
and a guest that joins it, and checks from both sides what a guest sees and can do (player
|
||||
list, own model, armour, name tags, chest lids, crafting, fall damage).
|
||||
- Horizon's own option files by key (`horizon-graphics.txt`, controller, extras) next to
|
||||
`options-get` and `options-set`.
|
||||
- Adding and removing saved servers by command.
|
||||
- `subscribe`: events as a stream on one connection.
|
||||
- Launcher window screenshots in this page's PRs.
|
||||
- No AI changed in the launcher while a game is open: the game rewrites its extras when it saves.
|
||||
- A confirmation question in the launcher CLI for destructive commands.
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
# Architecture: feature → files → checks
|
||||
|
||||
The 40 areas changed most often in the 30 days to 2026-10-23 (commits on main touching the area; `game.rs` is
|
||||
counted only for the game loop because nearly every gameplay change touches it). The crate map, how `Game` is
|
||||
organised and how to build and test are in [AGENTS.md](../AGENTS.md).
|
||||
|
||||
Paths: `L/` = `crates/horizon-client/src/`, `G/` = `crates/horizon-client/src/game/`, `W/` =
|
||||
`crates/horizon-world/src/`. Checks: a bare name is a harness (`python3 tools/parity.py <name>`, script
|
||||
`tools/test_<name>_parity.py`); `lan_e2e <check>` is `python3 tools/lan_e2e.py --check <check>`.
|
||||
|
||||
For the full set of harnesses a file can affect, ask the runner:
|
||||
`printf '%s\n' <paths> > /tmp/p.txt && python3 tools/parity.py --changed-files /tmp/p.txt --list`.
|
||||
Any file of the game binary (`game.rs`, `game/`) selects the ~25 harnesses that run the binary; a client lib
|
||||
file selects ~103.
|
||||
|
||||
| # | Area (commits) | Files | Checks |
|
||||
|---|---|---|---|
|
||||
| 1 | Game loop, tick order, frame pacing (554) | `L/game.rs` (`fn tick`, `fn tick_world`, `fn render`, `about_to_wait`), `L/clock.rs`, `L/window.rs`, `L/spans.rs` | game_loop, frame_limiter, interaction_input, tick |
|
||||
| 2 | Mobs in the game loop, spawning (166) | `G/creatures.rs`, `G/natural_spawning.rs`, `L/mobs/spawning.rs`, `L/mobs/spawn_rules.rs`, `L/mobs/spawn_selection.rs`, `L/mobs/finalize.rs`, `G/spawner.rs`, `G/trial_spawner.rs` | natural_spawn, spawn_rules, finalize_spawn, spawner, trial_spawner, mob_ai |
|
||||
| 3 | World save and load (163) | `L/save.rs`, `G/saving.rs`, `G/persist.rs` (entities), `L/entity_nbt.rs`, `L/block_entity_nbt.rs`, `W/region.rs`, `W/nbt.rs` | save_roundtrip, world_reopen, world, datafix |
|
||||
| 4 | World generation (153) | `W/worldgen.rs`, `W/worldgen/` (`generator*.rs`, `feature_graph.rs`, `structure/`, `placement/`), `L/vanillagen.rs` | chunk_generation, worldgen, server_world_gen, world_spawn, feature_graph, feature_placement, decoration and the other worldgen harnesses |
|
||||
| 5 | Multiplayer client, packets in (145) | `G/remote.rs` (`fn handle_packet`, `fn tick_remote`), `G/remote_*.rs`, `L/net.rs` | dedicated_server, server_entities, lan_e2e (all) |
|
||||
| 6 | Agent control, horizon-ctl (145) | `L/control.rs`, `L/bin/horizon-ctl/`, `G/control.rs`, `G/agent.rs`, `G/events.rs`, `G/ui_control.rs` | `python3 tools/agent_control_e2e.py`; `cargo test -p horizon-client --bin horizon-ctl` |
|
||||
| 7 | CI and release (134) | `.github/workflows/` (`ci.yml`, `parity.yml`, `release.yml`, `launcher.yml`), `tools/ci/`, `tools/parity.py`, `tools/pr_ready.py` | `python3 -m unittest discover -s tests`; actionlint (`.github/actionlint.yaml`) |
|
||||
| 8 | LAN host: connections, play state, tracking (133) | `L/lan/` (`conn.rs`, `hub.rs` + `hub/`, `chunks.rs`, `entity.rs`, `tracking.rs`, `guest.rs`, `playerdata.rs`), `G/lan.rs` | lan, lan_e2e (all), `cargo test -p horizon-client --test lan_bot` |
|
||||
| 9 | Renderer core (132) | `L/gfx.rs` (`Renderer::new`, `Renderer::render`), `L/gfx/` (cull, occlusion, translucency, upload, timing, lod) | client_graphics, culling_rays, translucency; `horizon-client --benchmark standard` |
|
||||
| 10 | Launcher (124) | `launcher/src/` (`main.rs`, `backend.rs`, `cli.rs`, `mcp.rs`, `servers_page.rs`) | `cd launcher && cargo test`; `python3 tools/launcher_mcp_e2e.py` |
|
||||
| 11 | Mob types and species (117) | `L/mobs.rs`, `L/mobs/species.rs`, `L/mobs/data.rs`, `L/mobs/living.rs`, `L/mobs/drops.rs`, `L/mobs/gear.rs` | mob_attributes, entity_attribute, entity_death_loot, mob_ai |
|
||||
| 12 | Guests' actions on a server (98) | `G/lan_actions.rs` (`fn as_guest`, `fn tick_guests`), `G/lan_{attributes,pvp,chat,crafting,stations,trading,mount_menu,waypoints}.rs` | server_player_combat, server_player_damage, server_player_targets, lan_e2e (all) |
|
||||
| 13 | Modpack porting, mod content (97) | `crates/horizon-port-pack/`, `L/mod_content.rs`, `tools/port_*.py`, `packs/` | `cargo test -p horizon-port-pack`; `python3 tools/mod_port_harness.py` |
|
||||
| 14 | Mob AI (96) | `L/mobs/ai.rs`, `goals.rs`, `brain.rs`, `*_brain.rs`, `nav.rs`, `path.rs`, `control.rs` | mob_ai (probe `examples/mob_ai_probe.rs`; known failure on main: drowned_*, #290) |
|
||||
| 15 | Items and item use (96) | `L/items.rs`, `L/item_data.rs`, `G/hand.rs`, `G/consume.rs`, `G/potions.rs`, `L/effects.rs`; game.rs `fn use_hand`, `fn use_item` | use_item_on, item_use, item_use_lifecycle, consumable, consume_effect, status_effect |
|
||||
| 16 | Options and settings screens (93) | `L/options_ui.rs`, `G/options.rs`, `L/settings.rs`, `L/options_file.rs`, `L/graphics_ui.rs`, `L/graphics.rs` | options, toggle_keys |
|
||||
| 17 | HUD, chat, tab list (93) | `L/hud.rs`, `L/hud_layout.rs`, `L/hud_overlays.rs`, `L/chat.rs`, `G/chat.rs`, `L/tab_list.rs`, `L/locator_bar.rs`, `G/locator_bar.rs` | hud, tab_list, locator_bar, chat_screen, secure_chat |
|
||||
| 18 | Command execution (88) | `G/commands.rs`, `G/commands/*.rs`, `L/scoreboard_cmd.rs`, `L/data_cmd.rs`, `G/functions.rs` | command_exec (corpus `tools/command_exec_corpus.py`), scoreboard, server_ops_feedback, lan_e2e commands |
|
||||
| 19 | Chunk streaming, light, tickets (85) | `L/streaming.rs`, `L/world.rs`, `L/chunk.rs`, `L/chunk_map.rs`, `L/light.rs`, `L/ticket_levels.rs`, `L/tick_chunk_membership.rs`, `G/world_loading.rs` | light, chunk_status, random_tick_sections; `cargo test -p horizon-client --test streaming_meshes` |
|
||||
| 20 | Mob models and animation (78) | `L/mobs/render.rs`, `L/mobs/anim.rs`, `L/mobs/body_anim.rs`, `L/mobs/keyframes.rs`, `L/entity.wgsl` | entity_model |
|
||||
| 21 | Block behaviour, server side (78) | `W/level/` (`mod.rs`, `tick.rs`, `hooks.rs`, `data.rs`, `redstone.rs`, `place.rs`), `G/block_entity_ticks.rs`, `G/moving_pistons.rs` | block_update, redstone, random_tick, simple_block, piston_movement, block_entity_tickers |
|
||||
| 22 | Player movement and collision (75) | `L/motion.rs` + `L/motion/`, `L/collisions.rs`, `W/entity_move.rs`, `W/player_travel.rs`, `W/collision.rs` | collision, entity_move, player_travel, living_motion, climbing, swimming; `python3 tools/test_native_scene_motion.py` |
|
||||
| 23 | Resource packs and models (65) | `L/packs.rs` + `L/packs/`, `L/pack_screen.rs`, `L/atlas_sources.rs`, `L/sprites.rs`, `L/model_library.rs`, `G/packs.rs`, `crates/horizon-assets/` | resource_pack, pack_selection, pack_screen, model_resolution, item_model, mipmap |
|
||||
| 24 | Container menus and inventory (61) | `L/menu.rs`, `L/container_screen.rs`, `L/containers.rs`, `L/creative.rs`; game.rs `fn menu_ops`, `fn click_inventory` | menu_click, container_screen, creative, lan_e2e containers clicks |
|
||||
| 25 | Workstations (60) | `L/stations.rs`, `G/stations.rs`, `L/enchant.rs`, `L/brewing.rs` | enchanting, screen_layout, lan_e2e brewing loom stonecutter grindstone anvil smithing |
|
||||
| 26 | Crafting and the recipe book (59) | `L/crafting.rs`, `L/recipe_book.rs`, `L/recipe_book_screen.rs`, `G/recipe_book.rs`, `G/machines.rs`, `G/machines/crafter.rs` | recipe, recipe_book, recipe_book_view, place_recipe, ghost_recipe, crafter |
|
||||
| 27 | Vehicles and mounts (54) | `G/boats.rs`, `G/minecarts.rs`, `G/mounts.rs`, `G/mount_menu.rs`, `G/llamas.rs`, `G/passengers.rs` | server_entities, lan_e2e boats minecarts riding mounts |
|
||||
| 28 | Villagers, trading, raids (50) | `L/mobs/villager*.rs`, `L/merchant.rs`, `G/trading.rs`, `G/villagers.rs`, `L/raid.rs`, `G/raids.rs`, `L/gossip.rs` | trading, raid, mob_ai |
|
||||
| 29 | Title, worlds, startup (49) | `L/title.rs` + `L/title/`, `G/startup_menu.rs`, `L/title_edition.rs` | world_options; `cargo test -p horizon-client --lib title` |
|
||||
| 30 | Dedicated server, horizon-server (48) | `G/dedicated.rs`, `G/dedicated/status.rs`, `crates/horizon-server/`, `crates/horizon-server-files/` | dedicated_server, server_files, user_cache, online_mode, server_ops_feedback |
|
||||
| 31 | Particles and client effects (46) | `L/particles.rs`, `G/render_tick.rs`, `G/level_particles.rs`, `L/animate_tick.rs` | particle_providers, block_particles, entity_particles, emitter_particles, marker_particles |
|
||||
| 32 | Bosses and the End (45) | `G/dragon.rs`, `G/wither.rs`, `G/end.rs` | server_dragon, end_podium, end_gateway |
|
||||
| 33 | Protocol and packets (44) | `crates/horizon-protocol/src/` (`packets/play.rs`, `entity_data.rs`, `connection.rs`) | dedicated_server, online_mode, secure_chat; `cargo test -p horizon-protocol` |
|
||||
| 34 | Multiplayer and LAN screens, friends (44) | `L/multiplayer.rs`, `G/lan_screen.rs`, `G/friends.rs`, `L/friends_screen.rs`, `crates/horizon-friends/`, `crates/horizon-relay/` | lan, world_options; `python3 tools/test_friends.py` |
|
||||
| 35 | Dispensers (43) | `G/dispenser.rs`, `G/dispense_fixture.rs` (the harness side) | dispenser |
|
||||
| 36 | Audio and music (38) | `L/audio.rs`, `L/sound_engine.rs`, `L/sound_events.rs`, `L/music.rs`, `G/music.rs`, `L/ambience.rs`, `G/subtitle_hud.rs` | sound_engine, sound_event, music, situational_music, ambient_sound, subtitle |
|
||||
| 37 | Integrated server and levels (34) | `G/integrated.rs`, `G/levels.rs`, `G/server_travel.rs` | server_dimension_players, `lan_e2e --server-thread` (portals, levels, distance, lava) |
|
||||
| 38 | Command parsing (34) | `L/command/` (`args.rs`, `selector.rs`, `tree_*.rs`, `vanilla.rs`) | command_parse (corpus `tools/command_parse_corpus.py`) |
|
||||
| 39 | Benchmarks and telemetry (34) | `L/benchmark.rs`, `tools/perf_bench.py`, `L/telemetry.rs`, `crates/horizon-telemetry*/`, `crates/horizon-bench/` | `python3 -m unittest tests.test_perf_bench`; [benchmark.md](benchmark.md) |
|
||||
| 40 | Explosions and TNT (31) | `G/explosion.rs`, `G/tnt.rs` | lan_e2e blast; no dedicated harness yet |
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
|
||||
## What is measured
|
||||
|
||||
One game is started per render distance (8, 16 and 32 chunks by default), each from a fresh world, so nothing generated by an earlier run is reused. In each game:
|
||||
One game is started per window size (1280x720 and 1920x1080 by default) and render distance (8, 16 and 32 chunks by default), each from a fresh world, so nothing generated by an earlier run is reused. In each game:
|
||||
|
||||
1. **Start to the title screen.** Wall-clock time from starting the process to the first frame of the title screen with no loading overlay.
|
||||
2. **Create the world.** A creative world named `PerfBench`, seed 1234, default world type and difficulty, created the way the game's own Create World does. **Start to in-world** is the time from starting the process until the player has spawned and every chunk around the spawn is loaded and drawn.
|
||||
@@ -16,7 +16,7 @@ One game is started per render distance (8, 16 and 32 chunks by default), each f
|
||||
|
||||
- **Same machine, same run conditions.** Games run one at a time; the load average before and after each run and the machine (CPU, RAM, OS) are stored with the results. Runs on a machine doing other work are marked as such and not published.
|
||||
- **Same settings, one file.** Every game gets the same `options.txt`, written by the driver: render distance, simulation distance 12, unlimited frame rate (`maxFps:260`), VSync off, FOV 70, automatic GUI scale, windowed, no pause on lost focus, and `inactivityFpsLimit:minimized` (both games otherwise drop to 30 FPS after a minute without input). Everything else stays at vanilla's defaults: Horizon reads vanilla's `options.txt` keys and its defaults match vanilla's (the options harness checks it), and Horizon's own settings (`horizon-graphics.txt`) are left at their defaults, which render as vanilla does.
|
||||
- **Same resolution.** Both windows are 1280x720 (Horizon's default window; vanilla gets `--width 1280 --height 720`). The size each game actually renders at is stored with the results.
|
||||
- **Same resolution.** Both games get the same window size, `--width` and `--height` (vanilla's own launch arguments, which Horizon takes too): 1280x720, the size results were first published at, then 1920x1080, the commonest screen; `--sizes` picks others. The size each game actually renders at is stored with the results: a compositor or screen smaller than the window can shrink it.
|
||||
- **Same world and path.** Same seed and world type; same paths, yaw and pitch, same flight speed; the same steps in the same order. Vanilla is driven by a small dev-only Fabric mod (`mods/horizon/src/bench`), which only calls the game's own code: it creates the world with `WorldOpenFlows.createFreshLevel` as the Create World screen does, teleports with `/tp`, sets the time with `/time set`, and places the player on the path each frame as Horizon's `horizon-ctl fly` does.
|
||||
- **Warm-up excluded.** Each scene's flight starts only after its chunks are loaded and drawn and 2 seconds have passed; the load itself is reported separately. JIT warm-up of the JVM during the first scene is part of vanilla's real behaviour and is not removed.
|
||||
- **The same statistics code.** Horizon returns its raw frame times (`horizon-ctl fly ... raw`) and the vanilla mod writes its own; `stats()` in the driver computes every figure for both.
|
||||
@@ -55,7 +55,7 @@ python3 tools/perf_bench.py --game vanilla-mods --label mods-mine
|
||||
python3 tools/perf_bench.py --table horizon-mine vanilla-mine mods-mine
|
||||
```
|
||||
|
||||
Options: `--distances 8,16`, `--scenes village,ocean`, `--seconds 20`, `--repeats 5`, `--heap 4G` (vanilla), `--offscreen` (Horizon, for locked or headless sessions). Results go to `benchmarks/perf/<label>-rd<N>.json`, one [benchmark report](benchmark-report.md) per render distance (the same format the game's `--benchmark` and the launcher write), with the load average before each game; each game's log, and the vanilla driver's event log, stay in `.local/perf-bench/`. Keep the machine otherwise idle, plugged in, and the window on a screen.
|
||||
Options: `--distances 8,16`, `--sizes 1920x1080`, `--scenes village,ocean`, `--seconds 20`, `--repeats 5`, `--heap 4G` (vanilla), `--offscreen` (Horizon, for locked or headless sessions). Results go to `benchmarks/perf/<label>-rd<N>.json` at 1280x720 and `<label>-1080p-rd<N>.json` at 1920x1080 (other sizes `<label>-<W>x<H>-rd<N>.json`; `--table` takes those labels), one [benchmark report](benchmark-report.md) per window size and render distance (the same format the game's `--benchmark` and the launcher write), with the load average before each game; each game's log, and the vanilla driver's event log, stay in `.local/perf-bench/`. Keep the machine otherwise idle, plugged in, and the window on a screen.
|
||||
|
||||
## Results
|
||||
|
||||
|
||||
@@ -0,0 +1,468 @@
|
||||
# Launcher commands
|
||||
|
||||
<!-- Generated from launcher/src/cli.rs by cli_tools::markdown(); a test fails when this file is out of date. Update it with: HORIZON_WRITE_DOCS=1 cargo test --manifest-path launcher/Cargo.toml the_launcher_reference -->
|
||||
|
||||
Every command of `horizon-launcher`, and the tool `horizon-launcher mcp` offers for it. A tool's arguments are the command's, in snake_case. A tool runs the command with `--json` and returns what it printed. The tools that change the player's things for good need `confirm: true`. The tools that send something or reach other people say "only when the player asks". The game's own tools, `game_*`, are in [horizon-ctl-commands.md](horizon-ctl-commands.md). With No AI on, `mcp` and `agent-config` are hidden and refuse; every other command stays. See [agent-control.md](agent-control.md#no-ai).
|
||||
|
||||
## `horizon-launcher versions`
|
||||
|
||||
List Horizon releases, or the installed versions.
|
||||
|
||||
horizon-launcher versions
|
||||
|
||||
- `--installed`: Only the versions installed here (no network)
|
||||
|
||||
MCP: `versions`.
|
||||
|
||||
## `horizon-launcher install`
|
||||
|
||||
Download and install a release (a tag such as v2026.10.13, or "latest").
|
||||
|
||||
horizon-launcher install <TAG>
|
||||
|
||||
- `TAG`
|
||||
|
||||
MCP: `install`.
|
||||
|
||||
## `horizon-launcher remove`
|
||||
|
||||
Remove an installed version.
|
||||
|
||||
horizon-launcher remove <TAG>
|
||||
|
||||
- `TAG`
|
||||
|
||||
MCP: `remove`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher prepare`
|
||||
|
||||
Prepare a version's resources from your own Minecraft install.
|
||||
|
||||
horizon-launcher prepare
|
||||
|
||||
- `--minecraft`: The game folder of the official launcher, Prism Launcher, MultiMC, the Modrinth App, ATLauncher or GDLauncher (default: the launcher's, then every launcher's default)
|
||||
|
||||
MCP: `prepare`.
|
||||
|
||||
## `horizon-launcher play`
|
||||
|
||||
Start the client.
|
||||
|
||||
horizon-launcher play
|
||||
|
||||
- `--world`: Open or create this world (a folder under saves) at once
|
||||
- `--creative`: Creative mode for a new world
|
||||
- `--join`: Join a friend's world with its invite code
|
||||
- `--arg`: An extra argument for the game, passed through as-is (repeatable), for example --server-thread
|
||||
|
||||
MCP: `play`, then the `game_*` tools.
|
||||
|
||||
## `horizon-launcher server`
|
||||
|
||||
Run a dedicated server here; type commands into its console.
|
||||
|
||||
horizon-launcher server
|
||||
|
||||
- `--dir`: The server's folder (default: the one the launcher uses)
|
||||
- `--accept-eula`: Agree to the Minecraft EULA (https://aka.ms/MinecraftEULA)
|
||||
|
||||
MCP: `server`, `server_command`, `server_log`, `server_stop`.
|
||||
|
||||
## `horizon-launcher notes`
|
||||
|
||||
Show a release's patch notes (default: the newest).
|
||||
|
||||
horizon-launcher notes [TAG]
|
||||
|
||||
- `TAG`
|
||||
|
||||
MCP: `notes`.
|
||||
|
||||
## `horizon-launcher links`
|
||||
|
||||
Show the Discord, sponsor and website links.
|
||||
|
||||
horizon-launcher links
|
||||
|
||||
MCP: `links`.
|
||||
|
||||
## `horizon-launcher account list`
|
||||
|
||||
The signed-in accounts and which one plays.
|
||||
|
||||
horizon-launcher account list
|
||||
|
||||
MCP: `account_list`.
|
||||
|
||||
## `horizon-launcher account sign-in`
|
||||
|
||||
Sign in with a Microsoft account in your browser (device code).
|
||||
|
||||
horizon-launcher account sign-in
|
||||
|
||||
MCP: `account_sign_in`.
|
||||
|
||||
## `horizon-launcher account sign-out`
|
||||
|
||||
Sign out: the account's tokens leave the keychain.
|
||||
|
||||
horizon-launcher account sign-out <WHO>
|
||||
|
||||
- `WHO`: Its name or UUID
|
||||
|
||||
MCP: `account_sign_out`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher account select`
|
||||
|
||||
Play as this account.
|
||||
|
||||
horizon-launcher account select <WHO>
|
||||
|
||||
- `WHO`
|
||||
|
||||
MCP: `account_select`.
|
||||
|
||||
## `horizon-launcher account offline`
|
||||
|
||||
Play offline, without an account.
|
||||
|
||||
horizon-launcher account offline
|
||||
|
||||
MCP: `account_offline`.
|
||||
|
||||
## `horizon-launcher settings`
|
||||
|
||||
Show the launcher's settings, or set one (the Settings page): selected-version TAG, minecraft-dir PATH, server-dir PATH ("default" resets a folder), install-new-versions on|off, opening-animation on|off.
|
||||
|
||||
horizon-launcher settings [KEY] [VALUE]
|
||||
|
||||
- `KEY` (selected-version, minecraft-dir, server-dir, install-new-versions, opening-animation)
|
||||
- `VALUE`: The new value (with KEY)
|
||||
|
||||
MCP: `settings`.
|
||||
|
||||
## `horizon-launcher game-args`
|
||||
|
||||
Show or set the extra arguments the game starts with (for example --server-thread); quotes group a word with spaces in it.
|
||||
|
||||
horizon-launcher game-args [ARGS]
|
||||
|
||||
- `ARGS`: Omit to show the current arguments
|
||||
|
||||
MCP: `game_args`.
|
||||
|
||||
## `horizon-launcher logs`
|
||||
|
||||
Print the end of the game's log (logs/latest.log in the game folder), or its newest crash report.
|
||||
|
||||
horizon-launcher logs
|
||||
|
||||
- `--lines`: How many lines of latest.log
|
||||
- `--crash`: The newest crash report instead
|
||||
|
||||
MCP: `logs`.
|
||||
|
||||
## `horizon-launcher update`
|
||||
|
||||
Look for a newer Horizon release and launcher, and install them.
|
||||
|
||||
horizon-launcher update
|
||||
|
||||
- `--check`: Only report what is available
|
||||
|
||||
MCP: `update`.
|
||||
|
||||
## `horizon-launcher desktop-entry`
|
||||
|
||||
Linux: put Horizon in the applications menu (an entry and the icon, under $XDG_DATA_HOME), or take it out with --remove.
|
||||
|
||||
horizon-launcher desktop-entry
|
||||
|
||||
- `--remove`: Remove the entry and the icon, and stop adding them back
|
||||
|
||||
MCP: `desktop_entry`.
|
||||
|
||||
## `horizon-launcher data status`
|
||||
|
||||
What is allowed, the install ID and how many items wait (the default).
|
||||
|
||||
horizon-launcher data status
|
||||
|
||||
MCP: `data_status`.
|
||||
|
||||
## `horizon-launcher data allow`
|
||||
|
||||
Turn kinds on: performance, crashes, bugs, benchmarks, or all.
|
||||
|
||||
horizon-launcher data allow <KINDS>...
|
||||
|
||||
- `KINDS`
|
||||
|
||||
MCP: `data_allow`, only when the player asks.
|
||||
|
||||
## `horizon-launcher data deny`
|
||||
|
||||
Turn kinds off: performance, crashes, bugs, benchmarks, or all.
|
||||
|
||||
horizon-launcher data deny <KINDS>...
|
||||
|
||||
- `KINDS`
|
||||
|
||||
MCP: `data_deny`.
|
||||
|
||||
## `horizon-launcher data show`
|
||||
|
||||
Print exactly what would be sent.
|
||||
|
||||
horizon-launcher data show
|
||||
|
||||
MCP: `data_show`.
|
||||
|
||||
## `horizon-launcher data delete`
|
||||
|
||||
Delete everything sent from here, and what waits, and take a new install ID.
|
||||
|
||||
horizon-launcher data delete
|
||||
|
||||
MCP: `data_delete`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher data send`
|
||||
|
||||
Send what is waiting now.
|
||||
|
||||
horizon-launcher data send
|
||||
|
||||
MCP: `data_send`, only when the player asks.
|
||||
|
||||
## `horizon-launcher data bug`
|
||||
|
||||
Send a bug report you write; it is printed first, as it would leave.
|
||||
|
||||
horizon-launcher data bug <TEXT>
|
||||
|
||||
- `TEXT`
|
||||
- `--log`: Add the end of the game's log (scrubbed, without chat)
|
||||
- `--yes`: Send without asking
|
||||
|
||||
MCP: `data_bug`, only when the player asks.
|
||||
|
||||
## `horizon-launcher data benchmark`
|
||||
|
||||
Upload a benchmark report (docs/benchmark-report.md); it is printed first.
|
||||
|
||||
horizon-launcher data benchmark <FILE>
|
||||
|
||||
- `FILE`
|
||||
- `--yes`
|
||||
|
||||
MCP: `data_benchmark`, only when the player asks.
|
||||
|
||||
## `horizon-launcher modpack list`
|
||||
|
||||
The imported packs and their coverage (the default).
|
||||
|
||||
horizon-launcher modpack list
|
||||
|
||||
MCP: `modpack_list`.
|
||||
|
||||
## `horizon-launcher modpack import`
|
||||
|
||||
Import a .mrpack, a CurseForge zip or an instance folder, and write its coverage report.
|
||||
|
||||
horizon-launcher modpack import <PATH>
|
||||
|
||||
- `PATH`
|
||||
|
||||
MCP: `modpack_import`.
|
||||
|
||||
## `horizon-launcher modpack port`
|
||||
|
||||
Get the jars of what this computer can port and carry them over.
|
||||
|
||||
horizon-launcher modpack port <PACK>
|
||||
|
||||
- `PACK`: The pack's folder name, as list shows it
|
||||
- `--from`: A folder with your own jars (an installed instance, a downloads folder)
|
||||
|
||||
MCP: `modpack_port`.
|
||||
|
||||
## `horizon-launcher modpack play`
|
||||
|
||||
Play a ported pack as its own profile.
|
||||
|
||||
horizon-launcher modpack play <PACK>
|
||||
|
||||
- `PACK`
|
||||
|
||||
MCP: `modpack_play`.
|
||||
|
||||
## `horizon-launcher modpack remove`
|
||||
|
||||
Remove an imported pack: its jars, ports and the profile's saves.
|
||||
|
||||
horizon-launcher modpack remove <PACK>
|
||||
|
||||
- `PACK`
|
||||
|
||||
MCP: `modpack_remove`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher mods list`
|
||||
|
||||
What the browser installed (the default).
|
||||
|
||||
horizon-launcher mods list
|
||||
|
||||
MCP: `mods_list`.
|
||||
|
||||
## `horizon-launcher mods search`
|
||||
|
||||
Search for packs Horizon loads.
|
||||
|
||||
horizon-launcher mods search [TEXT]...
|
||||
|
||||
- `TEXT`
|
||||
- `--kind` (mod, resource, shader, modpack)
|
||||
- `--everything`: Also what was made for other versions or runs only partly, each marked
|
||||
- `--source` (modrinth, curseforge)
|
||||
|
||||
MCP: `mods_search`.
|
||||
|
||||
## `horizon-launcher mods check`
|
||||
|
||||
Say how well a Java mod runs in Horizon: its jar is downloaded (checksum checked), carried over and read; the answer is kept.
|
||||
|
||||
horizon-launcher mods check <PROJECT>
|
||||
|
||||
- `PROJECT`
|
||||
- `--everything`: Allow a version made for another Minecraft version (1.21 and later)
|
||||
- `--source` (modrinth, curseforge)
|
||||
|
||||
MCP: `mods_check`.
|
||||
|
||||
## `horizon-launcher mods install`
|
||||
|
||||
Install a pack and what it needs, by its id or slug (checksums checked); a Java mod is ported into horizon-mods and turned on; a modpack is imported.
|
||||
|
||||
horizon-launcher mods install <PROJECT>
|
||||
|
||||
- `PROJECT`
|
||||
- `--everything`: Allow a version made for another Minecraft version
|
||||
- `--source` (modrinth, curseforge)
|
||||
|
||||
MCP: `mods_install`.
|
||||
|
||||
## `horizon-launcher mods update`
|
||||
|
||||
Update what the browser installed (or one pack).
|
||||
|
||||
horizon-launcher mods update [PROJECT]
|
||||
|
||||
- `PROJECT`
|
||||
- `--check`: Only say what is newer
|
||||
|
||||
MCP: `mods_update`.
|
||||
|
||||
## `horizon-launcher mods remove`
|
||||
|
||||
Remove a pack the browser installed.
|
||||
|
||||
horizon-launcher mods remove <PROJECT>
|
||||
|
||||
- `PROJECT`
|
||||
|
||||
MCP: `mods_remove`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher servers list`
|
||||
|
||||
The servers, their folder and whether they run.
|
||||
|
||||
horizon-launcher servers list
|
||||
|
||||
MCP: `servers_list`.
|
||||
|
||||
## `horizon-launcher servers create`
|
||||
|
||||
Create a server; with no options it is a new world, survival, normal, 10 players, friends only.
|
||||
|
||||
horizon-launcher servers create
|
||||
|
||||
- `--name`
|
||||
- `--seed`: The new world's seed (default: random)
|
||||
- `--copy-world`: Start from a copy of this world folder (one of your saves)
|
||||
- `--mode` (survival, creative, adventure, spectator)
|
||||
- `--difficulty` (peaceful, easy, normal, hard)
|
||||
- `--max-players`
|
||||
- `--open`: Let anyone in (no whitelist)
|
||||
- `--check-accounts`: Check players' Minecraft accounts (they must sign in with Microsoft)
|
||||
- `--player`: Who may join (repeatable); the first becomes an operator
|
||||
- `--accept-eula`: Agree to the Minecraft EULA (https://aka.ms/MinecraftEULA)
|
||||
|
||||
MCP: `servers_create`, only when the player asks.
|
||||
|
||||
## `horizon-launcher servers set-up`
|
||||
|
||||
Copy an installed, prepared version's programs and game files for the servers (again).
|
||||
|
||||
horizon-launcher servers set-up
|
||||
|
||||
MCP: `servers_set_up`.
|
||||
|
||||
## `horizon-launcher servers run`
|
||||
|
||||
Run a horizon-server command on a server, for example: servers run "My server" -- status.
|
||||
|
||||
horizon-launcher servers run <SERVER> -- <ARGS>...
|
||||
|
||||
- `SERVER`: The server's name or folder
|
||||
- `ARGS`
|
||||
|
||||
MCP: `servers_run`.
|
||||
|
||||
## `horizon-launcher servers forget`
|
||||
|
||||
Take a server off the list (its folder stays).
|
||||
|
||||
horizon-launcher servers forget <SERVER>
|
||||
|
||||
- `SERVER`
|
||||
|
||||
MCP: `servers_forget`, needs `confirm: true`.
|
||||
|
||||
## `horizon-launcher mcp`
|
||||
|
||||
Serve the Model Context Protocol on stdin and stdout, for AI agents (refused while No AI is on).
|
||||
|
||||
horizon-launcher mcp
|
||||
|
||||
MCP: none: this command is the MCP server.
|
||||
|
||||
## `horizon-launcher agent-config`
|
||||
|
||||
How to connect an AI agent (Claude Code, Codex, Cursor, any MCP client) to `mcp`: the config to paste and the command that adds it (refused while No AI is on).
|
||||
|
||||
horizon-launcher agent-config
|
||||
|
||||
- `--client` (claude-code, codex, cursor, generic): Only this client
|
||||
- `--test`: Start the MCP server as a client would and say whether it answered
|
||||
|
||||
MCP: none: it prints how to connect a client to `mcp`.
|
||||
|
||||
## `horizon-launcher no-ai`
|
||||
|
||||
Show or set No AI: on hides and turns off every AI feature (the companion, agent control, horizon-ctl and both MCP servers); off, the default, makes them available.
|
||||
|
||||
horizon-launcher no-ai [STATE]
|
||||
|
||||
- `STATE` (on, off): Omit to show the current state
|
||||
|
||||
MCP: none: the player's switch.
|
||||
|
||||
## `horizon-launcher benchmark`
|
||||
|
||||
Measure the launcher: starts (the first is the cold one), page switching, idle CPU and memory, the release list fetch; writes a benchmark report to benchmarks/ in its data folder.
|
||||
|
||||
horizon-launcher benchmark
|
||||
|
||||
- `--repeats`: How many times to start it
|
||||
|
||||
MCP: `benchmark`.
|
||||
+41
-66
@@ -2,9 +2,8 @@
|
||||
|
||||
How a change gets from a pull request to players: the checks a pull request passes, how it merges, and the
|
||||
automatic releases that follow. Releases are automatic and frequent so the latest Horizon is always playable.
|
||||
Each one goes out as an **alpha** build, which launchers on the **Alpha** channel install at once, and becomes **stable** in
|
||||
the next daily promotion unless something holds it back ([Channels](#channels)): launchers and servers install
|
||||
stable builds unless their owner picks Alpha.
|
||||
There is one channel ([One channel](#one-channel)): each release is published as the release and GitHub's *latest*
|
||||
once its smoke test passed and no `release-blocker` is open, and launchers and servers install it at once.
|
||||
|
||||
## Pull request checks
|
||||
|
||||
@@ -101,12 +100,11 @@ flowchart LR
|
||||
windows["Windows x64<br/>GitHub windows-latest"]
|
||||
mac["macOS arm64<br/>Mac mini runner<br/>+ offscreen game run"]
|
||||
end
|
||||
build --> publish["publish vX.Y.Z as an alpha<br/>notes from the merged PRs"]
|
||||
publish --> alpha(["launchers on Alpha install it"])
|
||||
publish --> promote{"promote.yml, daily at 20:00 UTC:<br/>6 h old by then, smoke test, no release-blocker"}
|
||||
promote --> stable["stable and latest<br/>notes since the last stable"]
|
||||
stable --> launcher(["every launcher and server installs it"])
|
||||
stable --> kira(["Kira posts it;<br/>pings only with ### New"])
|
||||
build --> gate{"gate: the smoke test drew a world,<br/>no release-blocker is open"}
|
||||
gate -- no --> nothing(["nothing is published"])
|
||||
gate -- yes --> publish["publish vX.Y.Z as the release and latest<br/>notes from the merged PRs"]
|
||||
publish --> launcher(["every launcher and server installs it"])
|
||||
publish --> kira(["Kira posts it; the first release<br/>after 20:00 UTC pings, once a day"])
|
||||
```
|
||||
|
||||
### When it releases
|
||||
@@ -121,9 +119,10 @@ commits) since the last **published** game release:
|
||||
- It releases when at least one pull request counts and the newest of them merged at least 5 minutes ago, so a wave
|
||||
of merges becomes one release; if merges never pause, it releases once the oldest has waited 20 minutes. There is
|
||||
no minimum time between releases: every settled player-facing change ships, limited only by the release already
|
||||
building. That is the Alpha channel, many releases a day.
|
||||
building: many releases a day.
|
||||
- A pull request labelled `release-now` (a crash or a blocker) releases at once.
|
||||
- A pull request labelled `skip-release` (work players don't see) doesn't count and isn't listed in the notes.
|
||||
- An open issue labelled `release-blocker` holds every game release, forced ones too (`held by release-blocker #N`).
|
||||
- One release at a time (concurrency group `game-release`); a run that finds nothing new does nothing.
|
||||
- A scheduled or hand-started run releases main's newest commit whose `checks` passed; after `checks`, the commit
|
||||
they passed on.
|
||||
@@ -137,7 +136,7 @@ How releases are numbered, and how installs from before 0.2 reach it: [versionin
|
||||
the patch after the newest release tagged on that line (`v0.2.0` first). A `feature` label doesn't change the line:
|
||||
only that file does, by pull request.
|
||||
- Without the file (every release before 0.2), `vYYYY.MM.DD`, then `.01`, `.02`… the same UTC day.
|
||||
- Every reader (`release_train.py`, `release_channels.py`, the launcher, `horizon-server update`, the website) ranks
|
||||
- Every reader (`release_train.py`, the launcher, `horizon-server update`, the website) ranks
|
||||
every `vX.Y.Z` tag above every dated one.
|
||||
|
||||
### Labels
|
||||
@@ -149,7 +148,7 @@ How releases are numbered, and how installs from before 0.2 reach it: [versionin
|
||||
| `skip-release` | Doesn't trigger a release and isn't listed in the notes |
|
||||
| `run-parity` | Runs the parity job once on a fork's pull request |
|
||||
| `parity-regression` | Opened by the nightly audit for a harness that fails on main |
|
||||
| `release-blocker` | On an issue: holds every beta back from stable while it is open ([Channels](#channels)) |
|
||||
| `release-blocker` | On an issue: no game release is published while it is open ([One channel](#one-channel)) |
|
||||
|
||||
Pull requests without `feature` are listed under **Fixed**. Titles are written for players, since they become
|
||||
the notes.
|
||||
@@ -180,63 +179,38 @@ runs the game: GitHub's runners have neither a GPU worth the name nor the game f
|
||||
- `### Known issues`: the bullets of [docs/known-issues.md](known-issues.md);
|
||||
- thanks to outside contributors, how to install, the disclaimer.
|
||||
|
||||
Kira posts every release in Discord's #releases. An Alpha build (a game pre-release) is posted silently: no ping and
|
||||
Discord's @silent flag, so nobody gets a notification. When the same release becomes Stable it is posted again, and
|
||||
that post pings the releases role when the notes have a `### New` section (at most once every 6 hours). Launcher
|
||||
releases post without a ping.
|
||||
Kira posts every release once in Discord's #releases. It pings the releases role at most once a day: the first game
|
||||
release published after 20:00 UTC, with a short list of what came out since its last ping. Every other post is
|
||||
silent (no ping and Discord's @silent flag). Launcher releases post without a ping.
|
||||
|
||||
### Channels
|
||||
### One channel
|
||||
|
||||
Every game release is published as an **alpha** build, a GitHub pre-release (the workflows, tools and labels
|
||||
call it a *beta*: `release-blocker` holds every beta), so GitHub's *latest* release stays the last
|
||||
**stable** one. The launcher's Settings has an **Updates** choice of two channels (`update_channel` in its
|
||||
`settings.json`, `horizon-launcher update-channel`):
|
||||
Since 2026-10-23 there is one channel. Every game release is published as the release, never a pre-release, and
|
||||
marked GitHub's *latest*: the launcher, `horizon-server update` and `install.sh` take it at once. Because nothing
|
||||
promotes it later, the checks that used to gate a promotion run in the release itself, and the publish job
|
||||
(`tools/release_train.py gate`) publishes nothing unless both pass:
|
||||
|
||||
- **Stable**, the default: a tested build about once a day, the alpha builds promoted below.
|
||||
- **Alpha**: every alpha build as soon as it is built, many times a day; it can break. "Alpha" is the project's
|
||||
word for builds that are still being tested (the whole of Horizon is in beta); Stable is the tested ones. An open
|
||||
launcher looks for releases every 30 minutes on Alpha (4 hours on Stable). Launchers from before 0.2 had a "Beta
|
||||
builds" switch instead; on, it reads as Alpha.
|
||||
- the release smoke test: the macOS build runs the game offscreen on the Mac mini and keeps its report,
|
||||
`smoke-test.json`, only when the game drew a world. The gate reads the report again before publishing, and the
|
||||
release carries it. A run whose macOS build went to GitHub (`MAC_RUNNER=macos-latest`) has no report, so it
|
||||
publishes nothing;
|
||||
- no open issue labelled `release-blocker`. `decide` checks first, so a blocked train builds nothing; the gate checks
|
||||
again right before publishing, so an issue labelled while the builds ran still holds the release. Only the label
|
||||
and the issue's state count, never its text: whoever opened the issue can edit the text after a maintainer
|
||||
labels it. Close the issue (or remove the label) and the next run releases everything waiting, with notes
|
||||
covering all of it.
|
||||
|
||||
`horizon-server update` installs stable builds (`--version <tag>` takes an alpha build by name). In Discord's #releases every
|
||||
Alpha is posted silently and only Stable posts notify (above).
|
||||
A failed gate fails the run; the next run (10 minutes later) decides again. Nothing older than the latest release is
|
||||
ever published: tags only count up.
|
||||
|
||||
`.github/workflows/promote.yml` runs `tools/release_channels.py promote` once a day at 20:00 UTC (21:00 in Paris in
|
||||
winter time, 22:00 in summer), with retries until 21:37 for a run GitHub starts late or skips. It promotes the newest
|
||||
beta that
|
||||
The launcher has no channel setting any more and looks for releases every 30 minutes. The game pre-releases of the
|
||||
old Alpha channel (v0.2.1 on, published before this change) stay listed for anyone who wants one by hand, but no
|
||||
launcher installs them as an update, and `release_train.py` ignores them: the first release of the single channel
|
||||
lists everything since the last release that was not a pre-release (v0.2.0). Launchers from before this change keep
|
||||
updating either way: with Alpha (or 0.17's "Beta builds") on they take every release, pre-release or not; with it
|
||||
off, every release that is not a pre-release, which is now every new one.
|
||||
|
||||
- is newer than the stable release,
|
||||
- had been out 6 hours at 20:00 UTC (published by 14:00 UTC that day; one published later waits for the next day),
|
||||
so every run of the evening picks the same beta and stable moves once a day,
|
||||
- passed its release smoke test: the macOS build attaches `smoke-test.json` (the offscreen game run's report) only
|
||||
when the game drew a world on the Mac mini, so a release built while `MAC_RUNNER` sends macOS to GitHub waits
|
||||
for a hand,
|
||||
- and isn't covered by an issue labelled `release-blocker`. An open blocker holds every beta; closed as completed
|
||||
it still holds the betas published before it closed (they have the bug); closed as not planned it holds
|
||||
nothing. Only the label and the issue's state count, never its text: whoever opened the issue can edit the
|
||||
text after a maintainer labels it, so it can't pick which betas go out.
|
||||
|
||||
Nothing older than the stable release is ever promoted, not even with `force`: GitHub's latest release is what
|
||||
`horizon-server update` and `install.sh` download, so it only moves forward.
|
||||
|
||||
When the oldest beta newer than the stable release has waited 30 hours (it missed a daily promotion it was due for;
|
||||
on a normal day a beta waits at most that long and is promoted), promote.yml opens an issue titled
|
||||
"Promotion to stable has stalled" with the reason from the last check (a blocker left open, smoke tests not
|
||||
running). It closes itself after the next promotion.
|
||||
|
||||
Promoting marks the beta stable and latest and rewrites its notes to list everything since the previous stable
|
||||
release (`release_train.py notes --stable`), so players who skipped the betas see all of it. Older betas stay
|
||||
betas. By hand, from a phone too (GitHub app: Actions, promote, Run workflow):
|
||||
|
||||
```sh
|
||||
gh workflow run promote -f tag=v0.2.3 # that beta now: no wait for 20:00, still no blocker
|
||||
gh workflow run promote -f tag=v0.2.3 -f force=true # even blocked or without a smoke test
|
||||
gh workflow run promote -f dry_run=true # what would be promoted now
|
||||
```
|
||||
|
||||
An alpha build's notes cover only what changed since the release before it (alpha or stable), and say it is an alpha build.
|
||||
`release_train.py decide` counts pull requests from the newest release of either channel, so betas don't
|
||||
release the same changes again.
|
||||
`promote.yml` and `tools/release_channels.py` (the daily promotion at 20:00 UTC) are gone.
|
||||
|
||||
### Signed checksums
|
||||
|
||||
@@ -298,7 +272,8 @@ gh variable set RELEASES_PAUSED --body 1 # no automatic game or launcher rel
|
||||
gh variable delete RELEASES_PAUSED # back on; the next hourly run catches up
|
||||
```
|
||||
|
||||
While paused, runs still decide and say why in their summary; `force=true` still releases.
|
||||
While paused, runs still decide and say why in their summary; `force=true` still releases, but never past an open
|
||||
`release-blocker`.
|
||||
|
||||
### Rolling back
|
||||
|
||||
@@ -308,8 +283,8 @@ A bad release is withdrawn by turning it back into a draft:
|
||||
gh release edit v0.2.3 --draft
|
||||
```
|
||||
|
||||
A beta that is not promoted yet needs no rollback: label an issue about it `release-blocker`. For a stable
|
||||
release: launchers list only published releases, so the previous version becomes the newest one again, launchers that
|
||||
To stop the next releases while a problem is fixed, label an issue about it `release-blocker`. For the bad
|
||||
release itself: launchers list only published releases, so the previous version becomes the newest one again, launchers that
|
||||
didn't install the bad one won't, and players who did can pick the previous version in the launcher's version
|
||||
list (`launcher/src/backend.rs` tests `withdrawn_release_is_never_offered`). The tag stays, so the next release
|
||||
that day takes the next number, and its notes start from the last *published* release, so they list the
|
||||
|
||||
+10
-11
@@ -38,7 +38,7 @@ and some are waiting for Ludovic:
|
||||
| Private vulnerability reporting | **Live** (see the end of this page). |
|
||||
| Signed checksums on releases | **Live** for new releases (#1011): the `release` environment holds the key, and its public half is in `release-keys.txt` (#1023). Releases from before then are unsigned. |
|
||||
| Launchers and servers checking signatures | **Not yet**: #1014 waits as a draft until a signed stable game release and a signed launcher release exist. Until then they trust GitHub's checksum, as before. |
|
||||
| Alpha, then stable | **Live** (#1012): every release is first an alpha build. The launcher's Updates setting picks Stable (the default) or Alpha (the pre-releases). |
|
||||
| Smoke test and release-blocker before publishing | **Live**: since 2026-10-23 every release is the latest at once (one channel, Ludovic's decision), so it is published only after its smoke test passed and while no `release-blocker` is open. The 6-hour beta of the old Alpha, then stable flow (#1012) is gone. |
|
||||
| Reports marked suspicious | **Partly**: the scan of Discord for agents does it. Kira's issues do it once its pull request merges. |
|
||||
| Code owners' review of the pipeline | **Not yet**: `.github/CODEOWNERS` and its protection (#1015) wait for the App, below. Until then pipeline changes merge like any other once `verify` passes. |
|
||||
| Agents on their own GitHub App | **Not yet**: prepared, waiting for Ludovic to create it. Agents still use his account. |
|
||||
@@ -53,11 +53,10 @@ and some are waiting for Ludovic:
|
||||
- **`verify` always runs.** Labels no longer start the checks, and the required `verify` job has no condition, so
|
||||
the only `verify` a change can have is one that ran. Main requires it, from GitHub Actions only, for everyone,
|
||||
admins included.
|
||||
- **Alpha, then stable.** Every release is first an **alpha** build (a GitHub pre-release). It becomes **stable**, the version launchers and
|
||||
servers install by themselves, in the daily promotion (20:00 UTC), only after it has been out 6 hours and passed its
|
||||
smoke test (the game started and drew a world on the Mac mini), and only while no issue labelled `release-blocker`
|
||||
is open. If a beta misses a promotion it was due for, an issue says so. Players who want the newest builds at once
|
||||
pick **Alpha** under Updates in the launcher's Settings. Discord announces stable releases only.
|
||||
- **Checked before it is published.** Every release is published as the latest, which launchers and servers
|
||||
install by themselves, so the release run publishes it only after its smoke test passed (the game started and
|
||||
drew a world on the Mac mini) and only while no issue labelled `release-blocker` is open; otherwise nothing is
|
||||
published.
|
||||
- **Signed updates.** Each release carries a list of its files' checksums, signed with Horizon's release key. The
|
||||
launcher (for the game and for itself) and `horizon-server update` check that signature against the public key
|
||||
built into them, then check the download against the list. Anything unsigned, signed with another key, signed
|
||||
@@ -78,9 +77,8 @@ and some are waiting for Ludovic:
|
||||
## What still needs Ludovic
|
||||
|
||||
- **Approving pipeline changes** (rare): a pull request touching a file in `.github/CODEOWNERS`.
|
||||
- **Holding a release back or speeding one up**, from his phone if he likes. Label an issue `release-blocker` to
|
||||
hold every beta until it is closed. Run the `promote` workflow (GitHub app: Actions,
|
||||
promote, Run workflow) to make a beta stable at once.
|
||||
- **Holding releases back or speeding one up**, from his phone if he likes. Label an issue `release-blocker` to
|
||||
hold every release until it is closed; label a pull request `release-now` to release it as soon as it merges.
|
||||
- **Creating the GitHub App**: one link, "Create GitHub App", then "Install". His login, his clicks.
|
||||
- **Fork pull requests**: their checks run only after a maintainer approves them, and they run on the Mac mini only
|
||||
after a maintainer has read them and added `run-parity`.
|
||||
@@ -90,8 +88,9 @@ and some are waiting for Ludovic:
|
||||
## What this doesn't solve
|
||||
|
||||
- **Code that merges is code that ships.** Signing proves a build came from Horizon's pipeline, not that the code
|
||||
is good. Against a bad change, the safety nets are the checks and harnesses, review, the 6-hour beta and the
|
||||
release-blocker label.
|
||||
is good. Against a bad change, the safety nets are the checks and harnesses, review, the release smoke test and
|
||||
the release-blocker label. Since the single channel there is no 6-hour beta: a change reaches every player
|
||||
within minutes of merging.
|
||||
- **Until agents switch to the App**, they still work with Ludovic's own account, so nothing technical tells his
|
||||
actions from theirs. Code owners' reviews are switched on together with the App.
|
||||
- **The Mac mini** builds the macOS release and also runs pull requests' parity checks: a pull request from this
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
# A server's levels: one per dimension
|
||||
|
||||
Vanilla's `MinecraftServer` holds a `ServerLevel` per dimension, and each player is in one of them.
|
||||
Horizon's server does the same. That covers the dedicated server and single player's server thread
|
||||
(`Game::serving`, the default since #1114). So a LAN world's host and each guest can be in different
|
||||
dimensions at the same time.
|
||||
|
||||
## How the single-level `Game` maps onto vanilla's levels
|
||||
|
||||
The game's tick code reads one level: the one held in `Game`'s own fields (the world, its streaming
|
||||
and save, block ticks, entities, block entities and their per-level queues). `game/levels.rs` keeps
|
||||
the other dimensions' levels as `Parked` values and swaps one into place (`enter_level`). The swap is
|
||||
`mem::swap` of each per-level field, so the tick code runs unchanged, one level at a time.
|
||||
|
||||
| Vanilla | Horizon |
|
||||
| --- | --- |
|
||||
| `MinecraftServer.levels` | the level in place plus `Levels::parked` |
|
||||
| `MinecraftServer.tickChildren`, every level | `tick_server`: each level with a player in it, in Overworld, Nether, End order. The first pass reads the network and runs the shared parts (clock, weather, functions, autosave). |
|
||||
| `ServerLevel.players` | `Hub::here`: the guests whose `dimension` is the level in place |
|
||||
| `ServerPlayer.teleport` into another level | `server_travel.rs`: a Respawn packet, then the teleport once the destination has loaded (portals and `execute in … tp`). An End gateway teleports within the End. |
|
||||
| `PlayerList.respawn` | `guest_respawn`: into the respawn point's level, the Overworld unless the player has an anchor or a `spawnpoint` elsewhere (`Guest::respawn_elsewhere`), resolved through its block once that level has loaded |
|
||||
| `ServerLevel.noPlayersEmptyTime`, chunk unloading | `close_idle_levels`: a level other than the Overworld with nobody in it for 300 ticks is saved and closed |
|
||||
| `CommandSourceStack.getLevel` | `with_source` puts the source's level in place for a command (`execute in`, `execute at` a player in another level) |
|
||||
| the levels' shared `LevelData` | not swapped: game time, day time, weather, game rules, scoreboard, maps, entity ids (`next_entity`, unique across levels) |
|
||||
|
||||
The packets of a guest are read in its own level's pass (`Hub::tick_level`), so its actions and
|
||||
commands run with its level in place.
|
||||
|
||||
The window's own game (single player's default, `--no-server-thread`, `HORIZON_SERVER_THREAD=0`, and the
|
||||
command harness) keeps one level, which follows its player (`enter_dimension`). LAN guests of a world run
|
||||
that way stay in the host's dimension. It is the default again only until the server thread reaches parity
|
||||
(`--server-thread` or `HORIZON_SERVER_THREAD=1` opts in), so it gets no multi-level work.
|
||||
|
||||
## One code path for both
|
||||
|
||||
The dedicated server and the server thread are the same code. The server thread runs a `Game` with
|
||||
`options.dedicated` set and a hub without a host player. The window joins it through memory as one
|
||||
more player. Everything above serves both, and `server_dimension_players` (vanilla clients on Horizon's
|
||||
dedicated server) and `lan_e2e --server-thread` (Horizon clients on the server thread) check it from
|
||||
the two sides.
|
||||
|
||||
## Cost of an extra level
|
||||
|
||||
Measured on the Mac mini (M4 Pro) at render distance 12, on 2026-10-22. The host and a guest each
|
||||
played a fresh world on the server thread. RSS is the host's whole process, window included. Tick time
|
||||
is `/tick query`'s average over 100 ticks.
|
||||
|
||||
| Where the players are | Average tick | P95 | Host RSS |
|
||||
| --- | --- | --- | --- |
|
||||
| both in the Overworld | 1.0 ms | 1.3 ms | 1194 MB |
|
||||
| guest in the Nether (two levels tick) | 2.2 ms | 2.9 ms | 1238 MB |
|
||||
| guest in the End (the Nether still parked) | 0.9 ms | 1.1 ms | 1324 MB |
|
||||
| both back, the Nether and End closed after 300 idle ticks | 0.8 ms | 0.9 ms | 1335 MB |
|
||||
|
||||
- A level costs only while a player is in it: its chunks around that player, their entities, and the
|
||||
tick. With nobody outside the Overworld, `tick_server` runs one pass, as before.
|
||||
- A closed level's memory goes back to the allocator, not always to the system.
|
||||
- Entering a level the first time opens its region files and streaming (`open_level`). That cost
|
||||
comes once, before the player's chunks load.
|
||||
|
||||
## Saving
|
||||
|
||||
`save_game` saves the level in place, then every parked level (`save_parked_levels`). Each level has
|
||||
its own region folder, as in vanilla (`DIM-1`, `DIM1`). A level closed for being idle is saved first.
|
||||
Each player's saved data holds its dimension (`Dimension`). A guest who leaves in
|
||||
the Nether, or whose host saves and quits, joins again in the Nether where it was.
|
||||
|
||||
## What's checked
|
||||
|
||||
`python3 tools/lan_e2e.py --server-thread --check portals --check levels`:
|
||||
|
||||
- `portals`: the guest goes to the Nether through a portal while the host stays. The host then goes
|
||||
to the End while the guest is in the Nether, so three levels run at once, and both come back.
|
||||
- `levels`, with the host and the guest each in a level of its own:
|
||||
- `execute in the_nether run tp` moves the guest alone. From the Nether, `execute in overworld` and
|
||||
`execute at` the host change and test blocks in the host's level.
|
||||
- Mobs and armour stands fall in two levels at once, and every entity id is unique across the
|
||||
levels.
|
||||
- The guest leaves in the Nether and joins again there.
|
||||
- The guest dies in the Nether and respawns in the Overworld. With a `spawnpoint` and then a
|
||||
respawn anchor set in the Nether, it respawns there, and the anchor loses a charge.
|
||||
- The host takes a Nether portal alone.
|
||||
- The guest takes an End portal, an End gateway and then the exit portal alone.
|
||||
- The host saves, quits and opens the world again with the guest in the Nether, and the guest
|
||||
joins again there.
|
||||
|
||||
## Not done yet
|
||||
|
||||
- **End credits for server players.** The first exit from the End should show a player the credits
|
||||
(`EndPortalBlock.entityInside`, `seenCredits`). The client's WinScreen is #338.
|
||||
- **Entities through portals between levels.** Mobs, items and minecarts that enter a portal on a
|
||||
server, and portal tickets (`TeleportTransition.PLACE_PORTAL_TICKET`), are not handled.
|
||||
- **Unlimited selectors.** `@e` without a distance or volume reads only the source's level. Vanilla's
|
||||
reads every level.
|
||||
+1
-1
@@ -90,7 +90,7 @@ not tick cost, so it is in scope here (see section 9).
|
||||
|---|---|
|
||||
| `online-mode=true` | **Works** (ServerLoginPacketListenerImpl): a 1024-bit RSA key pair at start ("Generating keypair"), the encryption request, the shared secret and challenge, AES/CFB8, and the session service's `hasJoined` check (with the address when `prevent-proxy-connections` is on), with vanilla's log lines and messages. `test_online_mode_parity.py` runs the same logins against vanilla's server and Horizon's with a mock session service. |
|
||||
| Secure chat | **Works** (`SignedMessageChain`, `LastSeenMessagesValidator`, `MessageSignatureCache`): the chat session update and its profile key, checked against the services' `playerCertificateKeys`; signed chat, `say`, `me` and `msg`, relayed with their signatures and last-seen lists; `enforce-secure-profile` (with `online-mode`) refuses unsigned chat; and vanilla's log lines (`[Not Secure]`, the decoder's warnings, the kicks). Offline servers and players without a chat session chat unsigned, as on vanilla. `test_secure_chat_parity.py` runs the same signed and unsigned players against vanilla's server and Horizon's, with test keys and a mock services server. |
|
||||
| Nether and End | **Players can't change dimension.** The engine keeps one dimension loaded (`Game::enter_dimension` moves only the local single-player player), and the hub serves one `dimension` to everyone. |
|
||||
| Nether and End | **Works**: the server holds a level per dimension, and each player is in its own (portals, `execute in … tp`, respawn). `test_server_dimension_players_parity.py` checks it against vanilla. How it works, its cost and what's left: [server-levels.md](server-levels.md). |
|
||||
| Refused logins | Logged as vanilla does: `Disconnecting <name> (/address): <reason>`, then `<name> (/address) lost connection: <reason>`, and the session errors (`Username '<name>' tried to join with an invalid session`, `Couldn't verify username because servers are unavailable`). |
|
||||
| Gameplay for remote players | Checked against vanilla's server with a vanilla-codec client (#484, `tools/test_dedicated_server_parity.py`): a right click with an item on a block uses it once, a dead player's commands run, players on a team without friendly fire don't hurt each other, and a player's projectiles are theirs (their ender pearl takes them). The recipe book, status effects and block sync while digging (#500) work. Left: a player's projectiles don't hit other players (no bow PvP between guests), and a mob a guest kills counts in the host's statistics and advancements, not the guest's (`mob_died` runs as the host). |
|
||||
| Defaults that surprise owners | `white-list=true` is vanilla 26.3's default, so a fresh server refuses everyone until they are added. That matches vanilla, so the first-run flow (section 3) asks about the whitelist up front. |
|
||||
|
||||
+69
-16
@@ -13,16 +13,18 @@ Both are off by default. With no pack selected the renderer draws exactly what i
|
||||
| Part | State |
|
||||
| --- | --- |
|
||||
| Renderer layout (below) | today's code |
|
||||
| Horizon shader packs: `composite` stage, uniforms, hot reload, Shader Packs page | done (the page: list, pick, open the folder) |
|
||||
| Horizon shader packs: `deferred`, `gbuffer`, `shadow` stages, custom textures | planned |
|
||||
| Horizon shader packs: `composite` stage, uniforms, hot reload, Shader Packs page | done (the page: list, pick, open the folder, drop a pack on it) |
|
||||
| Horizon shader packs, api 2: stage `format`s, `[profiles]`, option descriptions, a `noise` texture, the opaque depth, a G-buffer reconstructed from depth, a sun/moon shadow map (Stages, below) | first slice: `examples/shaderpacks/horizon-ultra` |
|
||||
| Horizon shader packs: `deferred`, `gbuffer`, `shadow` stages (the pack's own code in the world pass) | planned |
|
||||
| Shader Pack Settings page: a pack's options, sub-screens, sliders, profiles and Reset, Horizon and Java packs alike; applied once on Done, as Iris does | done |
|
||||
| Java shader packs: preprocessing + GLSL parse coverage | spike done: 450 of 470 programs reach valid WGSL (below) |
|
||||
| Java shader packs: preprocessor (`crates/horizon-shaderpack`: includes, options, Iris's macros, JCPP's `#if` and `#define` rules) | done: every program of the three test packs preprocesses; ten packs tested (Compatibility, below) |
|
||||
| Java shader packs: GLSL → WGSL (`horizon_shaderpack::translate`: syntax-tree legaliser, naga) | done: the 464 programs the three test packs enable by default translate (below) |
|
||||
| Java shader packs: `shaders.properties` (`horizon_shaderpack::properties`: screens, sliders, profiles, `program.*.enabled`, image formats, blend modes) | done, no screen yet: read like Iris for the three test packs |
|
||||
| Java shader packs: full-screen pass plan (`horizon_shaderpack::pipeline`: `DRAWBUFFERS`/`RENDERTARGETS`, `colortexN` formats and clearing, buffer flips) | done: planned for the three test packs |
|
||||
| Java shader packs: full-screen passes drawn (`java_pack.rs`, `gfx/java_stages.rs`: `begin`, `prepare`, `deferred*`, `composite*`, `final` over Horizon's world) | first slice: BSL and Complementary run (below) |
|
||||
| Java shader packs: custom uniforms (`horizon_shaderpack::uniforms`), `sunPathRotation`, `clouds`/`sun`/`moon`, eye light | done for the full-screen passes (below) |
|
||||
| Java shader packs: `gbuffers_*`, `shadow`, custom textures, images, compute, option screen | planned |
|
||||
| Java shader packs: preprocessor (`crates/horizon-shaderpack`: includes, options, Iris's macros, JCPP's `#if` and `#define` rules, `.lang` files) | done: every program of the three test packs preprocesses; ten packs tested (Compatibility, below) |
|
||||
| Java shader packs: GLSL → WGSL (`horizon_shaderpack::translate`: syntax-tree legaliser, naga; struct and nested-array varyings, vertex `texture`, `mat2(vec4)`, `1 << 31`) | done: the 464 programs the three test packs enable by default translate (below) |
|
||||
| Java shader packs: `shaders.properties` (`horizon_shaderpack::properties`: screens, sliders, profiles, `program.*.enabled`, image formats, blend modes, `texture.*`) | done: read like Iris for the three test packs |
|
||||
| Java shader packs: full-screen pass plan (`horizon_shaderpack::pipeline`: `DRAWBUFFERS`/`RENDERTARGETS`, `colortexN` formats and clearing, buffer flips, `blend.*`) | done: planned for the three test packs |
|
||||
| Java shader packs: full-screen passes drawn (`java_pack.rs`, `gfx/java_stages.rs`: `begin`, `prepare`, `deferred*`, `composite*`, `final` over Horizon's world) | first slice: BSL and Complementary run (below); `depthtex1`/`depthtex2` before translucent geometry, `blend.*`, PNG `texture.<stage>.*` and `texture.noise` |
|
||||
| Java shader packs: custom uniforms (`horizon_shaderpack::uniforms`), `sunPathRotation`, `clouds`/`sun`/`moon`, eye light, `wetness` | done for the full-screen passes (below) |
|
||||
| Java shader packs: `gbuffers_*`, `shadow`, `.dat` and resource-location textures, images, compute | planned |
|
||||
|
||||
## How the renderer draws a frame today
|
||||
|
||||
@@ -63,7 +65,14 @@ The lightmap, fog and sky colours are computed on the CPU (`environment.rs`, `fo
|
||||
Horizon Settings... → Shader Packs...**, and the Shader Pack row of the graphics settings lead to it. It shows the folder's full path
|
||||
and an *Open Folder* button (the folder is made if it is missing), then one switch per pack: turning one on picks
|
||||
it, turning it off is the vanilla picture. With no pack, it says so under the path. The list is read again every
|
||||
second while the page is open, so a pack dropped into the folder shows up.
|
||||
second while the page is open, so a pack dropped into the folder shows up. A `.zip` or pack folder dropped on the
|
||||
window while the page shows is copied into the folder and picked (Iris's `ShaderPackScreen.onFilesDrop`); one of
|
||||
that name already there is left alone.
|
||||
- With a pack on that has options, **Shader Pack Settings...** opens them: Horizon packs' `[options]` and
|
||||
`[profiles]`, Java packs' `#define`/`const` options laid out by `shaders.properties` (`screen`, `screen.<name>`,
|
||||
`sliders`, `profile.*`) and named by `lang/en_us.lang` (`option.*`, `value.*`, `screen.*`, `profile.*`, as Iris;
|
||||
without one, the option's own name). The values are saved and the pack built again once, when the page closes
|
||||
(Iris applies on Done), not on every click or slider step. A saved value an option doesn't list is ignored.
|
||||
- The choice is kept in `horizon-graphics.txt` (`shaderPack:<folder or zip name>`, empty = off). A pack's option
|
||||
values are kept in `shaderpacks/<pack>.txt`, as Iris does.
|
||||
- A pack that fails to load or compile leaves the vanilla picture (or the last pack that worked) on and says why on
|
||||
@@ -79,7 +88,7 @@ my-pack/
|
||||
composite.wgsl
|
||||
bloom.wgsl
|
||||
textures/
|
||||
noise.png # planned
|
||||
noise.png # api 2: [textures] noise
|
||||
LICENSE
|
||||
```
|
||||
|
||||
@@ -112,6 +121,24 @@ step = 0.05
|
||||
[options.vignette]
|
||||
label = "Vignette"
|
||||
default = true
|
||||
description = "Darkens the corners." # optional: the button's tooltip
|
||||
```
|
||||
|
||||
Api 2 (`api = 2`) adds:
|
||||
|
||||
```toml
|
||||
[[stage]]
|
||||
kind = "composite"
|
||||
shader = "shaders/lighting.wgsl"
|
||||
format = "rgba16float" # this stage's target: rgba8unorm, rgba16float or rgb10a2unorm; the last stage
|
||||
# always writes the screen's format, so earlier ones can keep HDR colour
|
||||
|
||||
[profiles.low] # the Profile button cycles these; "Custom" when the values match none
|
||||
vignette = false
|
||||
saturation = 1.0
|
||||
|
||||
[textures]
|
||||
noise = "textures/noise.png" # replaces the prelude's noise_texture (256x256 random RGB without it)
|
||||
```
|
||||
|
||||
Options become WGSL [pipeline-overridable constants](https://www.w3.org/TR/WGSL/#override-decls): the shader
|
||||
@@ -176,6 +203,29 @@ Prelude helpers: `linear_depth(depth) -> f32` (blocks from the eye), `view_posit
|
||||
The uniform layout only grows: a new field goes at the end and the `api` number goes up; a pack that declares an
|
||||
older `api` still loads.
|
||||
|
||||
An `api = 2` pack's stages get a second prelude after the first (`shader_pack_prelude_api2.wgsl`; api 1 packs don't,
|
||||
so names they declare themselves can't clash):
|
||||
|
||||
| Binding | WGSL | What |
|
||||
| --- | --- | --- |
|
||||
| 6 | `frame_ext: FrameExt` (uniform) | last frame's view and projection and camera, the shadow map's matrices, resolution and distance, eye light, smoothed rain |
|
||||
| 7, 8 | `scene_normal`, `scene_material: texture_2d<f32>` | the G-buffer (below) |
|
||||
| 9 | `opaque_depth: texture_depth_2d` | the world's depth before translucent geometry (water, glass, ice) |
|
||||
| 10, 11 | `shadow_depth: texture_depth_2d`, `shadow_sampler: sampler_comparison` | the sun's (the moon's at night) shadow map |
|
||||
| 12, 13 | `noise_texture: texture_2d<f32>`, `repeat_sampler: sampler` | `[textures] noise`, linear, repeat |
|
||||
|
||||
Helpers: `opaque_depth_at(uv)`, `world_normal_at(uv)`, `material_at(uv)` (block light, sky light, translucent mask,
|
||||
roughness), `reproject_uv(world_offset)` (last frame's uv and depth), `sample_shadow(world_offset, normal)` (5-tap
|
||||
PCF, 1 lit .. 0 shadowed), `aces_tonemap(rgb)`.
|
||||
|
||||
What each costs, only while a stage reads it (naga reports the bindings each entry point uses): the opaque depth, a
|
||||
depth copy between the opaque and translucent halves of the world pass; the G-buffer, one full-screen pass after
|
||||
the world; the shadow map, a depth pass of the terrain and entities from the light. Limits of this first slice: the
|
||||
G-buffer is reconstructed from depth and colour (normals from neighbouring depths, block light estimated from
|
||||
brightness, sky light the camera's), not written by the world's shaders; the shadow map holds the sections the
|
||||
camera draws, so casters outside the view throw no shadow, and none of the terrain where Metal draws sections as one
|
||||
list (`gfx/flat.rs`, more than 4096 of them). The `deferred`, `gbuffer` and `shadow` stages above replace these.
|
||||
|
||||
### How it renders
|
||||
|
||||
With a pack on, the world pass draws into the world target of `gfx/world_post.rs` (it exists already for resolution
|
||||
@@ -377,9 +427,11 @@ What makes Horizon look like OpenGL to the pack:
|
||||
Measured on the Mac mini (M4 Pro) with the packs' default options: BSL v10.1.8 and Complementary Reimagined r5.9.3
|
||||
grade and light Horizon's world as their post-processing would. Sildur's Vibrant v2.02 draws only its sky: its
|
||||
`deferred` reads the albedo `gbuffers_*` write to `colortex4`. Without `gbuffers_*` and `shadow`, no pack has its
|
||||
shadows, water or sky look yet; Distant Horizons' and Voxy's depth read as far. Not supported yet: images and
|
||||
compute (`.csh`; a pack that needs them doesn't load), mipmapped targets (`colortexNMipmapEnabled` is read but
|
||||
ignored), custom textures, the option screen; shadow matrices are identity.
|
||||
shadows, water or sky look yet; Distant Horizons' and Voxy's depth read as far. Horizon's world goes into the target
|
||||
the pack's `gbuffers_terrain` (or the program Iris falls back to) draws to first: `colortex0` for most packs,
|
||||
`colortex1` for MakeUp. Not supported yet: images and compute (`.csh`; a pack that needs them doesn't load),
|
||||
mipmapped targets (`colortexNMipmapEnabled` is read but ignored), `.dat` and resource-location custom textures (PNG
|
||||
files in the pack only); shadow matrices are identity.
|
||||
|
||||
### Compatibility
|
||||
|
||||
@@ -388,6 +440,7 @@ the authors' pages (dev-only test inputs, kept outside the repository). "Loads"
|
||||
the overworld, Nether and End is preprocessed, translated and validated, as the game does when the pack is picked
|
||||
(`java_pack::tests::real_packs_load` with `HORIZON_TEST_SHADERPACKS`); "drawn" means it was also picked in the game
|
||||
and screenshotted. Only full-screen passes run (above), so no pack has its own terrain, water, shadows or sky yet.
|
||||
The MakeUp, Chocapic13' and Photon rows are from 2026-10-23, on Metal and on Vulkan (RTX 4080).
|
||||
|
||||
| Pack | Version | Result | First thing that stops it |
|
||||
| --- | --- | --- | --- |
|
||||
@@ -396,8 +449,8 @@ and screenshotted. Only full-screen passes run (above), so no pack has its own t
|
||||
| Complementary Unbound | r5.8 | loads: 27 passes | |
|
||||
| Sildur's Vibrant Extreme | 2.02 | drawn: 18 passes, only its sky (above) | |
|
||||
| Steadfast | 0.8.0 | drawn: 3 passes | |
|
||||
| Chocapic13' | V9 High | drawn: 16 passes, its grade and fog over Horizon's world | |
|
||||
| MakeUp Ultra Fast | 9.6 | drawn: 6 passes; its fog covers everything without its `gbuffers_*` | |
|
||||
| MakeUp Ultra Fast | 9.6 | drawn: 6 passes, its fog, light shafts and grade over Horizon's world | |
|
||||
| Chocapic13' | V9 High | drawn: 16 passes; its default TAA upscaling shrinks the world in its `gbuffers_*` vertex programs, which don't run, so the picture is magnified 1/0.7: turn TAA Upscaling off in its settings | |
|
||||
| Photon | v1.4 | loads: 27 passes; draws black: it lights the scene from the G-buffer its `gbuffers_*` write | |
|
||||
| Bliss | 2.1.2 | fails | `world0/composite1.fsh`: a vector component passed to an `inout` parameter (WGSL can't point at one) |
|
||||
| Bloop | 1.8.0-Alpha-3 | fails | `world0/prepare1.fsh`: `mat2(vec4)` and other constructors naga's GLSL front end refuses |
|
||||
|
||||
+8
-8
@@ -22,10 +22,10 @@ game and the launcher of the 0.2 line.
|
||||
0.2. A `feature` label no longer bumps anything: it only lists the change under **New**.
|
||||
- **Patch releases** are every release the train makes: the patch after the newest release tagged on the line, game
|
||||
and launcher counted separately (the game releases more often, so `v0.2.14` can go with `launcher@0.2.3`).
|
||||
- **Alpha builds** are not separate tags. As before, every game release is published as a GitHub pre-release (an alpha build, what
|
||||
the launcher's Alpha channel installs) under its final tag and promoted in place to stable in the daily
|
||||
promotion at 20:00 UTC, once it has been out 6 hours ([Channels](release-flow.md#channels)). `v0.2.4` is the same
|
||||
build whether it is still a beta or already stable.
|
||||
- **One channel** (since 2026-10-23): every game release is published under its final tag as the release and
|
||||
GitHub's latest, once its smoke test passed and no `release-blocker` is open
|
||||
([One channel](release-flow.md#one-channel)). The game pre-releases from before (v0.2.1 on, the old Alpha
|
||||
channel) keep their tags and stay pre-releases.
|
||||
- **Pre-release tags** (`v0.3.0-rc.1`, `v0.3.0-beta.2`) are semver's and are reserved for a hand-made preview of a
|
||||
new line; the train never makes them. Every reader orders them before their release and after the release
|
||||
before (`v0.2.9` < `v0.3.0-beta.1` < `v0.3.0-rc.1` < `v0.3.0`).
|
||||
@@ -43,7 +43,7 @@ Every 0.2 tag is newer than every tag from before 0.2. Within each:
|
||||
A tag is a 0.2 tag when it is `v` or `launcher@` followed by exactly three numbers (and an optional `-PRE`) with a
|
||||
major below 1000; a date's first number is a year, so `v2026.10.21` never is. The rule is written once per
|
||||
language, with the same tests: `crates/horizon-server/src/update.rs` (`newer`), `launcher/src/backend.rs`
|
||||
(`release_order`), `tools/release_train.py` (`tag_key`, also used by `tools/release_channels.py`) and
|
||||
(`release_order`), `tools/release_train.py` (`tag_key`) and
|
||||
`website/src/versions.js`.
|
||||
|
||||
## The workflows
|
||||
@@ -55,9 +55,6 @@ language, with the same tests: `crates/horizon-server/src/update.rs` (`newer`),
|
||||
- **`launcher.yml`**: `decide --kind launcher` picks `launcher@0.2.N`; the build gets `HORIZON_LAUNCHER_VERSION`
|
||||
(`0.2.N`) and `HORIZON_LAUNCHER_TAG` (`launcher@0.2.N`). The tag tells the launcher which line it is on: a release
|
||||
built with only the version (every launcher before 0.2) is a `launcher-v` one.
|
||||
- **`promote.yml`**: `tools/release_channels.py` promotes the newest due beta, never one older than the stable
|
||||
release; with the shared order, `v0.2.0` follows the last dated stable release and no dated beta can follow
|
||||
`v0.2.0`.
|
||||
- **Notes**: a line's first release (`X.Y.0`) opens with a paragraph saying so; `v0.2.0`'s and `launcher@0.2.0`'s say
|
||||
that releases are numbered from now on, and tell server owners to run `horizon-server update` (or, if their server
|
||||
says it is up to date, `horizon-server update --version v0.2.0`).
|
||||
@@ -98,6 +95,9 @@ the fleet's `release-kick` and the orchestrator's heartbeat prompts.
|
||||
|
||||
## The day Ludovic says go
|
||||
|
||||
Done on 2026-10-22; kept as the record of how 0.2 went out. `promote.yml` and `tools/release_channels.py`, which
|
||||
it uses, are gone since the single channel (2026-10-23, [One channel](release-flow.md#one-channel)).
|
||||
|
||||
Run by the orchestrator, in this order. Until step 3, nothing is published.
|
||||
|
||||
1. Merge, in order: this page, the `horizon-server update` order, the launcher order, the release line (train,
|
||||
|
||||
Reference in New Issue
Block a user