[PR #4461] [MERGED] Game started without its files: a launcher screen, not a crash #5639

Closed
opened 2026-11-03 05:13:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/standalone-start-no-resources


📝 Commits (1)

  • e6f5246 Game started without its files: a launcher screen, not a crash

📊 Changes

6 files changed (+476 additions, -19 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+23 -12)
➕ crates/horizon-client/src/game/no_resources.rs (+167 -0)
📝 crates/horizon-client/src/game/startup_menu.rs (+5 -4)
📝 crates/horizon-client/src/lib.rs (+1 -0)
➕ crates/horizon-client/src/no_resources.rs (+278 -0)
📝 packaging/PLAY.txt (+2 -3)

📄 Description

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

A player (2026-10-30, Windows 11, v0.2.97) ran horizon.exe straight from the extracted game zip, thinking it was the launcher. The window stayed white, then the game quit with resource loader stopped before finishing and a crash report.

Why the message had no reason (v0.2.97). Without prepared files the loader returned an error and sent Done(Err(..)). App::about_to_wait took that result to end loading, but the event loop polled once more after exit(). By then the loader had ended, its channel was closed and the join was Ok, so poll_menu_resources replaced the real error with a message that had no reason. Main fixed this on 10-29 (9f28fe890, #3597, not in v0.2.97), which also checks horizon-resources.json before any window opens. That check still ended in an error and a crash report, and the player saw no window.

What this PR changes

  • An interactive game with no prepared files (no --resources, nothing in resources/ beside the program or in .local/) now opens a window instead of crashing (no_resources.rs in the lib, plus the winit app in game/no_resources.rs). The window uses Horizon's design system with the bundled Geist fonts, so it needs none of Minecraft's files. It says:

    • start Horizon from the launcher;
    • Horizon needs your own Minecraft: Java Edition, and the launcher signs you in and prepares the game files.

    It has two buttons: Download the launcher (opens https://playhorizon.dev) and Quit. Esc, Quit and the close button all exit with code 0 and no crash report. The console prints the same message, with the folder it looked in and a line for developers.

  • Offscreen, scripted, horizon-ctl and server runs keep the error, unchanged.

  • The "playing now" heartbeat and the servers.dat write now wait until the files are found. Before, a game that couldn't start wrote servers.dat into the zip folder.

  • If the loader's channel ever closes without a result, the error now always gives the reason: the panic text, "it returned without a result" or "no loader thread was running".

  • packaging/PLAY.txt now sends players to playhorizon.dev for the launcher. It used to point to the GitHub launcher releases.

  • The launcher's way of starting the game is unchanged: it always passes --resources.

Tested on the Mac mini. I ran the fast build in an empty scratch folder with isolated HORIZON_HOME and XDG folders and no --resources:

  • the window appears (screenshot below);
  • clicking Quit (a real CGEvent) gives exit code 0 and no crash-reports/;
  • closing it with the window's close button also gives exit code 0 and no report.

I found one bug while testing and fixed it: the first frame is often not shown, and the glyphs it rasterized never reached the atlas, so the text was missing. The screen now redraws them when a frame isn't shown.

Window (1040×700): title "Start Horizon from the launcher", three short paragraphs, the accent button "Download the launcher" and "Quit", and in small text the folder it looked in.

Release notes and asset labels are in a separate PR (#4455, skip-release).

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 04976d95e, 2 min 29 s)

Check Result
Scope ✅ 6 files, +476 −19
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 480 passed (56 s)
rustfmt ✅ (4 s)
clippy ✅ (45 s)
tests: horizon-client ✅ 1041 passed (39 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 128 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_tint, block_transformer, breaking_model and 116 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The harnesses go to CI: the change sits in run() before any resource loads, and only fires when horizon-resources.json is missing, which never happens in a harness run.

🤖 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/4461 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/standalone-start-no-resources` --- ### 📝 Commits (1) - [`e6f5246`](https://github.com/horizon-rust/horizon/commit/e6f5246fdf9980c8d3aa3633106798ea37af3a51) Game started without its files: a launcher screen, not a crash ### 📊 Changes **6 files changed** (+476 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+23 -12) ➕ `crates/horizon-client/src/game/no_resources.rs` (+167 -0) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+5 -4) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) ➕ `crates/horizon-client/src/no_resources.rs` (+278 -0) 📝 `packaging/PLAY.txt` (+2 -3) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. A player (2026-10-30, Windows 11, v0.2.97) ran `horizon.exe` straight from the extracted game zip, thinking it was the launcher. The window stayed white, then the game quit with `resource loader stopped before finishing` and a crash report. **Why the message had no reason (v0.2.97).** Without prepared files the loader returned an error and sent `Done(Err(..))`. `App::about_to_wait` took that result to end loading, but the event loop polled once more after `exit()`. By then the loader had ended, its channel was closed and the join was `Ok`, so `poll_menu_resources` replaced the real error with a message that had no reason. Main fixed this on 10-29 (9f28fe890, #3597, not in v0.2.97), which also checks `horizon-resources.json` before any window opens. That check still ended in an error and a crash report, and the player saw no window. **What this PR changes** - An interactive game with no prepared files (no `--resources`, nothing in `resources/` beside the program or in `.local/`) now opens a window instead of crashing (`no_resources.rs` in the lib, plus the winit app in `game/no_resources.rs`). The window uses Horizon's design system with the bundled Geist fonts, so it needs none of Minecraft's files. It says: - start Horizon from the launcher; - Horizon needs your own Minecraft: Java Edition, and the launcher signs you in and prepares the game files. It has two buttons: **Download the launcher** (opens https://playhorizon.dev) and **Quit**. Esc, Quit and the close button all exit with code 0 and no crash report. The console prints the same message, with the folder it looked in and a line for developers. - Offscreen, scripted, horizon-ctl and server runs keep the error, unchanged. - The "playing now" heartbeat and the `servers.dat` write now wait until the files are found. Before, a game that couldn't start wrote `servers.dat` into the zip folder. - If the loader's channel ever closes without a result, the error now always gives the reason: the panic text, "it returned without a result" or "no loader thread was running". - `packaging/PLAY.txt` now sends players to playhorizon.dev for the launcher. It used to point to the GitHub launcher releases. - The launcher's way of starting the game is unchanged: it always passes `--resources`. **Tested on the Mac mini.** I ran the fast build in an empty scratch folder with isolated `HORIZON_HOME` and XDG folders and no `--resources`: - the window appears (screenshot below); - clicking Quit (a real CGEvent) gives exit code 0 and no `crash-reports/`; - closing it with the window's close button also gives exit code 0 and no report. I found one bug while testing and fixed it: the first frame is often not shown, and the glyphs it rasterized never reached the atlas, so the text was missing. The screen now redraws them when a frame isn't shown. Window (1040×700): title "Start Horizon from the launcher", three short paragraphs, the accent button "Download the launcher" and "Quit", and in small text the folder it looked in. Release notes and asset labels are in a separate PR (#4455, `skip-release`). **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 04976d95e, 2 min 29 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +476 −19 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 480 passed (56 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (45 s) | | tests: horizon-client | ✅ 1041 passed (39 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 128 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_tint, block_transformer, breaking_model and 116 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The harnesses go to CI: the change sits in `run()` before any resource loads, and only fires when `horizon-resources.json` is missing, which never happens in a harness run. 🤖 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 05:13:59 +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#5639
No description provided.