[PR #1112] [MERGED] Loading screen: fill the chunk map square by square, as vanilla #3057

Closed
opened 2026-11-02 16:01:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/loading-screen-square


📝 Commits (1)

  • 32a4828 Loading screen: fill the chunk map square by square, as vanilla

📊 Changes

2 files changed (+61 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -0)
📝 crates/horizon-client/src/streaming.rs (+58 -3)

📄 Description

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

Fixes #770 (reported on Discord by skills.issue).

What

The loading screen's chunk map grew as a disc, while vanilla's grows as a square. In vanilla, chunk tasks run by ticket level, and a ticket's level spreads one step per ring of chunks around it, diagonals included (Chebyshev distance). So LevelLoadingScreen's map (ChunkLoadStatusView) fills square rings around the spawn. Horizon picks the next chunks to generate by Euclidean distance, which draws a circle.

While the level loading screen is up (loading_reason() is some, not on a dedicated server), Streaming now orders its work ring by ring (Ranges::rings: Chebyshev ring first, then the squared distance inside a ring). Once the player is in the world, the order is the usual nearest first. Only the order changes: which chunks load and how they generate stay the same. Decoration keeps vanilla's replayed order (DecorationOrder), so the generated blocks are unchanged.

Screenshots

A new world (seed 12345), the last loading-screen frame before the player spawns, Mac mini, --offscreen + horizon-ctl screenshot in a loop:

main this PR
main this PR

The screen closes as soon as the player's 7x7 chunks are in (LevelLoadProgressTracker), so the outermost ring isn't finished in either shot. The front is a square now.

Checks

  • cargo fmt --all -- --check: clean.
  • cargo clippy -p horizon-client --all-targets -- -D warnings (with set -o pipefail): clean.
  • cargo test -p horizon-client: all pass, including the generation scan's differential tests and a new loading_goes_ring_by_ring (a ring's corner comes before the next ring's edge only while loading; nearest first within a ring; unchanged order otherwise).
  • tools/parity.py --changed origin/main: 142 harnesses depend on the four P4 branches (#996, #1037, #770 and this one); they ran once on the branches merged onto main ae21bd54 (Mac mini, --changed origin/main): all 142 pass, including chunk_generation (with the new comparison), decorated_region, structure_density, terrain, tree_feature, worldgen, worldgen_random and world_spawn (60/60 seeds). Nothing failed, so no rerun on plain main was needed.
  • CI world_spawn flake, seed -2080727421395798566: vanilla gives 144 64, 65, 66 or 72 112 from one run to the next, and Horizon always gives 144 72 112, on main as on this branch. The ring order is off on dedicated and integrated servers anyway. Details in the comment below.

🤖 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/1112 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/loading-screen-square` --- ### 📝 Commits (1) - [`32a4828`](https://github.com/horizon-rust/horizon/commit/32a48282cc2e99c4f37cf40c040e5130ebf0366b) Loading screen: fill the chunk map square by square, as vanilla ### 📊 Changes **2 files changed** (+61 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -0) 📝 `crates/horizon-client/src/streaming.rs` (+58 -3) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #770 (reported on Discord by skills.issue). ## What The loading screen's chunk map grew as a disc, while vanilla's grows as a square. In vanilla, chunk tasks run by ticket level, and a ticket's level spreads one step per ring of chunks around it, diagonals included (Chebyshev distance). So `LevelLoadingScreen`'s map (`ChunkLoadStatusView`) fills square rings around the spawn. Horizon picks the next chunks to generate by Euclidean distance, which draws a circle. While the level loading screen is up (`loading_reason()` is some, not on a dedicated server), `Streaming` now orders its work ring by ring (`Ranges::rings`: Chebyshev ring first, then the squared distance inside a ring). Once the player is in the world, the order is the usual nearest first. Only the order changes: which chunks load and how they generate stay the same. Decoration keeps vanilla's replayed order (`DecorationOrder`), so the generated blocks are unchanged. ## Screenshots A new world (seed 12345), the last loading-screen frame before the player spawns, Mac mini, `--offscreen` + `horizon-ctl screenshot` in a loop: | main | this PR | |---|---| | ![main](https://raw.githubusercontent.com/ludovic111/horizon/19af88feacb47d176f00f7af5c82a476dd707206/p4/770-main-loading.png) | ![this PR](https://raw.githubusercontent.com/ludovic111/horizon/19af88feacb47d176f00f7af5c82a476dd707206/p4/770-branch-loading.png) | The screen closes as soon as the player's 7x7 chunks are in (`LevelLoadProgressTracker`), so the outermost ring isn't finished in either shot. The front is a square now. ## Checks - `cargo fmt --all -- --check`: clean. - `cargo clippy -p horizon-client --all-targets -- -D warnings` (with `set -o pipefail`): clean. - `cargo test -p horizon-client`: all pass, including the generation scan's differential tests and a new `loading_goes_ring_by_ring` (a ring's corner comes before the next ring's edge only while loading; nearest first within a ring; unchanged order otherwise). - `tools/parity.py --changed origin/main`: 142 harnesses depend on the four P4 branches (#996, #1037, #770 and this one); they ran once on the branches merged onto main ae21bd54 (Mac mini, `--changed origin/main`): **all 142 pass**, including chunk_generation (with the new comparison), decorated_region, structure_density, terrain, tree_feature, worldgen, worldgen_random and world_spawn (60/60 seeds). Nothing failed, so no rerun on plain main was needed. - CI world_spawn flake, seed -2080727421395798566: vanilla gives 144 64, 65, 66 or 72 112 from one run to the next, and Horizon always gives 144 72 112, on main as on this branch. The ring order is off on dedicated and integrated servers anyway. Details in the comment below. 🤖 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-02 16:01:10 +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#3057
No description provided.