Add actuator and creature type catalogs #264

Merged
jqueuniet merged 0 commits from refs/pull/264/head into main 2026-07-17 18:13:43 +02:00
jqueuniet commented 2026-07-17 17:53:45 +02:00 (Migrated from codeberg.org)

Closes #263.

Adds name catalogs and word-1 parameter decoding for Actuator and Creature dungeon records, closing Phase 2's last deferral except the text escape-code 29/30 tables (kept open per the issue).

Sourcing & licensing

  • Creature names are the game's own data: the 76 dtText records at cls = (0x0f, creature_type, 0x05, 0x00) / cls5 = 0xf0 in dos-en graphics.dat, transcribed verbatim (including the game's THICKET THEIF and PEDISTAL). A provenance test re-derives the table from the fixture in both directions; mac-us carries the same 76 records byte-identical and is asserted too.
  • Actuator entries are transcribed from [KKDF2] (DM2_Actu/DM2_Actuators.htm + DM2_A.htm) with citations. Transcription surfaced two structural facts: the type space is single but placement-keyed0x03, 0x08, 0x26 carry distinct wall vs floor meanings, some rows cover both — and KKDF2's own pages disagree once (0x0e word 3: resolved toward DM2_A.htm's Strength, noted in the format doc).
  • skproject's DMDC2 editor dictionaries were used as a cross-check lead only (no license upstream); no content copied. Stated explicitly in dungeon-dat.md.

Library (dm2-dungeon)

New catalog module: creature_type_name(u8), actuator_type_info(u8, Placement), ActuatorTypeInfo { name, placement, word1, word3 }, and ParamClass::decode implementing the six word-1 bit formats (item class/index with the 0x1ff all-items sentinel, missile, map, numeric, creature, hero). Record conveniences: Creature::type_name(), Actuator::type_info(placement), Actuator::decoded_param(placement). The catalog never gates parsing: every lookup is Option, unknown types round-trip untouched.

CLI

dm2 extract dungeon JSON: creatures gain "type_name"; actuators gain "catalog" with floor/wall entries (name + decoded param), both placements emitted since slot records carry no tile context. Fields omitted when unresolved. The C#-parity-locked json::skproject dump path is untouched.

Tests

12 catalog unit tests (bit formats, placement keying, span coverage); the two-directional dos-en provenance test plus mac-us agreement; a 17-dungeon fixture survey pinning the exact uncatalogued sets (actuators 00 02 09 1c 28 29 33 37 3e 7d, creatures 03 40 4b 4f) so any new gap or lost entry fails loudly; a CLI test asserting the new JSON fields resolve on dos-en. All tests skip cleanly without the fixture tree (CI).

Closes #263. Adds name catalogs and word-1 parameter decoding for Actuator and Creature dungeon records, closing Phase 2's last deferral except the text escape-code 29/30 tables (kept open per the issue). ## Sourcing & licensing - **Creature names are the game's own data**: the 76 `dtText` records at `cls = (0x0f, creature_type, 0x05, 0x00)` / `cls5 = 0xf0` in dos-en `graphics.dat`, transcribed verbatim (including the game's `THICKET THEIF` and `PEDISTAL`). A provenance test re-derives the table from the fixture in both directions; mac-us carries the same 76 records byte-identical and is asserted too. - **Actuator entries are transcribed from [KKDF2]** (`DM2_Actu/DM2_Actuators.htm` + `DM2_A.htm`) with citations. Transcription surfaced two structural facts: the type space is single but **placement-keyed** — `0x03`, `0x08`, `0x26` carry distinct wall vs floor meanings, some rows cover both — and KKDF2's own pages disagree once (`0x0e` word 3: resolved toward `DM2_A.htm`'s Strength, noted in the format doc). - skproject's DMDC2 editor dictionaries were used **as a cross-check lead only** (no license upstream); no content copied. Stated explicitly in `dungeon-dat.md`. ## Library (`dm2-dungeon`) New `catalog` module: `creature_type_name(u8)`, `actuator_type_info(u8, Placement)`, `ActuatorTypeInfo { name, placement, word1, word3 }`, and `ParamClass::decode` implementing the six word-1 bit formats (item class/index with the `0x1ff` all-items sentinel, missile, map, numeric, creature, hero). Record conveniences: `Creature::type_name()`, `Actuator::type_info(placement)`, `Actuator::decoded_param(placement)`. The catalog never gates parsing: every lookup is `Option`, unknown types round-trip untouched. ## CLI `dm2 extract` dungeon JSON: creatures gain `"type_name"`; actuators gain `"catalog"` with `floor`/`wall` entries (name + decoded `param`), both placements emitted since slot records carry no tile context. Fields omitted when unresolved. The C#-parity-locked `json::skproject` dump path is untouched. ## Tests 12 catalog unit tests (bit formats, placement keying, span coverage); the two-directional dos-en provenance test plus mac-us agreement; a 17-dungeon fixture survey pinning the exact uncatalogued sets (actuators `00 02 09 1c 28 29 33 37 3e 7d`, creatures `03 40 4b 4f`) so any new gap or lost entry fails loudly; a CLI test asserting the new JSON fields resolve on dos-en. All tests skip cleanly without the fixture tree (CI).
Sign in to join this conversation.
No reviewers
No labels
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
jqueuniet/dm2-tools!264
No description provided.