[PR #1215] [MERGED] Credits and end poem (WinScreen) #3429

Closed
opened 2026-11-03 04:09:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1215
Author: @ludovic111
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @ludovic111

Base: main ← Head: feat/win-screen


📝 Commits (6)

  • 4e45a3b Credits and end poem (WinScreen)
  • 3ce3fe0 Merge origin/main into feat/win-screen
  • 9f54087 Win screen: cover main's menu-blur match (Screen::Win)
  • 906d02f Merge origin/main into feat/win-screen
  • 3f58e51 Options test: Credits & Attribution follows Horizon's two buttons
  • b75370c Merge remote-tracking branch 'origin/main' into m1215

📊 Changes

17 files changed (+997 additions, -22 deletions)

View changed files

📝 crates/horizon-client/src/font.rs (+71 -0)
📝 crates/horizon-client/src/game.rs (+28 -5)
📝 crates/horizon-client/src/game/agent.rs (+1 -0)
📝 crates/horizon-client/src/game/control.rs (+25 -0)
📝 crates/horizon-client/src/game/end.rs (+4 -1)
📝 crates/horizon-client/src/game/music.rs (+6 -2)
📝 crates/horizon-client/src/game/options.rs (+1 -0)
📝 crates/horizon-client/src/game/remote.rs (+4 -0)
📝 crates/horizon-client/src/game/screens.rs (+4 -0)
📝 crates/horizon-client/src/game/startup_menu.rs (+40 -0)
➕ crates/horizon-client/src/game/win.rs (+150 -0)
📝 crates/horizon-client/src/hud.rs (+98 -10)
📝 crates/horizon-client/src/hud.wgsl (+50 -1)
📝 crates/horizon-client/src/lib.rs (+1 -0)
📝 crates/horizon-client/src/options_ui.rs (+58 -3)
📝 crates/horizon-client/src/save.rs (+4 -0)
➕ crates/horizon-client/src/win_screen.rs (+452 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

Horizon now has vanilla's WinScreen: the end poem, the credits and the post-credits text.

  • Leaving the End for the first time (the exit portal, EndPortalBlock.entityInside → ServerPlayer.showEndCredits) rolls the poem, then the credits. The player is out of the world while they roll and arrives in the Overworld afterwards. seenCredits is read from and saved to the player data, so later exits skip them. A server's WIN_GAME game event (4) opens the same screen and sends PERFORM_RESPAWN when it closes.
  • Options → Credits & Attribution is now a page (CreditsAndAttributionScreen layout). Its Credits button rolls the credits without the poem, both in game and from the title screen.
  • The texts come from the resource root (texts/end.txt, texts/credits.json, texts/postcredits.txt), so packs can replace them.
  • Vanilla's behaviour: PLAYERNAME replaced, the obfuscated §f§k§a§b names drawn from LegacyRandom(8124371), wrapping at 256, scroll speeds (poem 0.5, credits 0.75 px/tick), Space ×5 and +15 for each held Ctrl, Up reverses, Escape closes, the last line pinned mid-screen, the Minecraft logo and edition banner, the vignette (RenderPipelines.VIGNETTE blend), the End portal background for the poem and the scrolled menu background for the credits. The credits music plays, and the screen pauses the game only without the poem (isPauseScreen).
  • Obfuscated text (§k, "obfuscated": true) now draws a random glyph of the same width every frame (FontSet.getRandomGlyph). It was drawn plainly before.
  • horizon-ctl credits [poem] [SCROLL] and horizon-ctl options credits for testing.

Why

Fixes #338. Found by the resource pack audit (docs/resource-packs.md): the texts were never shown and Credits & Attribution opened nothing.

How tested

Screenshots: vanilla 26.3 (left, 854x480, GUI scale 2, taken by a small wrapper that opens the screen and holds the scroll) against Horizon (right, --offscreen 1280x720, GUI scale 3, downscaled), at the same scroll offsets:

Poem at scroll 300 / 760 / 950:
poem

The obfuscated names (different random glyphs every frame in both):
obfuscated

Credits at scroll 0 / 1500:
credits

Credits & Attribution:
credits and attribution

The lines, wrapping, centring, colours, logo and vignette match line for line. The only background difference is where the End portal's moving star layers are at that moment. At scroll 0 the credits haven't come up yet, so both frames show only the background and vignette.

In game (offscreen, horizon-ctl): setblock an end_portal in the End and step in. The screen became win, the dimension overworld, the player was held, and music.credits played. Escape spawned the player in the Overworld. A second exit went straight through, and the saved player .dat has seenCredits: 1b.

Unit tests (win_screen.rs, hud.rs): the poem's name replacement and scrambling, wrapping widths, credits centring and colours, key speeds, the finish condition, and obfuscated glyphs keeping their width.

Self-check (Mac mini, rebased on origin/main c16b41ab):

cargo fmt --all --check                                   ok
cargo clippy --workspace --all-targets -- -D warnings     ok (exit 0, pipefail)
cargo test -p horizon-client                              1110 passed, 0 failed
tools/parity.py --changed origin/main (branch, before the rebase onto c16b41ab)
                                                          101 passed, 1 failed: dedicated_server
                                                          ("play-pearl teleported 0 time(s)"), passed on rerun;
                                                          the known flake on main (FEATURES.md 4b(c), 4s)
tools/parity.py --changed origin/main (after the rebase, run on the #336 stack, which contains this branch)
                                                          102 passed, 0 failed (world_spawn rerun alone after a
                                                          machine restart cut the run)
tools/parity.py on main: --changed selects nothing there; the one failure above is the pearl flake known on main

Not done here (one line in horizon-parity FEATURES.md, 4v)

  • LAN guests leaving the End get no credits: the integrated server sends no WIN_GAME to guests. Single player and remote servers do get them.
  • Attribution and Licenses are shown inactive: vanilla opens minecraft.net pages through ConfirmLinkScreen, and Horizon opens no links.
  • Obfuscated text picks among the glyphs already in the atlas (the bitmap sheets and spaces), not every Unifont glyph. Unifont glyphs are rasterized on demand into a bounded atlas region that a line of obfuscated text would fill in seconds.

Nothing needs Ludovic.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1215 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/win-screen` --- ### 📝 Commits (6) - [`4e45a3b`](https://github.com/horizon-rust/horizon/commit/4e45a3bddfd2f0a3090d729ac95a02ab9d11a43e) Credits and end poem (WinScreen) - [`3ce3fe0`](https://github.com/horizon-rust/horizon/commit/3ce3fe03740f36c8ac689028ccc8dff16d1b2608) Merge origin/main into feat/win-screen - [`9f54087`](https://github.com/horizon-rust/horizon/commit/9f54087a8694a4d9b620240a93b29bad14020ef4) Win screen: cover main's menu-blur match (Screen::Win) - [`906d02f`](https://github.com/horizon-rust/horizon/commit/906d02fff36f7c3cc4b317bcac0d84d774e8d2dd) Merge origin/main into feat/win-screen - [`3f58e51`](https://github.com/horizon-rust/horizon/commit/3f58e512e091751e95046504842054768ac3f2d8) Options test: Credits & Attribution follows Horizon's two buttons - [`b75370c`](https://github.com/horizon-rust/horizon/commit/b75370cf2675e27775d233021c72106f67f1ec28) Merge remote-tracking branch 'origin/main' into m1215 ### 📊 Changes **17 files changed** (+997 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/font.rs` (+71 -0) 📝 `crates/horizon-client/src/game.rs` (+28 -5) 📝 `crates/horizon-client/src/game/agent.rs` (+1 -0) 📝 `crates/horizon-client/src/game/control.rs` (+25 -0) 📝 `crates/horizon-client/src/game/end.rs` (+4 -1) 📝 `crates/horizon-client/src/game/music.rs` (+6 -2) 📝 `crates/horizon-client/src/game/options.rs` (+1 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+4 -0) 📝 `crates/horizon-client/src/game/screens.rs` (+4 -0) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+40 -0) ➕ `crates/horizon-client/src/game/win.rs` (+150 -0) 📝 `crates/horizon-client/src/hud.rs` (+98 -10) 📝 `crates/horizon-client/src/hud.wgsl` (+50 -1) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) 📝 `crates/horizon-client/src/options_ui.rs` (+58 -3) 📝 `crates/horizon-client/src/save.rs` (+4 -0) ➕ `crates/horizon-client/src/win_screen.rs` (+452 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Horizon now has vanilla's `WinScreen`: the end poem, the credits and the post-credits text. - **Leaving the End for the first time** (the exit portal, `EndPortalBlock.entityInside` → `ServerPlayer.showEndCredits`) rolls the poem, then the credits. The player is out of the world while they roll and arrives in the Overworld afterwards. `seenCredits` is read from and saved to the player data, so later exits skip them. A server's `WIN_GAME` game event (4) opens the same screen and sends `PERFORM_RESPAWN` when it closes. - **Options → Credits & Attribution** is now a page (`CreditsAndAttributionScreen` layout). Its Credits button rolls the credits without the poem, both in game and from the title screen. - The texts come from the resource root (`texts/end.txt`, `texts/credits.json`, `texts/postcredits.txt`), so packs can replace them. - Vanilla's behaviour: `PLAYERNAME` replaced, the obfuscated `§f§k§a§b` names drawn from `LegacyRandom(8124371)`, wrapping at 256, scroll speeds (poem 0.5, credits 0.75 px/tick), Space ×5 and +15 for each held Ctrl, Up reverses, Escape closes, the last line pinned mid-screen, the Minecraft logo and edition banner, the vignette (`RenderPipelines.VIGNETTE` blend), the End portal background for the poem and the scrolled menu background for the credits. The credits music plays, and the screen pauses the game only without the poem (`isPauseScreen`). - Obfuscated text (`§k`, `"obfuscated": true`) now draws a random glyph of the same width every frame (`FontSet.getRandomGlyph`). It was drawn plainly before. - `horizon-ctl credits [poem] [SCROLL]` and `horizon-ctl options credits` for testing. ## Why Fixes #338. Found by the resource pack audit (docs/resource-packs.md): the texts were never shown and Credits & Attribution opened nothing. ## How tested Screenshots: vanilla 26.3 (left, 854x480, GUI scale 2, taken by a small wrapper that opens the screen and holds the scroll) against Horizon (right, `--offscreen` 1280x720, GUI scale 3, downscaled), at the same scroll offsets: Poem at scroll 300 / 760 / 950: ![poem](https://raw.githubusercontent.com/ludovic111/horizon/4b2b2085f436629de1bd75844453697a7e5dc9aa/338/cmp-poem.png) The obfuscated names (different random glyphs every frame in both): ![obfuscated](https://raw.githubusercontent.com/ludovic111/horizon/4b2b2085f436629de1bd75844453697a7e5dc9aa/338/cmp-poem-obf.png) Credits at scroll 0 / 1500: ![credits](https://raw.githubusercontent.com/ludovic111/horizon/4b2b2085f436629de1bd75844453697a7e5dc9aa/338/cmp-credits.png) Credits & Attribution: ![credits and attribution](https://raw.githubusercontent.com/ludovic111/horizon/4b2b2085f436629de1bd75844453697a7e5dc9aa/338/cmp-options.png) The lines, wrapping, centring, colours, logo and vignette match line for line. The only background difference is where the End portal's moving star layers are at that moment. At scroll 0 the credits haven't come up yet, so both frames show only the background and vignette. In game (offscreen, horizon-ctl): `setblock` an `end_portal` in the End and step in. The screen became `win`, the dimension `overworld`, the player was held, and `music.credits` played. Escape spawned the player in the Overworld. A second exit went straight through, and the saved player `.dat` has `seenCredits: 1b`. Unit tests (win_screen.rs, hud.rs): the poem's name replacement and scrambling, wrapping widths, credits centring and colours, key speeds, the finish condition, and obfuscated glyphs keeping their width. Self-check (Mac mini, rebased on origin/main c16b41ab): ``` cargo fmt --all --check ok cargo clippy --workspace --all-targets -- -D warnings ok (exit 0, pipefail) cargo test -p horizon-client 1110 passed, 0 failed tools/parity.py --changed origin/main (branch, before the rebase onto c16b41ab) 101 passed, 1 failed: dedicated_server ("play-pearl teleported 0 time(s)"), passed on rerun; the known flake on main (FEATURES.md 4b(c), 4s) tools/parity.py --changed origin/main (after the rebase, run on the #336 stack, which contains this branch) 102 passed, 0 failed (world_spawn rerun alone after a machine restart cut the run) tools/parity.py on main: --changed selects nothing there; the one failure above is the pearl flake known on main ``` ## Not done here (one line in horizon-parity FEATURES.md, 4v) - LAN guests leaving the End get no credits: the integrated server sends no `WIN_GAME` to guests. Single player and remote servers do get them. - Attribution and Licenses are shown inactive: vanilla opens minecraft.net pages through `ConfirmLinkScreen`, and Horizon opens no links. - Obfuscated text picks among the glyphs already in the atlas (the bitmap sheets and spaces), not every Unifont glyph. Unifont glyphs are rasterized on demand into a bounded atlas region that a line of obfuscated text would fill in seconds. Nothing needs Ludovic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:09:28 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3429
No description provided.