viewer: an overview map of the world's chunks, with click to fly there (VIEWER-OVERVIEW-MAP) #2338

Open
github-bot wants to merge 1 commit from github-bot/gh-2338 into main AGit
Owner

@⁠syfyra on GitHub · 2026-11-26 14:05 UTC · original
syfyra:feat/viewer-overview-map → main · +609 −0 · 3 files · 1 commits · draft

Claimed in the coordination issue as: VIEWER-OVERVIEW-MAP (#1608)

Depends on: none. It merges cleanly with the open pull requests on the viewer page and its tests (#93, #651, #918, #2243), and the viewer's Node tests pass on each of those four merges.

What and why

The map viewer loads only what is near the camera (1,400 m, or one band per LOD tier), and nothing in it shows where the rest of a world is. A placed world is kilometres across, G draws the chunk boxes in 3D, which helps only for what is in view, and a chunk that fails to load is a count in the HUD with no way to tell which chunk it was.

M opens a map of the whole world from above, drawn from world.json alone:

  • One rectangle per chunk (its cell when it names a tier, otherwise the X/Z extent of its bounds), coloured by its streaming state: not loaded, loading, loaded, or failed (its three attempts are used up). +x is right and +z is down, so a placed world has north (RAGE +Y) at the top.
  • The camera as an arrow along its view direction, the spawn point, a scale bar and, in a world without LOD sets, the loading radius.
  • Under the map, the point under the cursor in glTF metres, in a placed world also as RAGE X and Y (the numbers world_build.py --region takes), and the chunk there with its state. That is how a chunk that fails to load is found by id.
  • A click moves the camera there. Its height stays unless full-detail geometry reaches higher at that point; then it arrives 10 m above the top of those chunks' bounds. Coarser LOD tiers are left out of that, because one distant model in them can span kilometres.
  • The wheel over the map zooms it about the cursor, up to 64 times, and does not change the flying speed.

Opening the map releases a locked mouse, since the map is used with the cursor. #map sits above the "Click to fly" layer, so a click on the map reaches the map and a click beside it locks the mouse again; the map stays open while flying.

Nothing touches the page until the map is first opened, so the existing tests that run the whole module with a getElementById that returns {} are unchanged. An open map is redrawn at most every 100 ms. Chunk ids come from world.json and are written with textContent. docs/world.md gets a section on the map.

Tested

Windows 11, Node 26.12.1, Python 3.14.7:

  • node --test tests/test_*.cjs: 89 pass, 20 of them new in tests/test_viewer_map.cjs. The new file runs the map's code from the page together with the streaming section, so the chunk states it checks come from real stream() calls (a load, a pending request, one failure, three failures). It covers the fit and the gap between cells, high-DPI canvases, the four colours and the legend, the arrow, the radius and the spawn ring, the scale bar, north and the RAGE coordinates, the info line (also for a cursor that rests while a chunk loads), LOD cells, the click and its height rule, the zoom and its limits, the redraw interval, an empty world and a collapsed panel.
  • The new file fails on main, where the page has no map section.
  • 42 one-line changes to the new code (a removed stopPropagation, a swapped axis, a dropped tier check, innerHTML for textContent, and so on) each make at least one of the new tests fail.
  • In Chromium (the Claude desktop app's browser pane) with python -I viewer/serve.py: the test terrain (576 chunks), and a synthetic world.json with LOD sets, "layout": "placements" and no chunk files, where the cells turn from loading to failed. Opened, hovered, clicked to fly, zoomed with the wheel (the speed in the HUD stayed at 40 m/s) and closed, at 1024x768 and in a 700x560 window.
  • python -I on every tests/test_docs_*.py, tests/test_i18n_index.py, tests/test_viewer_cdn_integrity.py, tests/test_text_write_line_endings.py and tests/test_ci_registration.py; python -I scripts/check_no_game_data.py on the three changed files.
  • Not tested: a world built from a package (both manifests above are synthetic), Firefox and Safari, and a locked mouse in a browser (I did not lock it there; the release on opening is covered by the Node test only). Touch devices have no key for the map.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator rule in this change.)

🤖 Generated with Claude Code

**@⁠syfyra** on GitHub · 2026-11-26 14:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2338) `syfyra:feat/viewer-overview-map` → `main` · +609 −0 · 3 files · 1 commits · draft Claimed in the coordination issue as: VIEWER-OVERVIEW-MAP (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) Depends on: none. It merges cleanly with the open pull requests on the viewer page and its tests (#93, #651, #918, #2243), and the viewer's Node tests pass on each of those four merges. ### What and why The map viewer loads only what is near the camera (1,400 m, or one band per LOD tier), and nothing in it shows where the rest of a world is. A placed world is kilometres across, `G` draws the chunk boxes in 3D, which helps only for what is in view, and a chunk that fails to load is a count in the HUD with no way to tell which chunk it was. `M` opens a map of the whole world from above, drawn from `world.json` alone: - One rectangle per chunk (its `cell` when it names a tier, otherwise the X/Z extent of its `bounds`), coloured by its streaming state: not loaded, loading, loaded, or failed (its three attempts are used up). +x is right and +z is down, so a placed world has north (RAGE +Y) at the top. - The camera as an arrow along its view direction, the spawn point, a scale bar and, in a world without LOD sets, the loading radius. - Under the map, the point under the cursor in glTF metres, in a placed world also as RAGE X and Y (the numbers `world_build.py --region` takes), and the chunk there with its state. That is how a chunk that fails to load is found by id. - A click moves the camera there. Its height stays unless full-detail geometry reaches higher at that point; then it arrives 10 m above the top of those chunks' bounds. Coarser LOD tiers are left out of that, because one distant model in them can span kilometres. - The wheel over the map zooms it about the cursor, up to 64 times, and does not change the flying speed. Opening the map releases a locked mouse, since the map is used with the cursor. `#map` sits above the "Click to fly" layer, so a click on the map reaches the map and a click beside it locks the mouse again; the map stays open while flying. Nothing touches the page until the map is first opened, so the existing tests that run the whole module with a `getElementById` that returns `{}` are unchanged. An open map is redrawn at most every 100 ms. Chunk ids come from `world.json` and are written with `textContent`. `docs/world.md` gets a section on the map. ### Tested Windows 11, Node 26.12.1, Python 3.14.7: - `node --test tests/test_*.cjs`: 89 pass, 20 of them new in `tests/test_viewer_map.cjs`. The new file runs the map's code from the page together with the streaming section, so the chunk states it checks come from real `stream()` calls (a load, a pending request, one failure, three failures). It covers the fit and the gap between cells, high-DPI canvases, the four colours and the legend, the arrow, the radius and the spawn ring, the scale bar, north and the RAGE coordinates, the info line (also for a cursor that rests while a chunk loads), LOD cells, the click and its height rule, the zoom and its limits, the redraw interval, an empty world and a collapsed panel. - The new file fails on `main`, where the page has no map section. - 42 one-line changes to the new code (a removed `stopPropagation`, a swapped axis, a dropped tier check, `innerHTML` for `textContent`, and so on) each make at least one of the new tests fail. - In Chromium (the Claude desktop app's browser pane) with `python -I viewer/serve.py`: the test terrain (576 chunks), and a synthetic `world.json` with LOD sets, `"layout": "placements"` and no chunk files, where the cells turn from loading to failed. Opened, hovered, clicked to fly, zoomed with the wheel (the speed in the HUD stayed at 40 m/s) and closed, at 1024x768 and in a 700x560 window. - `python -I` on every `tests/test_docs_*.py`, `tests/test_i18n_index.py`, `tests/test_viewer_cdn_integrity.py`, `tests/test_text_write_line_endings.py` and `tests/test_ci_registration.py`; `python -I scripts/check_no_game_data.py` on the three changed files. - Not tested: a world built from a package (both manifests above are synthetic), Firefox and Safari, and a locked mouse in a browser (I did not lock it there; the release on opening is covered by the Node test only). Touch devices have no key for the map. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (No translator rule in this change.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The map viewer loads only what is near the camera, and nothing in it shows
where the rest of a world is: a placed world is kilometres across, and a
chunk that fails to load is only a number in the HUD.

M opens a map of the whole world from above, drawn from world.json alone:
one rectangle per chunk (its cell when it names a tier, otherwise the X/Z
extent of its bounds), coloured by its streaming state (not loaded,
loading, loaded, failed). It shows the camera and its view direction, the
spawn point and, without LOD sets, the loading radius. The line under it
names the point under the cursor, in a placed world also as RAGE X and Y,
and the chunk there with its state. A click moves the camera there, 10 m
above the full-detail geometry at that point unless it is already higher;
the wheel over the map zooms it about the cursor.

Nothing touches the page until the map is first opened, and an open map is
redrawn at most every 100 ms. tests/test_viewer_map.cjs runs the map's
code from the page together with the streaming code, in a new file so the
open pull requests on tests/test_viewer_streaming.cjs are not touched.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:08:07 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-26 15:40 UTC · original · reviewed

Windows 11/Node: all 77 map and streaming tests passed, including bounds, pointer mapping and fly-to controls in the test harness. No findings from those checks.

AI-assisted.

**@⁠lixonik** on GitHub · 2026-11-26 15:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2338#pullrequestreview-6076919850) · **reviewed** Windows 11/Node: all 77 map and streaming tests passed, including bounds, pointer mapping and fly-to controls in the test harness. No findings from those checks. AI-assisted.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2338/head:github-bot/gh-2338'
git switch 'github-bot/gh-2338'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2338'
git switch 'github-bot/gh-2338'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2338'
git switch 'github-bot/gh-2338'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2338'
git switch 'main'
git merge --squash 'github-bot/gh-2338'
git switch 'main'
git merge --ff-only 'github-bot/gh-2338'
git switch 'main'
git merge 'github-bot/gh-2338'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.