Merge main (#1895: world takes level 4): recipes moves to API level 5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
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)
|
||||
Players read [Control Horizon with your AI agent](https://playhorizon.dev/docs/agents)
|
||||
(playhorizon.dev/docs/agents).
|
||||
|
||||
The command lists are generated, so they can't drift:
|
||||
|
||||
+1
-1
@@ -53,4 +53,4 @@ Every page has the same parts: **Overview** (what you can build), **Guide** (whe
|
||||
|
||||
The website shows these pages at [playhorizon.dev/docs/api](https://playhorizon.dev/docs/api), built from this
|
||||
folder, and a summary for players and authors at [playhorizon.dev/docs/apis](https://playhorizon.dev/docs/apis)
|
||||
(`website/docs/apis.md`).
|
||||
(in the website's repository, ludovic111/horizon-site).
|
||||
|
||||
@@ -18,7 +18,7 @@ Level: preview ([stability.md](stability.md)). Schema 1.
|
||||
"projects": [{
|
||||
"id": "coords_hud", "kind": "mod", "name": "Coordinates HUD", "summary": "One line.",
|
||||
"description": "Markdown.", "authors": ["Horizon"], "owners": ["ludovic111"],
|
||||
"license": "MIT", "source": "https://github.com/...", "icon": "https://...png", "key": "RWT...",
|
||||
"license": "MIT", "source": "https://github.com/...", "icon": "https://...png", "key": "RWT...", "downloads": 1234,
|
||||
"versions": [{
|
||||
"version": "0.1.0", "published": "2026-10-24", "changelog": "",
|
||||
"api": "0.1", "side": "client", "capabilities": ["game-read", "hud", "chat"], "api_level": 0, "game": "26.3",
|
||||
@@ -41,6 +41,7 @@ Level: preview ([stability.md](stability.md)). Schema 1.
|
||||
| `icon` | `https://`, optional. |
|
||||
| `key` | The author's [minisign](https://jedisct1.github.io/minisign/) public key. When set, every version must be signed with it; an update signed with another key is refused. Absent: the project is unsigned and the launcher says so. |
|
||||
| `versions` | Newest first, at least one. |
|
||||
| `downloads` | How many times its files were downloaded, every version together: GitHub's count of each release asset, summed by the publish job, which runs every hour. Absent until a file is downloaded. Read-only: never in an entry. |
|
||||
| `api` | A mod's API line (its manifest's `api`); a modpack's manifest format (`1`). |
|
||||
| `side`, `capabilities` | A mod's, read from its manifest by CI, never typed by hand. |
|
||||
| `api_level` | The mod API level a mod's code needs ([stability.md](stability.md#mod-api-levels)): its newest imported function's, read from the file by CI. Absent for content-only mods and in indexes built before levels. Installers take the newest version whose level the running game serves. |
|
||||
@@ -167,6 +168,7 @@ opens.
|
||||
|
||||
## Changelog
|
||||
|
||||
- 2026-10-26: `projects[].downloads`, GitHub's download counts of a project's files, refreshed every hour.
|
||||
- 2026-10-26: the launcher installs `shader` files into `shaderpacks/`; the sample index lists one (`glow`).
|
||||
- 2026-10-25: `shader` opens, checked by `horizon_shader_api::check`; its files are `.hshader`.
|
||||
- Schema 1 (2026-10-24): kinds `mod`, `modpack`, `resourcepack`, `shader`; `.hpack` format 1.
|
||||
|
||||
@@ -17,6 +17,7 @@ The contract between Horizon and its mods: the WIT package `horizon:mods@0.1.0`,
|
||||
| `render` | [`render`](#render) | draw on your screen, shake and zoom the camera |
|
||||
| `input` | [`input`](#input) | see the keys you hold and your clicks, take over the use button on its own items and the mouse wheel, and add keys |
|
||||
| `players` | [`players`](#players) | see who is on the server and message them |
|
||||
| `world` | [`world`](#world) | read and change the world's blocks |
|
||||
| `recipes` | [`recipes`](#recipes) | read the game's recipes and items, and which recipes you know |
|
||||
|
||||
## World `horizon-mod`
|
||||
@@ -30,7 +31,7 @@ A client mod: runs in the player's game.
|
||||
|
||||
A server mod (manifest `side = "server"`, `api = "0.3"`, experimental): runs where the world is simulated, on the dedicated server, a LAN host and single player's own server.
|
||||
|
||||
- Imports (what the game offers): `log`, `storage`, `players`
|
||||
- Imports (what the game offers): `log`, `storage`, `players`, `world`
|
||||
- Exports (what the mod provides): `server-events`
|
||||
|
||||
## World `horizon-ui-mod`
|
||||
@@ -565,6 +566,27 @@ Capability `players`, server mods only (manifest `api = "0.3"`, experimental): t
|
||||
| `tell` | `func(player: string, text: string) -> bool` | A system message to one player, after the mod's name; false when no player with that id is online. Up to 8 messages per call. |
|
||||
| `broadcast` | `func(text: string)` | A system message to every player and the server's log, after the mod's name. Counts toward the same 8 per call. |
|
||||
|
||||
## `world`
|
||||
|
||||
Access: capability `world`.
|
||||
|
||||
Capability `world`, server mods only (manifest `api = "0.3"`, experimental): the blocks of the server's loaded chunks, and changes to them through the server's own block updates.
|
||||
|
||||
### record `block-change`
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
| `x` | `s32` | |
|
||||
| `y` | `s32` | |
|
||||
| `z` | `s32` | |
|
||||
| `state` | `string` | `minecraft:oak_log[axis=y]`; properties left out take the block's defaults, `minecraft:stone` alone is the default state. |
|
||||
|
||||
| Function | Signature | What it does |
|
||||
| --- | --- | --- |
|
||||
| `get-block` | `func(dimension: string, x: s32, y: s32, z: s32) -> option<string>` | The block state at a position in a dimension (`minecraft:overworld`, ...), as `minecraft:oak_log[axis=y]`, as of this call: none where the server has no chunk loaded there. |
|
||||
| `get-biome` | `func(dimension: string, x: s32, y: s32, z: s32) -> option<string>` | The biome at a position (`minecraft:plains`, ...), as the server stores it (one per 4 x 4 x 4 cell): none where no chunk is loaded. |
|
||||
| `set-blocks` | `func(dimension: string, blocks: list<block-change>) -> result<_, string>` | Sets blocks as `/setblock` does: the old block entity removed, neighbours and shapes updated, light, and every player told. Every state is checked now (an error queues nothing); the changes are made in order after this call returns, before that dimension's next tick; one in a chunk not loaded then is skipped. At most 4096 per call. |
|
||||
|
||||
## `server-events`
|
||||
|
||||
Access: exported by the mod: the game calls it.
|
||||
|
||||
+11
-7
@@ -1,7 +1,7 @@
|
||||
# Mod API
|
||||
|
||||
Mods are Rust crates compiled to sandboxed WebAssembly components. They run in the player's game and, once server
|
||||
mods land, wherever a world is simulated. Design and the runtime: [mods.md](../mods.md).
|
||||
Mods are Rust crates compiled to sandboxed WebAssembly components. Client mods run in the player's game; server mods
|
||||
(experimental) run wherever a world is simulated: single player, a LAN host, the dedicated server. Design and the runtime: [mods.md](../mods.md).
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -87,11 +87,12 @@ release.
|
||||
|
||||
What real mods need next, in the order modpacks and servers need it:
|
||||
|
||||
- **Server mods in the game** (`api = "0.3"`, [Server mods](../mods.md#server-mods-api-03-experimental)): the
|
||||
contract, runtime and SDK are here; next the server thread, LAN host and dedicated server start them and call
|
||||
their hooks, then entity events, game rules and server commands with typed arguments.
|
||||
- **World and blocks**: read blocks, block states and biomes in loaded chunks; change them through the server's block
|
||||
log, so clients and the parity harnesses see vanilla's updates.
|
||||
- **More for server mods** (`api = "0.3"`, [Server mods](../mods.md#server-mods-api-03-experimental)): they run
|
||||
on the server thread, a LAN host and the dedicated server today, with joins, chat, commands, players' block
|
||||
breaking and placing, and `world` (read blocks and biomes, set blocks as `/setblock` does); next entity events, game rules,
|
||||
server commands with typed arguments sent to clients' command trees.
|
||||
- **World and blocks**: blocks, block states and biomes are there for server mods (`world`); next block entities,
|
||||
and `world` for client mods (raycasts, single player and LAN hosts).
|
||||
- **Items and inventories**: the player's inventory, held item and open container; item stacks with components.
|
||||
- **Entities**: query and change entities near a position; spawn from a mod's own entity types (data first).
|
||||
- **Block entities and menus**: ticking machines with slots and their screens.
|
||||
@@ -105,6 +106,9 @@ What real mods need next, in the order modpacks and servers need it:
|
||||
|
||||
## Changelog
|
||||
|
||||
- API 0.3: capability `world` (`get-block`, `get-biome`, `set-blocks`); example `beacons`; test scripts' `blocks` and
|
||||
`expect.blocks`.
|
||||
- Server mods run in the game: single player (server thread and in-frame), LAN hosts, the dedicated server.
|
||||
- API 0.3 (server mods, experimental): world `horizon-server-mod`, capability `players`, the `server-events`
|
||||
hooks; SDK `server::ServerMod`; example `welcome`.
|
||||
- SDK: `cargo horizon-mod test` and `horizon_mods::testing`, test scripts in TOML; the template has one.
|
||||
|
||||
+3
-2
@@ -91,11 +91,12 @@ pack exist ([stability.md](stability.md)).
|
||||
|
||||
## Not there yet
|
||||
|
||||
The material stage in the game (the sky and post stages run, with hot reload), option values other than the defaults,
|
||||
then the overlay, lighting and shadow stages.
|
||||
Option values other than the defaults (the three stages run, with hot reload), then the overlay, lighting and shadow
|
||||
stages.
|
||||
|
||||
## Changelog
|
||||
|
||||
- 2026-10-26: the material stage in the game: terrain's surfaces through the pack's `material`.
|
||||
- 2026-10-26: the sky stage in the game: the pack's `sky` gets vanilla's colour along each ray.
|
||||
- 2026-10-26: the post stage in the game (`HORIZON_SHADER_PACK`, hot reload with the last good pack kept).
|
||||
- 2026-10-25: `horizon-shader` (`new`, `check`, `pack`), three templates, the example pack and the guide.
|
||||
|
||||
@@ -38,7 +38,7 @@ don't import it); faster, or fixing behaviour to what the reference already says
|
||||
|
||||
A new WIT function doesn't break older mods, but a mod that calls it can't run on a Horizon from before it. So every
|
||||
function the game offers mods has an **API level**, the one it arrived at (`crates/horizon-mods/src/api_level.rs`):
|
||||
level 0 is the contract of Horizon 0.2.67 to 0.2.69, level 1 adds `render.set-minimap` and server mods' `players`, level 2 `game.raycast`, level 3 `command.run-quiet`, level 4 `recipes` (`items`, `all`, `known`). A mod needs the level of
|
||||
level 0 is the contract of Horizon 0.2.67 to 0.2.69, level 1 adds `render.set-minimap` and server mods' `players`, level 2 `game.raycast`, level 3 `command.run-quiet`, level 4 server mods' `world`, level 5 `recipes` (`items`, `all`, `known`). A mod needs the level of
|
||||
the newest function it imports (a component imports only the functions it calls). The level is read from the file,
|
||||
never declared:
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ Horizon's own settings are pages built from vanilla's widgets, the way mods add
|
||||
The tokens live in one place, `crates/horizon-theme`. The launcher (`launcher/src/theme.rs`)
|
||||
and the game (`crates/horizon-client/src/ui_theme.rs`) read them as Rust constants, and the
|
||||
website reads them as CSS custom properties generated from the same crate
|
||||
(`cargo run -p xtask -- tokens` writes `website/src/tokens.css`; a test fails when the file is
|
||||
out of date). Change a value in the crate and all three follow.
|
||||
(`cargo run -p xtask -- tokens` writes `crates/horizon-theme/tokens.css`, which the website's build
|
||||
reads from main; a test fails when the file is out of date). Change a value in the crate and all three follow.
|
||||
|
||||
## Where it comes from
|
||||
|
||||
@@ -140,7 +140,7 @@ Geist (400, 500, 600) and Geist Mono (400), bundled under the SIL Open Font Lice
|
||||
landscape banner with the hero, the version picker and Play; Mods holds the mod, resource pack
|
||||
and modpack tabs; Versions and Patch notes are lists of panels; Settings is
|
||||
grouped panels of rows. Dark by default, Light or System in Settings (Appearance).
|
||||
- **Website** (`website/`): the Blocks look below. The same page structure as before (what it
|
||||
- **Website** (ludovic111/horizon-site): the Blocks look below. The same page structure as before (what it
|
||||
is, screenshots, parity, launcher, patch notes, community), headings in Pixelify Sans, lists as
|
||||
stacks of panels, the stone texture behind the page and Horizon's pixel landscape (a dawn or a
|
||||
sunset) behind the hero. Light and dark follow the system, with a toggle. A giant wordmark in
|
||||
@@ -168,11 +168,16 @@ of the main action. The game's menus keep `LIGHT` and `DARK`.
|
||||
ships no third-party pictures. The Horizon instance shows a grass block drawn from the player's
|
||||
own prepared Minecraft textures. Sources are named in text ("from Modrinth"): Modrinth's logo is
|
||||
all rights reserved, so it is not shown.
|
||||
- **Partner banner**: the one exception to shipping no third-party pictures. Sculk, a server host,
|
||||
sponsors Horizon: its banner (`launcher/assets/sculk-banner.webp`, `launcher/src/partner.rs`) sits
|
||||
under a muted mono "Partner" label at the end of the Servers page and of Home, below Play, and opens
|
||||
Sculk's page in the browser. The website shows the same banner the same way on Home and the hosting
|
||||
docs, as a `rel="sponsored"` link.
|
||||
- **Pixel art drawn in code.** The stone behind the pages is close shades of the page colour
|
||||
(`TILE_SHADES`), never Minecraft's stone; the landscape is a banded sky, a sun cut in slices like
|
||||
the mark, hills and square trees (a sunset in dark, a dawn in light). The launcher bakes them in
|
||||
`launcher/src/art.rs` at the window's scale so each texel covers whole device pixels; the website
|
||||
draws them in `website/scripts/art.mjs`.
|
||||
draws them in its `scripts/art.mjs`.
|
||||
- **Icons**: Pixelarticons (MIT), 24 unit pixel SVGs in `crates/horizon-theme/icons/pixel/`, tinted
|
||||
with the text colour.
|
||||
- **Contrast**: every text colour meets WCAG AA (4.5:1) on the panels, the page and the lightest
|
||||
|
||||
+4
-2
@@ -21,14 +21,16 @@ Every row has a one-line description and its cost in frame time (none, low, medi
|
||||
| Quality | smooth lighting, mipmap levels, biome blend, clouds, cloud distance, weather radius, particles, entity shadows, cutout leaves | `options.txt` |
|
||||
| | sky, fog, weather, animated textures | `horizon-graphics.txt` |
|
||||
| Display | FOV, max framerate, VSync, fullscreen, GUI scale | `options.txt` |
|
||||
| | resolution scale, anti-aliasing (FXAA), present mode, frame pacing | `horizon-graphics.txt` |
|
||||
| | resolution scale, anti-aliasing (FXAA), HDR, paper white, peak brightness, present mode, frame pacing | `horizon-graphics.txt` |
|
||||
| Performance | battery mode, worker threads, upload budget per frame | `horizon-graphics.txt` |
|
||||
| Overlay | performance overlay: FPS, frame/CPU/GPU times, frame-time graph | `horizon-graphics.txt` |
|
||||
|
||||
`options.txt` keeps exactly vanilla's keys and values, so the options harness still compares it with vanilla; Horizon's settings live in `horizon-graphics.txt` beside it. Their defaults render as vanilla does: cave culling on, no upload budgets, sky, fog and weather on, 100% resolution, no FXAA, the present mode following VSync. VSync on always waits for the display (Fifo), in a window and in fullscreen, as in vanilla; the present mode setting chooses how frames are shown only while VSync is off. Frame pacing defaults to Efficient: the limiter sleeps through the last half millisecond where vanilla spins, which changes timing, not pixels.
|
||||
`options.txt` keeps exactly vanilla's keys and values, so the options harness still compares it with vanilla; Horizon's settings live in `horizon-graphics.txt` beside it. Their defaults render as vanilla does: cave culling on, no upload budgets, sky, fog and weather on, 100% resolution, no FXAA, HDR off, the present mode following VSync. VSync on always waits for the display (Fifo), in a window and in fullscreen, as in vanilla; the present mode setting chooses how frames are shown only while VSync is off. Frame pacing defaults to Efficient: the limiter sleeps through the last half millisecond where vanilla spins, which changes timing, not pixels.
|
||||
|
||||
**Battery mode** (Performance, off by default) is for laptops and handhelds: at most 60 frames per second in a world, 30 in menus without a world or while another window has focus, and half the automatic worker threads (chunks load slower). It changes only when frames are drawn: what they show and the game's 20 ticks per second stay as they are.
|
||||
|
||||
**HDR** (Display, off by default) presents to an scRGB swapchain (`Rgba16Float`, extended linear sRGB) on displays and compositors that offer it. The frame is drawn exactly as in SDR, in vanilla's gamma space, and a last pass (`hdr.wgsl`) decodes it to linear light at the **Paper White** and lifts light sources (blocks that emit light, lava, the sun and the moon) towards the **Peak Brightness**; everything else stays as in SDR. The mesher puts the light a block's face emits in its vertex colour's alpha (`EMISSION_BITS`), the frame's alpha carries the mark, and only pixels that still show the world before the hand and HUD are lifted. On Vulkan, `horizon-hdr` sends HDR metadata (MaxCLL, mastering luminance), which wgpu doesn't: without it a compositor may clip everything above SDR white. KWin maps the content's reference white onto the desktop's SDR brightness, so on Linux the default Paper White matches SDR mode. `HORIZON_HDR_DEBUG=1` paints lifted pixels magenta. Not lifted yet: glowing particles, distant LOD terrain.
|
||||
|
||||
Which settings each screen shows, their descriptions and costs are in `crates/horizon-client/src/graphics_ui.rs` (`rows`); `graphics_style.rs` draws them.
|
||||
|
||||
## Distant terrain
|
||||
|
||||
@@ -132,11 +132,11 @@ 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.
|
||||
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, proxy http://host:port ("default" removes it).
|
||||
|
||||
horizon-launcher settings [KEY] [VALUE]
|
||||
|
||||
- `KEY` (selected-version, minecraft-dir, server-dir, install-new-versions, opening-animation)
|
||||
- `KEY` (selected-version, minecraft-dir, server-dir, install-new-versions, opening-animation, proxy)
|
||||
- `VALUE`: The new value (with KEY)
|
||||
|
||||
MCP: `settings`.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<!doctype html>
|
||||
<!-- README banner (docs/media/banner.webp), 1600x480, in the design of docs/design-system.md.
|
||||
Rendered with Playwright from website/ (see docs/media/brand/README.md). -->
|
||||
Rendered with Playwright (see docs/media/brand/README.md). -->
|
||||
<meta charset="utf-8"><style>
|
||||
@font-face{font-family:Geist;src:url(../../website/public/fonts/Geist-Regular.woff2);font-weight:400}
|
||||
@font-face{font-family:Geist;src:url(../../website/public/fonts/Geist-Medium.woff2);font-weight:500}
|
||||
@font-face{font-family:"Geist Mono";src:url(../../website/public/fonts/GeistMono-Regular.woff2)}
|
||||
@font-face{font-family:Geist;src:url(../../crates/horizon-theme/fonts/Geist-Regular.ttf);font-weight:400}
|
||||
@font-face{font-family:Geist;src:url(../../crates/horizon-theme/fonts/Geist-Medium.ttf);font-weight:500}
|
||||
@font-face{font-family:"Geist Mono";src:url(../../crates/horizon-theme/fonts/GeistMono-Regular.ttf)}
|
||||
html,body{margin:0;width:1600px;height:480px;overflow:hidden;background:#0d0e13;color:#ecedf3;font-family:Geist}
|
||||
main{position:relative;height:100%;padding:56px 72px;box-sizing:border-box}
|
||||
.top{display:flex;align-items:center;gap:12px;font-size:20px;font-weight:500}
|
||||
|
||||
@@ -26,16 +26,15 @@ places it in the design system; `candidates/` keeps the two alternatives that we
|
||||
| `packaging/icons/horizon.ico` | Windows: embedded in `horizon-client.exe`, its tools and `horizon-launcher.exe` as icon resource 1 (`build.rs` of each, Windows builds only) |
|
||||
| `packaging/icons/horizon.icns` | macOS: `Horizon.app/Contents/Resources/horizon.icns`, packaged with the .dmg by `packaging/macos/package.sh` |
|
||||
| `crates/horizon-theme/icons/horizon-64.png` | the game window's icon at run time (X11 and Windows title bars, `window::icon`) |
|
||||
| `website/public/favicon.svg`, `favicon-32.png`, `apple-touch-icon.png` | the website |
|
||||
| `web/favicon.svg`, `web/favicon-32.png`, `web/apple-touch-icon.png` | the website (its `npm run assets` copies them into its `public/`) |
|
||||
| `icon-1024.png`, `icon-macos-1024.png` | previews, store listings |
|
||||
| `social/github-avatar-500.png` | GitHub: the organisation or account avatar |
|
||||
|
||||
The page in `social/` is a screenshot, at their exact size, with Playwright from the
|
||||
website's dev dependencies:
|
||||
The page in `social/` is a screenshot, at their exact size, with Playwright, from the repository's root:
|
||||
|
||||
```sh
|
||||
cd website && npm install
|
||||
node -e 'const {chromium}=require("playwright");(async()=>{const b=await chromium.launch();for(const[f,w,h,o]of[["card",1280,640,"github-social-1280x640"]]){const p=await b.newPage({viewport:{width:w,height:h}});await p.goto("file://"+require("path").resolve("../docs/media/brand/social/"+f+".html"));await p.waitForTimeout(300);await p.screenshot({path:"../docs/media/brand/social/"+o+".png"})}await b.close()})()'
|
||||
d=$(mktemp -d) && npm install --prefix "$d" playwright && npx --prefix "$d" playwright install chromium
|
||||
NODE_PATH="$d/node_modules" node -e 'const {chromium}=require("playwright");(async()=>{const b=await chromium.launch();for(const[f,w,h,o]of[["card",1280,640,"github-social-1280x640"]]){const p=await b.newPage({viewport:{width:w,height:h}});await p.goto("file://"+require("path").resolve("docs/media/brand/social/"+f+".html"));await p.waitForTimeout(300);await p.screenshot({path:"docs/media/brand/social/"+o+".png"})}await b.close()})()'
|
||||
```
|
||||
|
||||
## Drawn in code
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!doctype html><meta charset=utf-8><style>
|
||||
@font-face{font-family:Geist;src:url(/home/ludovic/.t3/worktrees/horizon/t3-1a6cb6c4/website/public/fonts/Geist-Regular.woff2);font-weight:400}
|
||||
@font-face{font-family:Geist;src:url(/home/ludovic/.t3/worktrees/horizon/t3-1a6cb6c4/website/public/fonts/Geist-Medium.woff2);font-weight:500}
|
||||
@font-face{font-family:"Geist Mono";src:url(/home/ludovic/.t3/worktrees/horizon/t3-1a6cb6c4/website/public/fonts/GeistMono-Regular.woff2)}
|
||||
@font-face{font-family:Geist;src:url(../../../../crates/horizon-theme/fonts/Geist-Regular.ttf);font-weight:400}
|
||||
@font-face{font-family:Geist;src:url(../../../../crates/horizon-theme/fonts/Geist-Medium.ttf);font-weight:500}
|
||||
@font-face{font-family:"Geist Mono";src:url(../../../../crates/horizon-theme/fonts/GeistMono-Regular.ttf)}
|
||||
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#0d0e13;color:#ecedf3;font-family:Geist}
|
||||
.wrap{position:relative;height:100%;padding:var(--pad);box-sizing:border-box}
|
||||
.top{display:flex;align-items:center;gap:12px;font-size:var(--small);font-weight:500}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 733 B |
Binary file not shown.
|
After Width: | Height: | Size: 424 B |
@@ -0,0 +1,10 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<title>Horizon</title>
|
||||
<clipPath id="tile"><rect width="16" height="16" rx="3.5"/></clipPath>
|
||||
<g clip-path="url(#tile)">
|
||||
<rect width="16" height="16" fill="#16181f"/>
|
||||
<g fill="#ecedf3"><rect x="4" y="3" width="2" height="4"/><rect x="10" y="3" width="2" height="4"/></g>
|
||||
<g fill="#ecedf3" opacity=".36"><rect x="4" y="8" width="2" height="4"/><rect x="10" y="8" width="2" height="4"/></g>
|
||||
<rect y="7" width="16" height="1" fill="#9a86ff"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 537 B |
+58
-8
@@ -285,6 +285,7 @@ A step's parts happen in this order:
|
||||
| --- | --- |
|
||||
| `reload = true` | stops the mod and starts it again, as a rebuild does in the game: its memory starts over, its `storage` stays |
|
||||
| `title-screen = true` | no player and no clock until a step sets them |
|
||||
| `blocks = [{ x = 0, y = 63, z = 0, state = "minecraft:stone" }]` | server mods with `world`: those blocks of the Overworld, before the rest of the step (every other block is air, every biome the dimension's plainest: plains, nether wastes, the end) |
|
||||
| `player = { x = 3.0, ... }`, `clock = { day-time = 0 }` | changes those fields (`x y z yaw pitch health food dimension`, `game-time day-time`) |
|
||||
| `ticks = n`, `frames = n` | that many ticks (the game's tick counter and the clock move on), then frames 1/60 s apart |
|
||||
| `chat = "<Steve> hi"` | a chat line the player receives |
|
||||
@@ -310,6 +311,7 @@ checked:
|
||||
| `feedback = "..."`, `error = "..."` | the command's answer, shown plain or in red |
|
||||
| `panel = ["..."]`, `corner = "top-left"` | its HUD panel's lines (`[]`: no panel) and corner |
|
||||
| `told = ["Alex: Welcome!"]`, `broadcast = ["..."]` | server mods: every `players.tell` (as `name: text`) and `players.broadcast`, in order |
|
||||
| `blocks = [{ x = 2, y = 64, z = 0, state = "minecraft:glowstone" }]` | server mods with `world`: those blocks of the Overworld after the step, the mod's `set-blocks` made (the script checks a state's shape; the game checks its name) |
|
||||
| `stopped = "panic"` | the mod was turned off, for a reason holding this text; without it, a mod that traps, panics or overruns fails the test |
|
||||
|
||||
Unknown keys are errors, so a typo never passes silently. The same runner is
|
||||
@@ -478,6 +480,7 @@ its component targets the WIT world `horizon-server-mod` instead of
|
||||
| `log` | always | as for client mods |
|
||||
| `storage` | `storage` | as for client mods, in the server's `horizon-mods/` |
|
||||
| `players` | `players` | `online()`: id, name, position, dimension, game mode, health of each player on; `tell(id, text)`, `broadcast(text)`: system messages after the mod's name, 8 per call |
|
||||
| `world` | `world` | `get-block(dimension, x, y, z)`: the state in a loaded chunk, `minecraft:oak_log[axis=y]`; `get-biome(dimension, x, y, z)`: `minecraft:plains`, ...; `set-blocks(dimension, changes)`: up to 4096 per call, checked at once, made as `/setblock` makes them (neighbours, light, block entities, every player told) after the call, before that dimension's next tick |
|
||||
|
||||
| Hook (export `server-events`) | When |
|
||||
|---|---|
|
||||
@@ -491,10 +494,53 @@ its component targets the WIT world `horizon-server-mod` instead of
|
||||
Capabilities that act on a local player (`game-read`, `chat`, `hud`) are for
|
||||
client mods; `players` is for server mods. In Rust: `impl
|
||||
horizon_mod_sdk::server::ServerMod` and `export_server_mod!`; the example is
|
||||
[`welcome`](../crates/horizon-mod-sdk/examples/welcome/src/lib.rs). The
|
||||
runtime, the registry's `check` and the SDK run them today; the game starts
|
||||
them once its server code calls these hooks (the next step), and until then a
|
||||
server mod that is turned on shows as run elsewhere.
|
||||
[`welcome`](../crates/horizon-mod-sdk/examples/welcome/src/lib.rs), and with
|
||||
`world`, [`beacons`](../crates/horizon-mod-sdk/examples/beacons/src/lib.rs).
|
||||
|
||||
**Capability `world`.** Reads are of the server's loaded chunks as they are
|
||||
during the call: the game lends a server mod's call the levels' chunk maps
|
||||
(moved, not copied, and only while a running mod has `world`), so a read
|
||||
costs a map lookup and no copy of the world. A dimension with no chunk loaded
|
||||
at a position reads as none. Writes go through the same code as `/setblock`,
|
||||
so block updates, light, block entities and every client (LAN guests,
|
||||
dedicated server players) see them as vanilla's; the parity harnesses test
|
||||
that code. Changes for a dimension whose level isn't ticking wait for it
|
||||
(in-frame single player ticks only the player's), up to 65,536 blocks; a
|
||||
change in a chunk that isn't loaded when it is made is skipped, as `/setblock`
|
||||
refuses one.
|
||||
|
||||
**Where they run.** The game that simulates the world starts the server mods
|
||||
that are on, and only that one:
|
||||
|
||||
| Mode | Runs server mods | Players they see |
|
||||
|---|---|---|
|
||||
| Single player (default) | the server thread | the window's player, a connection like any other |
|
||||
| Single player `--in-frame` | the window's own game, beside its client mods | the window's player |
|
||||
| Open to LAN, Play with Friends | the host's server thread (or its window, in-frame) | the host and every guest |
|
||||
| Dedicated server (`--dedicated`, `horizon-server`) | the server | every connected player |
|
||||
|
||||
A window that is a client of a server (single player's window, a LAN guest,
|
||||
any multiplayer server) never runs them; its Mods page lists a server mod with
|
||||
the others, and its switch takes effect the next time a world opens. The mods
|
||||
live in `horizon-mods/` of the game folder, or of the server's folder on a
|
||||
dedicated server, and are turned on as client mods are: Options > Mods, or
|
||||
`mod.<id>:true` in `horizon-mods.txt`. `--dev-mod <file>` runs one always
|
||||
on and reloads it when its file changes, on a server too.
|
||||
|
||||
**When hooks run.** At the end of each server tick the game tells the server
|
||||
mods who joined and who left since the last one, then what players said,
|
||||
broke and placed, in order, then calls `tick`. A command a player types
|
||||
reaches its mod at once, whatever the player's permission level, and its
|
||||
answer goes to that player. `tell` reaches one player, the window's own
|
||||
chat for the in-frame player and a system message for a connection;
|
||||
`broadcast` reaches every player and the server's log. With no server mod
|
||||
on, each of these points costs one branch (measured in the PR that added
|
||||
them).
|
||||
|
||||
**Not yet.** Clients aren't sent server mods' commands with vanilla's
|
||||
command tree, so a player's chat box doesn't complete or colour them; typing
|
||||
them works. Block events are a player's own breaking and placing, not
|
||||
explosions, pistons or other mods.
|
||||
|
||||
## Publish your mod
|
||||
|
||||
@@ -515,6 +561,10 @@ published. Players find them at [playhorizon.dev/mods](https://playhorizon.dev/m
|
||||
5. A reviewer merges it: within minutes the file is a release of horizon-mods, and the project is on the site and in
|
||||
the launcher.
|
||||
|
||||
Once it is published, its page and its card in the launcher show its downloads (GitHub's counts of its files,
|
||||
refreshed every hour) and its rating: players signed in with GitHub on its page give it 1 to 5 stars, one rating per
|
||||
account, which they can change. Its owners can't rate it, and nobody sees who rated.
|
||||
|
||||
An update is the same form with a new version; only the project's `owners` can publish one, signed with its key if it
|
||||
has one. A published file never changes. Without the form, open the pull request by hand (the repository's README
|
||||
says how). The formats: [api/mod-index.md](api/mod-index.md).
|
||||
@@ -561,10 +611,10 @@ so the same rustc and `Cargo.lock` give the same file.
|
||||
in single player and on any server, vanilla or Horizon. They see only what
|
||||
the client already knows (the snapshot), like F3 does, and act only on the
|
||||
local screen and chat. A server cannot see them.
|
||||
- **Server mods** (`side = "server"`) will run where the world is simulated:
|
||||
Horizon's integrated server in single player and LAN, and the dedicated
|
||||
server. Vanilla clients can join if the mod only uses vanilla content
|
||||
(rules, commands, events).
|
||||
- **Server mods** (`side = "server"`, API 0.3) run where the world is
|
||||
simulated: single player's server thread (or the window, in-frame), a LAN
|
||||
host and the dedicated server ([Server mods](#server-mods-api-03-experimental)).
|
||||
They use only vanilla messages, so any client, vanilla or Horizon, can join.
|
||||
- **Both** (`side = "both"`): a server mod with a client half (new blocks,
|
||||
their textures, a custom screen). On join the Horizon server announces its
|
||||
mods (id, version, SHA-256) on a `horizon:mods` custom payload channel; a
|
||||
|
||||
@@ -13,7 +13,7 @@ python3 tools/parity.py --failed # the ones that failed last time
|
||||
python3 tools/parity.py --all # everything, from scratch: the audit (26 minutes on the Mac mini alone)
|
||||
python3 tools/parity.py --fresh food # don't reuse vanilla oracle results
|
||||
python3 tools/parity.py --repeat 3 food # run it three times; the runs must agree
|
||||
python3 tools/parity.py --hosts macmini,thinkpad # with other machines (default: tools/parity_hosts.json's default list, empty)
|
||||
python3 tools/parity.py --hosts macmini,playhorizon # with other machines (default: tools/parity_hosts.json's default list, empty)
|
||||
python3 tools/parity.py --list # what would run
|
||||
python3 tools/parity.py --status # last result of each harness
|
||||
python3 tools/parity.py --changed origin/main # those a branch's changes can affect (CI's parity job)
|
||||
@@ -40,9 +40,9 @@ The game logs into `HORIZON_HOME` and falls back to the player's own game folder
|
||||
|
||||
### Other machines
|
||||
|
||||
Harnesses can also run on the Mac mini, the ThinkPad and the desktop (`tools/parity_hosts.json` describes them; `desktop` uses its CI runner's environment and vanilla data, and refuses work, or stops it, while someone uses it: docs/release-flow.md, "The desktop's runner"; its `default` list is empty, so pass `--hosts macmini,thinkpad` or set `PARITY_HOSTS`, after copying `shared-local/` to `~/code/horizon-parity/shared-local` on each host). The runner mirrors the worktree there with rsync (not `.git`, `.local`, `target` or ignored files) into `~/code/horizon-parity/remote/<host><path>`, whose `.local` links to the vanilla data in `~/code/horizon-parity/shared-local`, and starts `tools/parity.py --worker` over ssh. The worker builds the probes (about 80 s the first time) and runs what it is sent under the same tracer, admitting harnesses against its own free memory. One queue, longest first, feeds every machine, remote ones first: the Mac takes up to 14 harnesses, the desktop 8. Each pass comes back with the content hash of every file it depended on, so it is keyed on exactly what ran, and logs come back to `.local/parity-runner/logs/`; state, sharing and `gate.py` work as before. If a host can't be reached, or drops out, its harnesses run here.
|
||||
Harnesses can also run on the Mac mini, the desktop and playhorizon (`tools/parity_hosts.json` describes them; `desktop` and `playhorizon` use their CI runner's environment and vanilla data, and the desktop refuses work, or stops it, while someone uses it: docs/release-flow.md, "The desktop's runner"; its `default` list is empty, so pass `--hosts macmini,playhorizon` or set `PARITY_HOSTS`, after copying `shared-local/` to `~/code/horizon-parity/shared-local` on each host). The runner mirrors the worktree there with rsync (not `.git`, `.local`, `target` or ignored files) into `~/code/horizon-parity/remote/<host><path>`, whose `.local` links to the vanilla data in `~/code/horizon-parity/shared-local`, and starts `tools/parity.py --worker` over ssh. The worker builds the probes (about 80 s the first time) and runs what it is sent under the same tracer, admitting harnesses against its own free memory. One queue, longest first, feeds every machine, remote ones first: the Mac takes up to 14 harnesses, the desktop 8, playhorizon 6. Each pass comes back with the content hash of every file it depended on, so it is keyed on exactly what ran, and logs come back to `.local/parity-runner/logs/`; state, sharing and `gate.py` work as before. If a host can't be reached, or drops out, its harnesses run here.
|
||||
|
||||
Harnesses a host can't run are listed in the file: `local_only` (`save_roundtrip` runs the game on a virtual screen) and each host's `exclude`. The Mac excludes nothing: vanilla's `Math.sin`, `pow`, `log` and the like don't round the same on an Apple silicon Mac as on Linux (HotSpot uses fdlibm there, Intel's stubs on x86-64), and Rust's float functions round like neither (they call the platform libm), so code that mirrors a vanilla `Math` call uses `horizon_core::jmath`, which computes what HotSpot computes on the host architecture. The ThinkPad helps too, gently: Linux, 2 harnesses at `nice 19`, since it hosts the Claude account pool; it finds ALSA through `~/code/horizon-parity/alsa-dev` like the desktop.
|
||||
Harnesses a host can't run are listed in the file: `local_only` (`save_roundtrip` runs the game on a virtual screen) and each host's `exclude`. The Mac excludes nothing: vanilla's `Math.sin`, `pow`, `log` and the like don't round the same on an Apple silicon Mac as on Linux (HotSpot uses fdlibm there, Intel's stubs on x86-64), and Rust's float functions round like neither (they call the platform libm), so code that mirrors a vanilla `Math` call uses `horizon_core::jmath`, which computes what HotSpot computes on the host architecture. The ThinkPad no longer runs harnesses (2026-10-26): playhorizon is the Linux host that is always on.
|
||||
|
||||
### Shards and Rust scopes
|
||||
|
||||
|
||||
+11
-2
@@ -28,12 +28,12 @@ The job is `.github/workflows/parity.yml`, a reusable workflow: `checks` calls i
|
||||
repository, `run-parity.yml` for a fork's pull request a maintainer labels `run-parity`.
|
||||
|
||||
Horizon never downloads the game, so harnesses that compare with vanilla run only where the maintainer's own
|
||||
copy is: the Mac mini and his Linux desktop. Their runners run as the maintainer's account and keep their checkout
|
||||
copy is: the Mac mini, his Linux desktop and playhorizon (below). Their runners run as the maintainer's account and keep their checkout
|
||||
between runs (`clean: false`), so the probes build incrementally into `.local/parity-target` and earlier passes
|
||||
stand.
|
||||
|
||||
1. `tools/ci/runner-env.sh` puts the machine's Python 3.13 and the JDK `research-lock.json` pins on the PATH
|
||||
(Homebrew and `java_home` on the Mac; on NixOS what `linux-runner.sh` pinned, else nixpkgs), and sccache when
|
||||
(Homebrew and `java_home` on the Mac; on Linux what `linux-runner.sh` pinned, else nixpkgs), and sccache when
|
||||
the machine has it.
|
||||
2. `tools/ci/vanilla-data.sh` links `.local/` to the runner's copy of the vanilla data, cloned once from
|
||||
`~/code/horizon-parity/shared-local` into `~/.actions-runners/horizon/_work/horizon/shared-local`, and
|
||||
@@ -94,6 +94,15 @@ same. The nightly audit and parity-main stay on the Mac mini's runners: the audi
|
||||
so it stays on one platform, and a parity-main job slowed down on the desktop because he came back could time out,
|
||||
and its failures bisect and comment on merges.
|
||||
|
||||
**playhorizon's runner.** `playhorizon-horizon` runs on a server a hosting partner lends the project (Ubuntu, 8
|
||||
AMD EPYC threads, 30 GB, in Detroit; reachable only through the maintainer's tailnet). Nobody sits at it, so the
|
||||
watcher never pauses it except by hand, and it gets the machine: `RUNNER_CPUS=7 RUNNER_MEMORY=24 RUNNER_JOBS=6`.
|
||||
Without Nix, `linux-runner.sh` takes the build libraries, the JDK, sccache, Xvfb and Mesa's software Vulkan
|
||||
(lavapipe; there is no GPU) from apt, and Python 3.13 from uv. The partner can reach the machine, so gh is not
|
||||
logged in there: the registration token comes from another machine (`RUNNER_TOKEN`), and no job with secrets may
|
||||
run there (parity has none). It is also a parity host (`playhorizon` in `tools/parity_hosts.json`, 6 jobs). Like
|
||||
the desktop's, it gets the `horizon-game` label only once a full trial has passed there.
|
||||
|
||||
## Merging
|
||||
|
||||
Pull requests merge with a merge commit. The orchestrator sessions review a pull request, then turn on
|
||||
|
||||
+7
-7
@@ -13,9 +13,8 @@ Horizon's own format.
|
||||
| Authoring tool | `horizon-shader` (same crate) | `new`, `check`, `pack` |
|
||||
| Templates | `crates/horizon-shader-api/templates/` | post, sky, material |
|
||||
| Example pack | `crates/horizon-shader-api/packs/golden_hour` | a warm sky and two post passes |
|
||||
| In the game: the sky and post stages | Options > Horizon Settings > Shader Packs | sky, post passes, hot reload |
|
||||
| In the game: every stage | Options > Horizon Settings > Shader Packs | sky, material, post passes, hot reload |
|
||||
| The registry and the launcher | `shader` kind ([api/mod-index.md](api/mod-index.md)); the Mods page's Shader packs tab | checked, then installed into `shaderpacks/` |
|
||||
| In the game: the material stage | | not yet |
|
||||
|
||||
## Quick start
|
||||
|
||||
@@ -53,8 +52,7 @@ it on Options > Horizon Settings > Shader Packs, which lists Horizon's packs, ma
|
||||
name>` runs a pack whatever the page says, for development. The game checks the pack first, and refuses one that
|
||||
fails, with its problems in the chat. While it runs, the game looks at the pack twice a second: save a file
|
||||
and the pack is checked and rebuilt in place ("Shader pack ... reloaded"); if the new version fails, the chat says
|
||||
where and the last good version keeps drawing. The sky and post stages run today; the material stage is checked but
|
||||
not drawn yet.
|
||||
where and the last good version keeps drawing. All three stages run.
|
||||
|
||||
## A pack
|
||||
|
||||
@@ -90,7 +88,7 @@ by Horizon: a pack changes how things look, not how they are drawn.
|
||||
| Stage | Your function | What it does |
|
||||
| --- | --- | --- |
|
||||
| `[sky]` | `fn sky(input: SkyInput) -> vec4<f32>` | the sky's colour along each view ray, opaque (alpha is ignored), drawn where vanilla draws its sky dome (the Overworld's sky; not the Nether's or the End's); the sun, moon, stars and clouds are drawn over it |
|
||||
| `[material]` | `fn material(input: MaterialInput) -> Surface` | the lit colour of each point of a block's surface, before the alpha test and fog |
|
||||
| `[material]` | `fn material(input: MaterialInput) -> Surface` | the lit colour of each point of a block's surface, before the alpha test and fog: every terrain section and distant tile, solid, cutout and translucent (not entities, block entities or particles) |
|
||||
| `[[post]]` | `fn post(input: PostInput) -> vec4<f32>` | a full-screen pass over the world's picture (up to 8, in order), under the hand and HUD |
|
||||
|
||||
A pack has at least one stage; a stage it leaves out keeps vanilla's look. Each input says what vanilla would draw
|
||||
@@ -133,8 +131,10 @@ one keeps drawing), the launcher before it installs one, and the registry's CI b
|
||||
`[budget] gpu_ms` is the GPU time your pack aims to add to a frame. To compare, open F3 in the game: while it is
|
||||
open, each pass is timed on the GPU and the overlay shows the pack's total and its costliest passes, by their `name`
|
||||
(the median of the last 15 timed frames). Timing waits for nothing, so it does not slow the game. In a timed frame the sky
|
||||
stage draws in a pass of its own (it shares the world's pass otherwise), so its time includes clearing the picture.
|
||||
stage draws in a pass of its own (it shares the world's pass otherwise), so its time includes clearing the picture. The
|
||||
material stage runs inside terrain's own draws, so it has no time of its own: compare the frame's GPU time with and
|
||||
without the pack.
|
||||
|
||||
## Next
|
||||
|
||||
The material stage in the game.
|
||||
The overlay, lighting and shadow stages, and option values other than the defaults.
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ The launcher reads it when it opens and every minute after, and shows "N playing
|
||||
- `GET /v1/benchmarks/summary`: players' benchmark uploads grouped by GPU, CPU, render distance and game for playhorizon.dev/benchmarks. A group shows only with at least 3 different installs, and only its medians and counts: no install ID, day, OS version, driver, exact memory or screen. Uploads are never published one by one. Each group's `breakdowns` count its installs per hardware class.
|
||||
- `POST /v1/live` and `GET /v1/live`: the "I'm playing" ping and the live count.
|
||||
|
||||
Public output never holds a raw hardware value, only these classes (`src/classes.rs`, the same in `website/scripts/benchmarks.mjs`), and a class is published only with at least 3 different installs:
|
||||
Public output never holds a raw hardware value, only these classes (`src/classes.rs`, the same in the website's `scripts/benchmarks.mjs`, ludovic111/horizon-site), and a class is published only with at least 3 different installs:
|
||||
|
||||
| Breakdown | Classes |
|
||||
|---|---|
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ A tag is a 0.2 tag when it is `v` or `launcher@` followed by exactly three numbe
|
||||
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`) and
|
||||
`website/src/versions.js`.
|
||||
the website's `src/versions.js` (ludovic111/horizon-site).
|
||||
|
||||
## The workflows
|
||||
|
||||
|
||||
Reference in New Issue
Block a user