[PR #136] [MERGED] Horizon extras: minimap (off by default) #2347

Closed
opened 2026-11-02 15:55:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/extras-minimap


📝 Commits (1)

  • 663f61c Horizon extras: a minimap, off by default

📊 Changes

6 files changed (+961 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/extras.rs (+116 -4)
📝 crates/horizon-client/src/extras_hud.rs (+55 -1)
📝 crates/horizon-client/src/game/extras.rs (+101 -7)
📝 crates/horizon-client/src/hud.rs (+9 -0)
📝 crates/horizon-client/src/lib.rs (+1 -0)
➕ crates/horizon-client/src/minimap.rs (+679 -0)

📄 Description

What

The minimap extra (NEXT-VERSION §6), off by default. Stacked on #135 (zoom, FPS, keystrokes and the Extras page); review that one first.

  • A corner map (top right by default, below the status effect icons), square or round, Small/Medium/Large (64/96/128 GUI px), zoom ½ to 4 blocks per pixel, north up or turning with the player (then an N on the rim), with the player arrow (vanilla's map/decorations/player sprite).
  • Colours are vanilla's MapColor per block state, picked like MapItem.update does: the first block with a map colour going down, the fluid's colour over a fluid unless the block is sturdy on top (getCorrectStateForFluidBlock), the map item's north-neighbour height shading and water-depth shading.
  • In the Nether, underground and under a roof (no sky light at the player's head), it maps the floor at the player's height instead of the roof, and draws walls cut at head height darker.
  • Cost: each loaded chunk keeps a 16x16 tile (colour, height, water depth). Tiles are filled nearest first within 0.3 ms a frame; after block changes a tile is rescanned at most once a second. The 128x128 image is recomposed only when the view moved a quarter pixel, turned half a degree or a tile changed, and uploaded into its own HUD atlas slot (horizon/minimap, 64 KiB). With the minimap off, nothing runs and the tiles are freed. Hidden with F1, drawn in the HUD layer.

How tested

  • cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo test --workspace on the Mac mini.
  • New tests (minimap.rs): column scan (first coloured block, colourless blocks skipped, water depth, lava, waterlogged non-sturdy blocks show water), the floor-and-walls layer under a height, the map item's shading and MapColor packing, tiles filled nearest first within the budget / rescanned after changes / dropped when unloaded / rescanned on a layer change, the image north up and turning with the player (north on the rim), round masks and border, recomposing only on visible moves, ring order.
  • Screenshots on a vscreen (below).

Screenshots (files on ludodesktop in ~/code/horizon-parity/screens/extras/)

  • on-all.png: north-up square map, top right, map colours with the map item's shading, a river and a beach.
  • minimap-round-rotating.png: round, turning with the player (facing north-east, N on the rim up-left).
  • minimap-cave.png: in a cave at y 32: walls cut at head height (dark), floors and underground water.
  • mp-rejoined.png: the minimap on a multiplayer server (chunks from the network), facing south with N at the bottom.
  • on-f1-hidden.png: hidden with F1.

The player arrow direction was checked pixel by pixel against the yaw (135° and 180°).

🤖 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/136 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/extras-minimap` --- ### 📝 Commits (1) - [`663f61c`](https://github.com/horizon-rust/horizon/commit/663f61c8c3f068423e048c32988c3e9d99d32e95) Horizon extras: a minimap, off by default ### 📊 Changes **6 files changed** (+961 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/extras.rs` (+116 -4) 📝 `crates/horizon-client/src/extras_hud.rs` (+55 -1) 📝 `crates/horizon-client/src/game/extras.rs` (+101 -7) 📝 `crates/horizon-client/src/hud.rs` (+9 -0) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) ➕ `crates/horizon-client/src/minimap.rs` (+679 -0) </details> ### 📄 Description ## What The minimap extra (NEXT-VERSION §6), **off by default**. Stacked on #135 (zoom, FPS, keystrokes and the Extras page); review that one first. - A corner map (top right by default, below the status effect icons), square or round, Small/Medium/Large (64/96/128 GUI px), zoom ½ to 4 blocks per pixel, north up or turning with the player (then an N on the rim), with the player arrow (vanilla's `map/decorations/player` sprite). - Colours are vanilla's `MapColor` per block state, picked like `MapItem.update` does: the first block with a map colour going down, the fluid's colour over a fluid unless the block is sturdy on top (`getCorrectStateForFluidBlock`), the map item's north-neighbour height shading and water-depth shading. - In the Nether, underground and under a roof (no sky light at the player's head), it maps the floor at the player's height instead of the roof, and draws walls cut at head height darker. - Cost: each loaded chunk keeps a 16x16 tile (colour, height, water depth). Tiles are filled nearest first within **0.3 ms a frame**; after block changes a tile is rescanned at most once a second. The 128x128 image is recomposed only when the view moved a quarter pixel, turned half a degree or a tile changed, and uploaded into its own HUD atlas slot (`horizon/minimap`, 64 KiB). With the minimap off, nothing runs and the tiles are freed. Hidden with F1, drawn in the HUD layer. ## How tested - `cargo fmt --check`, `cargo clippy --workspace --all-targets -D warnings`, `cargo test --workspace` on the Mac mini. - New tests (`minimap.rs`): column scan (first coloured block, colourless blocks skipped, water depth, lava, waterlogged non-sturdy blocks show water), the floor-and-walls layer under a height, the map item's shading and `MapColor` packing, tiles filled nearest first within the budget / rescanned after changes / dropped when unloaded / rescanned on a layer change, the image north up and turning with the player (north on the rim), round masks and border, recomposing only on visible moves, ring order. - Screenshots on a vscreen (below). ## Screenshots (files on ludodesktop in `~/code/horizon-parity/screens/extras/`) - `on-all.png`: north-up square map, top right, map colours with the map item's shading, a river and a beach. - `minimap-round-rotating.png`: round, turning with the player (facing north-east, N on the rim up-left). - `minimap-cave.png`: in a cave at y 32: walls cut at head height (dark), floors and underground water. - `mp-rejoined.png`: the minimap on a multiplayer server (chunks from the network), facing south with N at the bottom. - `on-f1-hidden.png`: hidden with F1. The player arrow direction was checked pixel by pixel against the yaw (135° and 180°). 🤖 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 15:55:11 +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#2347
No description provided.