Reorganize assets; switch the HUD to the Micro Chat font

Source packs move to assets/packs (untouched), maps to assets/maps, and the
palette/sketch leftovers from the 8-bit era go. tools/mkfont.py repacks
VEXED's Micro Chat sheet (8-column grid, 8x10 cells) into the CP437 atlas
layout the font loader already reads, cropped to 8x9 so the HUD can use an
8 px line height. The CGA atlas is dropped in its favor.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-20 19:47:33 +02:00
co-authored by Claude Opus 5
parent bb12f095d8
commit 335962800f
111 changed files with 528 additions and 546 deletions
+7 -2
View File
@@ -13,9 +13,14 @@
- `cp437(char)` maps ASCII 1:1 and the accented letters the atlas has (ä ö ü ß …);
everything else becomes `?`.
- `text_width` and `wrap` (word wrap with hard `\n`) for layout.
- Font in use: `assets/fonts/cga-8x8.png` (Oldschool PC Font Pack, CGA 8×8).
- Font in use: `assets/fonts/micro-chat-8x9.png` — VEXED's Micro Chat (5 px, CC-BY),
repacked into the CP437 layout by `tools/mkfont.py` from the source sheet in
`assets/fonts/Micro-Chat-All/` (8-column grid with 1 px grid lines, 8×10 cells, black
glyphs on transparent). Cells are cropped to source rows 1..9 — umlaut dots down to
descenders — giving 8×9 cells; the HUD uses an 8 px line height. The sheet marks the
space cell with a bar, which the tool drops. Regenerate with `python3 tools/mkfont.py`.
## Open questions
- A second, smaller or larger font (the EGA 8×14 from `wds`) once the UI needs hierarchy.
- A second, larger font (the CGA 8×8 / EGA 8×14 from `wds`) once the UI needs hierarchy.
- Text color per span / inline markup for the log — not before it is needed.
+2 -2
View File
@@ -13,7 +13,7 @@ TMX/XML. No header, no dimensions. The loader derives them from the content:
- **width** = number of fields in the first row
- **height** = number of rows
The current test map lives at `assets/map_test` (30×30, tile ids 25 / 74 / 75 / 146).
The current test map lives at `assets/maps/map_test` (30×30, tile ids 25 / 74 / 75 / 146).
A trailing comma per row is tolerated; ragged rows panic (they indicate a corrupt export).
---
@@ -62,7 +62,7 @@ No `firstgid` subtraction: the authored ids already line up with `overworld.png`
array is also the natural on-disk layout should chunks ever be streamed from disk (RLE over
the `u16`s would do) — the CSV stays the interchange format for external tooling. The map's
top-left tile sits at world (0, 0). Loading a 256×256 map takes well under a millisecond in
release; the map path is the game's first CLI argument (`game assets/map_large`).
release; the map path is the game's first CLI argument (`game assets/maps/map_large`).
**Edge border:** a 30×30 map only fills part of chunk (0,0) (which spans tiles 0–31). Tiles
inside a loaded chunk but outside the authored map are emitted as an *invisible solid border*
+9 -3
View File
@@ -9,6 +9,11 @@ window, GPU, input, RGB565 framebuffer — lives in the external `pbio` crate (g
branch `truecolor16`),
not in this repo.
Assets: `assets/packs/` holds the source packs untouched (Mini Medieval family by
VEXED, CC-BY); `assets/tilesets/` is what the game actually loads — sheets assembled
from the packs (`entities.png`: player, hen, fox); `assets/fonts/` the font sources and
the repacked atlas; `assets/maps/` the Tiled CSV maps.
History: this fork started from a client/server multiplayer architecture (authoritative UDP
server, thin client with prediction). The scope was cut to single player in September 2026;
the sim kept its authoritative shape, everything network-related was removed. The `sim`
@@ -26,7 +31,7 @@ crate's `tick`/`set_action` interface is the seam a server could be wrapped arou
- [x] Input system: `GameAction`, `InputMap`, `InputState` in `game/src/input.rs` (over `pbio::Key`)
- [x] World model: `World` of 32×32 `Chunk`s (plain `[u16; 1024]` tile ids, flags derived
on lookup — the network-era 64-entry palette is gone), entities indexed per chunk,
`entities_in_viewport`. Map path is the first CLI argument; `assets/map_large` is a
`entities_in_viewport`. Map path is the first CLI argument; `assets/maps/map_large` is a
generated 256×256 stress map
- [x] Map loader: Tiled-CSV parser in `sim/src/map.rs` (flip-flag masking, content-derived
dimensions), `load_world` slices it into chunks, invisible solid border at the map rim.
@@ -162,8 +167,9 @@ Sprite rendering, camera follow and entity interpolation have all landed.
- [x] Bitmap font: `game/src/font.rs`, CP437 atlas (32×8 cells, codepoint = index),
proportional advance from measured ink bounds, luminance-keyed mask, `wrap`.
Ported from `wds`; the atlas is `assets/fonts/cga-8x8.png` (Oldschool PC Font
Pack CGA 8×8). See `notes/04-text_renderer.md`
Ported from `wds`. The atlas is `assets/fonts/micro-chat-8x9.png`, repacked by
`tools/mkfont.py` from VEXED's Micro Chat sheet (5 px font, 8 px line height).
See `notes/04-text_renderer.md`
- [x] UI primitives in `game/src/ui.rs`: `fill_rect`, `draw_rect`, `draw_hbar`
- [x] HUD in the 80 px strip right of the viewport (`Game::render_hud`): name, HP bar,
population, and a message log fed from the sim events (only fights involving the