Viewer: sector grid toggle in Map 2D and Map 3D #218

Manually merged
github merged 1 commit from gh-pr/218/head into gh-pr/218/base 2026-11-26 20:19:02 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 22:45 UTC · original
holdmysocks:claude/sector-grid-overlay → master · +298 −5 · 5 files · 1 commits · merged 2026-11-24 23:00 UTC

What

Adds a sector grid toggle to Map 2D and Map 3D. When it's on, the viewer draws the world sector grids of levels.rpf (decoded by sixng_core::sectorgrid, #194 and #210). A picker below the toggle chooses one of the eight grids. The default is the 60 m world grid.

  • Colours: cell lists are coloured by bundle key; map-group lists are coloured by map group id.
  • Map 2D: listed cells are filled lightly, with an outline once a cell is at least 4 px wide. The hover line names the cell under the cursor and its records (bundle key and index, or map group ids).
  • Map 3D: cell outlines are laid on the baked ground height near the camera. The reach scales with cell size (1.5 to 16 km), and the lines lift slightly with distance so the coarser far terrain doesn't hide them.
  • Loading: grids load on a background thread the first time the toggle is switched on, about a second on a warm cache. Nothing loads while the toggle is off.
  • Automation: --sector-grid [N] turns the overlay on for --tab map2d or --tab map3d runs and picks grid N (1-based, in archive order). Screenshots wait for the grids to load.

New file: crates/sixng-gui/src/sector_view.rs. Small hooks in map2d.rs, map3d.rs, main.rs and pages.rs. Map2D::new now also takes the game folder.

Checked

  • cargo build -p sixng-gui --release, clippy and cargo test -p sixng-gui --release.
  • Map 2D screenshots with the world grid (grid 7) and the 60 m map-group grid (grid 8):
    • The grid lines up with the placements.
    • Open ground with nothing placed, such as an airfield apron, has no cells. This is what the occupancy figures in #194 predict.
  • Map 3D screenshot on the RTX 4080 with the world grid: outlines follow the ground with no gaps, at 56 fps on the low quality preset.

Not done

  • The minimap window in Map 3D doesn't show the grid.
  • There is no per-bundle or per-map-group highlight or search yet. The hover line is the only way to read a cell's records.
**@⁠holdmysocks** on GitHub · 2026-11-24 22:45 UTC · [original](https://github.com/holdmysocks/SixNG/pull/218) `holdmysocks:claude/sector-grid-overlay` → `master` · +298 −5 · 5 files · 1 commits · merged 2026-11-24 23:00 UTC ## What Adds a **sector grid** toggle to Map 2D and Map 3D. When it's on, the viewer draws the world sector grids of `levels.rpf` (decoded by `sixng_core::sectorgrid`, #194 and #210). A picker below the toggle chooses one of the eight grids. The default is the 60 m world grid. - **Colours:** cell lists are coloured by bundle key; map-group lists are coloured by map group id. - **Map 2D:** listed cells are filled lightly, with an outline once a cell is at least 4 px wide. The hover line names the cell under the cursor and its records (bundle key and index, or map group ids). - **Map 3D:** cell outlines are laid on the baked ground height near the camera. The reach scales with cell size (1.5 to 16 km), and the lines lift slightly with distance so the coarser far terrain doesn't hide them. - **Loading:** grids load on a background thread the first time the toggle is switched on, about a second on a warm cache. Nothing loads while the toggle is off. - **Automation:** `--sector-grid [N]` turns the overlay on for `--tab map2d` or `--tab map3d` runs and picks grid N (1-based, in archive order). Screenshots wait for the grids to load. New file: `crates/sixng-gui/src/sector_view.rs`. Small hooks in `map2d.rs`, `map3d.rs`, `main.rs` and `pages.rs`. `Map2D::new` now also takes the game folder. ## Checked - `cargo build -p sixng-gui --release`, clippy and `cargo test -p sixng-gui --release`. - Map 2D screenshots with the world grid (grid 7) and the 60 m map-group grid (grid 8): - The grid lines up with the placements. - Open ground with nothing placed, such as an airfield apron, has no cells. This is what the occupancy figures in #194 predict. - Map 3D screenshot on the RTX 4080 with the world grid: outlines follow the ground with no gaps, at 56 fps on the low quality preset. ## Not done - The minimap window in Map 3D doesn't show the grid. - There is no per-bundle or per-map-group highlight or search yet. The hover line is the only way to read a cell's records.
Draws the levels.rpf sector grids (cell lists by bundle, map-group lists by
map group) with a grid picker; hover line names the cell's records in Map 2D.
Grids load in the background on first use. --sector-grid [N] for automation.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:19:01 +00:00
github manually merged commit 85ef9f604a into gh-pr/218/base 2026-11-26 20:19:02 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.