[PR #6325] [MERGED] Far terrain on servers without horizon:lod (3/5): draw the rest from the server's BlueMap #6799

Closed
opened 2026-11-03 06:26:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6325
Author: @some-du6e
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: far-terrain/2b-bluemap


📝 Commits (4)

  • 76d4f70 BlueMap's lowres tiles, settings and palette, for far terrain
  • b899e4c Draw far terrain from a server's BlueMap past the kept chunks
  • b133ad2 Merge main into #6324
  • b3461b4 Merge #6324's main merge into #6325

📊 Changes

10 files changed (+1893 additions, -51 deletions)

View changed files

📝 THIRD_PARTY_NOTICES.md (+32 -0)
➕ crates/horizon-client-render/src/bluemap.rs (+1568 -0)
📝 crates/horizon-client-render/src/graphics.rs (+33 -2)
📝 crates/horizon-client-render/src/lib.rs (+1 -0)
📝 crates/horizon-client-render/src/lod.rs (+149 -10)
📝 crates/horizon-client-render/src/server_terrain.rs (+44 -16)
📝 crates/horizon-client/src/client_lib.rs (+13 -13)
📝 crates/horizon-client/src/game.rs (+37 -7)
📝 docs/graphics.md (+8 -0)
📝 launcher/src/other_launchers.rs (+8 -3)

📄 Description

The other half of BlueMap far terrain. With this PR, a server the player names in horizon-bluemap.txt fills the far terrain past the kept chunks from its web map.

This PR: b899e4c20

  • Settings. Graphics holds the BlueMap settings: horizon-graphics.txt keeps blueMapRadius:, and the blueMap: lines are read from horizon-bluemap.txt.
  • Downloads. Lowres tiles are downloaded around the player, one at a time and at most ten a second, on their own thread.
  • Disk cache. Tiles are kept up to 256 MiB a server, oldest first, and fetched again after three days. They are written whole (temp file, then rename). An error page never replaces a cached tile. A server that stops answering is left alone longer each time, up to ten minutes.
  • Memory. Decoded tiles in memory are capped at 192 MiB.
  • Drawing. A tile that arrives refreshes the far-terrain tiles over it (Lod::refresh, plus a stale set so the old samples stay drawn meanwhile). Chunks the player kept always come first. Chunk detail read before a refresh over its chunk is dropped and asked again (Lod::refreshed_since).
  • Imports. The launcher's import from other launchers skips horizon-bluemap.txt and server-terrain/, so an instance another launcher made can't name a map for the player.
  • Docs. docs/graphics.md covers how to name a server's map.

Tests: cached tiles are drawn without the server and only tiles in reach are wanted; kept chunks win over the map; the cache stays under its cap; areas being refreshed forget their detail, except chunks seen in the world.

The stack

This follows #4945–#4947, Ludovic's horizon:lod stack, which is now merged. That stack covers Horizon servers that sample far terrain for their clients. This one covers every other server: vanilla, Paper and Spigot never send their seed, so far terrain had nothing to draw there. prepare_lod tries the integrated server first, then the server's horizon:lod offer, and only falls back to this stack when there is no offer. Status reports this fallback as lod.source: "server-terrain", so the two can be told apart.

Each PR targets main and holds the PRs before it, so review only the commits listed under "This PR". Merge them in order.

  1. #6323: keep the chunks a server sent
  2. #6324: BlueMap's lowres tiles, settings and palette
  3. #6325 (this one): draw the rest from the server's BlueMap
  4. #6326: Find BlueMap, and no re-mesh storms
  5. #6327: no rings of nothing, slabs or holes
  6. #6643: read Bobby's cache too, written from its files on disk

Other projects' code

  • BlueMap (MIT): the same tile format and web-app files as #6324, credited there. Nothing new from it here.
  • The "as the MapLink mod does" comparison (GPL-3.0) is gone from this PR and the docs.

Checked

  • CI on the fork (run): clippy --all-targets -D warnings on horizon-client-render, horizon-client and horizon-mods and the render crate's tests at every one of the 9 commits, and cargo fmt --check, the horizon-client tests and horizon-mods' modpack tests on the top one.

  • Live test on GitHub Actions (run). The runner downloads the pinned 26.3 from Mojang (every file checked against Mojang's SHA-1) and runs horizon-prepare. Then:

    • It records a local world drawing a real server's BlueMap as far terrain (video, recorded on these exact commits).

    Far terrain from a server's BlueMap

    • It runs tools/server_lod_e2e.py against a real dedicated server. With horizon-lod-distance set it reports source: server. Without it, it reports source: server-terrain (updated in PR 1).
  • Review: 16 rounds of independent reviewers, the last with no real findings (correctness, edge cases, tests, simplicity, fit) over the whole stack. Each finding went into the commit it belongs to. Since then, the .bobby reader came out and the stack was rebased on main; CI above is on the result.

  • Not run: the parity harnesses, and pr_ready.py (it needs .local/, which this machine doesn't build).

Suggested labels, since this fork can't set them: feature and needs-proof.

Note

Filed by Opus 5.5 using 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/6325 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `far-terrain/2b-bluemap` --- ### 📝 Commits (4) - [`76d4f70`](https://github.com/horizon-rust/horizon/commit/76d4f7058abe84a550144a434a307b81c3865938) BlueMap's lowres tiles, settings and palette, for far terrain - [`b899e4c`](https://github.com/horizon-rust/horizon/commit/b899e4c20007920cf1117129558ae7be02368b55) Draw far terrain from a server's BlueMap past the kept chunks - [`b133ad2`](https://github.com/horizon-rust/horizon/commit/b133ad22cdc2aedee54cfea97911f3fd537f26d9) Merge main into #6324 - [`b3461b4`](https://github.com/horizon-rust/horizon/commit/b3461b451538862a01409467c08ca845d2186993) Merge #6324's main merge into #6325 ### 📊 Changes **10 files changed** (+1893 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `THIRD_PARTY_NOTICES.md` (+32 -0) ➕ `crates/horizon-client-render/src/bluemap.rs` (+1568 -0) 📝 `crates/horizon-client-render/src/graphics.rs` (+33 -2) 📝 `crates/horizon-client-render/src/lib.rs` (+1 -0) 📝 `crates/horizon-client-render/src/lod.rs` (+149 -10) 📝 `crates/horizon-client-render/src/server_terrain.rs` (+44 -16) 📝 `crates/horizon-client/src/client_lib.rs` (+13 -13) 📝 `crates/horizon-client/src/game.rs` (+37 -7) 📝 `docs/graphics.md` (+8 -0) 📝 `launcher/src/other_launchers.rs` (+8 -3) </details> ### 📄 Description The other half of BlueMap far terrain. With this PR, a server the player names in `horizon-bluemap.txt` fills the far terrain past the kept chunks from its web map. ## This PR: `b899e4c20` - **Settings.** `Graphics` holds the BlueMap settings: `horizon-graphics.txt` keeps `blueMapRadius:`, and the `blueMap:` lines are read from `horizon-bluemap.txt`. - **Downloads.** Lowres tiles are downloaded around the player, one at a time and at most ten a second, on their own thread. - **Disk cache.** Tiles are kept up to 256 MiB a server, oldest first, and fetched again after three days. They are written whole (temp file, then rename). An error page never replaces a cached tile. A server that stops answering is left alone longer each time, up to ten minutes. - **Memory.** Decoded tiles in memory are capped at 192 MiB. - **Drawing.** A tile that arrives refreshes the far-terrain tiles over it (`Lod::refresh`, plus a `stale` set so the old samples stay drawn meanwhile). Chunks the player kept always come first. Chunk detail read before a refresh over its chunk is dropped and asked again (`Lod::refreshed_since`). - **Imports.** The launcher's import from other launchers skips `horizon-bluemap.txt` and `server-terrain/`, so an instance another launcher made can't name a map for the player. - **Docs.** `docs/graphics.md` covers how to name a server's map. Tests: cached tiles are drawn without the server and only tiles in reach are wanted; kept chunks win over the map; the cache stays under its cap; areas being refreshed forget their detail, except chunks seen in the world. ## The stack This follows #4945–#4947, Ludovic's `horizon:lod` stack, which is now merged. That stack covers Horizon servers that sample far terrain for their clients. This one covers every other server: vanilla, Paper and Spigot never send their seed, so far terrain had nothing to draw there. `prepare_lod` tries the integrated server first, then the server's `horizon:lod` offer, and only falls back to this stack when there is no offer. Status reports this fallback as `lod.source: "server-terrain"`, so the two can be told apart. Each PR targets `main` and holds the PRs before it, so review only the commits listed under "This PR". Merge them in order. 1. #6323: keep the chunks a server sent 2. #6324: BlueMap's lowres tiles, settings and palette 3. **#6325 (this one)**: draw the rest from the server's BlueMap 4. #6326: Find BlueMap, and no re-mesh storms 5. #6327: no rings of nothing, slabs or holes 6. #6643: read Bobby's cache too, written from its files on disk ## Other projects' code - **BlueMap** (MIT): the same tile format and web-app files as #6324, credited there. Nothing new from it here. - The "as the MapLink mod does" comparison (GPL-3.0) is gone from this PR and the docs. ## Checked - **CI on the fork** ([run](https://github.com/some-du6e/horizon/actions/runs/41362609329)): `clippy --all-targets -D warnings` on `horizon-client-render`, `horizon-client` and `horizon-mods` and the render crate's tests at every one of the 9 commits, and `cargo fmt --check`, the `horizon-client` tests and `horizon-mods`' modpack tests on the top one. - **Live test on GitHub Actions** ([run](https://github.com/some-du6e/horizon/actions/runs/41363312105)). The runner downloads the pinned 26.3 from Mojang (every file checked against Mojang's SHA-1) and runs `horizon-prepare`. Then: - It records a local world drawing a real server's BlueMap as far terrain ([video](https://github.com/some-du6e/horizon/releases/download/far-terrain-video/far-terrain-bluemap.mp4), recorded on these exact commits). [![Far terrain from a server's BlueMap](https://github.com/some-du6e/horizon/releases/download/far-terrain-video/far-terrain-bluemap.png)](https://github.com/some-du6e/horizon/releases/download/far-terrain-video/far-terrain-bluemap.mp4) - It runs `tools/server_lod_e2e.py` against a real dedicated server. With `horizon-lod-distance` set it reports `source: server`. Without it, it reports `source: server-terrain` (updated in PR 1). - **Review:** 16 rounds of independent reviewers, the last with no real findings (correctness, edge cases, tests, simplicity, fit) over the whole stack. Each finding went into the commit it belongs to. Since then, the `.bobby` reader came out and the stack was rebased on `main`; CI above is on the result. - **Not run:** the parity harnesses, and `pr_ready.py` (it needs `.local/`, which this machine doesn't build). Suggested labels, since this fork can't set them: `feature` and `needs-proof`. > [!NOTE] > Filed by Opus 5.5 using 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 06:26:58 +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#6799
No description provided.