[PR #6326] [MERGED] Far terrain on servers without horizon:lod (4/5): Find BlueMap, and no re-mesh storms #6798

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/6326
Author: @some-du6e
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: far-terrain/3-find-bluemap


📝 Commits (7)

  • 0e7b089 Find a server's BlueMap by itself, behind Find BlueMap
  • 76d4f70 BlueMap's lowres tiles, settings and palette, for far terrain
  • b899e4c Draw far terrain from a server's BlueMap past the kept chunks
  • 5a50f85 Stop BlueMap far terrain from re-meshing what didn't change
  • b133ad2 Merge main into #6324
  • b3461b4 Merge #6324's main merge into #6325
  • 5a9e71d Merge #6325's main merge into #6326; BlueMap settings in the language table

📊 Changes

15 files changed (+2911 additions, -68 deletions)

View changed files

📝 AGENTS.md (+1 -1)
📝 THIRD_PARTY_NOTICES.md (+32 -0)
➕ crates/horizon-client-render/src/bluemap.rs (+1967 -0)
➕ crates/horizon-client-render/src/bluemap_detect.rs (+452 -0)
📝 crates/horizon-client-render/src/graphics.rs (+35 -2)
📝 crates/horizon-client-render/src/graphics_ui.rs (+51 -0)
📝 crates/horizon-client-render/src/lib.rs (+2 -0)
📝 crates/horizon-client-render/src/lod.rs (+245 -26)
📝 crates/horizon-client-render/src/server_terrain.rs (+45 -16)
📝 crates/horizon-client/assets/horizon/lang/en_us.json (+4 -0)
📝 crates/horizon-client/assets/horizon/lang/fr_fr.json (+4 -0)
📝 crates/horizon-client/src/client_lib.rs (+13 -13)
📝 crates/horizon-client/src/game.rs (+42 -7)
📝 docs/graphics.md (+10 -0)
📝 launcher/src/other_launchers.rs (+8 -3)

📄 Description

Naming a server's map by hand is fiddly, so this adds an opt-in way to find it. It also stops BlueMap far terrain from re-meshing everything each time a tile arrives.

This PR: 0e7b0899a, 5a50f8588

  • Find BlueMap, off by default, under Video Settings → Advanced → Rendering (blueMapAutoDetect:true). On a server no blueMap: line names, a background thread asks a few likely addresses for BlueMap's settings.json:
    • BlueMap's own web server, http://<host>:8100.
    • https and http on the host itself and on its map. subdomain.
    • map. of the parent domain, but only for play./mc.-style hosts, and never under shared dynamic-DNS or hosting domains, where the parent belongs to someone else.
    • The answer is remembered in detected.txt for a week, or a day when nothing was found. Map addresses are logged only at debug level, because logs end up in crash reports.
  • Fewer re-meshes.
    • An arrival names the cell widths its level is drawn in, so only those tiles are sampled again.
    • A sample or chunk detail equal to what is already drawn meshes nothing.
    • A tile refreshed while its sample is in flight (restale) is sampled once more.
  • The map's settings, once a visit.
    • A network error backs off and keeps the cached map. Only an answer without this level's map drops it.
    • If the map's settings changed, its cached tiles are deleted first. If they can't be deleted, BlueMap is off for that visit.
    • Lookups and chunks built from the old settings in the meantime aren't kept.
    • A dropped or changed map redraws everywhere, not only within the download radius.
  • Smaller fixes. Columns end 8 blocks under their lowest neighbour's top instead of at the bottom of the world, which drew a stone wall along the horizon. A failed cache write no longer hides the tile that was just downloaded.

Tests: the candidate addresses (no third-party parents), how the answer is remembered, arrivals naming their widths and coming in bursts, and the settings that turn this on.

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: draw the rest from the server's BlueMap
  4. #6326 (this one): 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): Find BlueMap recognises a web app by its settings.json, the same file #6324 reads (MapSettingsSerializer, credited there). Nothing else.

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/6326 **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/3-find-bluemap` --- ### 📝 Commits (7) - [`0e7b089`](https://github.com/horizon-rust/horizon/commit/0e7b0899a881ddba00a3e6c4552853b6736ab790) Find a server's BlueMap by itself, behind Find BlueMap - [`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 - [`5a50f85`](https://github.com/horizon-rust/horizon/commit/5a50f85880757da7d3a136ec06e7c7e85d2be4fd) Stop BlueMap far terrain from re-meshing what didn't change - [`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 - [`5a9e71d`](https://github.com/horizon-rust/horizon/commit/5a9e71d75659a7a7bea6290fc142f68a319cb40c) Merge #6325's main merge into #6326; BlueMap settings in the language table ### 📊 Changes **15 files changed** (+2911 additions, -68 deletions) <details> <summary>View changed files</summary> 📝 `AGENTS.md` (+1 -1) 📝 `THIRD_PARTY_NOTICES.md` (+32 -0) ➕ `crates/horizon-client-render/src/bluemap.rs` (+1967 -0) ➕ `crates/horizon-client-render/src/bluemap_detect.rs` (+452 -0) 📝 `crates/horizon-client-render/src/graphics.rs` (+35 -2) 📝 `crates/horizon-client-render/src/graphics_ui.rs` (+51 -0) 📝 `crates/horizon-client-render/src/lib.rs` (+2 -0) 📝 `crates/horizon-client-render/src/lod.rs` (+245 -26) 📝 `crates/horizon-client-render/src/server_terrain.rs` (+45 -16) 📝 `crates/horizon-client/assets/horizon/lang/en_us.json` (+4 -0) 📝 `crates/horizon-client/assets/horizon/lang/fr_fr.json` (+4 -0) 📝 `crates/horizon-client/src/client_lib.rs` (+13 -13) 📝 `crates/horizon-client/src/game.rs` (+42 -7) 📝 `docs/graphics.md` (+10 -0) 📝 `launcher/src/other_launchers.rs` (+8 -3) </details> ### 📄 Description Naming a server's map by hand is fiddly, so this adds an opt-in way to find it. It also stops BlueMap far terrain from re-meshing everything each time a tile arrives. ## This PR: `0e7b0899a`, `5a50f8588` - **Find BlueMap**, off by default, under Video Settings → Advanced → Rendering (`blueMapAutoDetect:true`). On a server no `blueMap:` line names, a background thread asks a few likely addresses for BlueMap's `settings.json`: - BlueMap's own web server, `http://<host>:8100`. - `https` and `http` on the host itself and on its `map.` subdomain. - `map.` of the parent domain, but only for `play.`/`mc.`-style hosts, and never under shared dynamic-DNS or hosting domains, where the parent belongs to someone else. - The answer is remembered in `detected.txt` for a week, or a day when nothing was found. Map addresses are logged only at debug level, because logs end up in crash reports. - **Fewer re-meshes.** - An arrival names the cell widths its level is drawn in, so only those tiles are sampled again. - A sample or chunk detail equal to what is already drawn meshes nothing. - A tile refreshed while its sample is in flight (`restale`) is sampled once more. - **The map's settings, once a visit.** - A network error backs off and keeps the cached map. Only an answer without this level's map drops it. - If the map's settings changed, its cached tiles are deleted first. If they can't be deleted, BlueMap is off for that visit. - Lookups and chunks built from the old settings in the meantime aren't kept. - A dropped or changed map redraws everywhere, not only within the download radius. - **Smaller fixes.** Columns end 8 blocks under their lowest neighbour's top instead of at the bottom of the world, which drew a stone wall along the horizon. A failed cache write no longer hides the tile that was just downloaded. Tests: the candidate addresses (no third-party parents), how the answer is remembered, arrivals naming their widths and coming in bursts, and the settings that turn this on. ## 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: draw the rest from the server's BlueMap 4. **#6326 (this one)**: 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): Find BlueMap recognises a web app by its `settings.json`, the same file #6324 reads (`MapSettingsSerializer`, credited there). Nothing else. ## 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#6798
No description provided.