Skip to content

Validate mineshafts and drop the "possible" state - #23

Merged
byRandom merged 1 commit into
mainfrom
feat/mineshafts
Nov 14, 2026
Merged

byRandom merged 1 commit into
mainfrom
feat/mineshafts

Conversation

@byRandom

Copy link
Copy Markdown
Owner

The first two items of 0.6: mineshafts are now checked the same way the game checks them, so nothing on the map or in the finder is marked as "possible" any more. This also does proposal #3 of the architecture review: the unknown state is removed from every layer.

Mineshafts

  • A mineshaft's generation point depends on its pieces. The game grows a room, corridors, crossings and stairs from the chunk, then moves the whole mineshaft:

    • normal mineshafts go below sea level;
    • badlands mineshafts move so that the box's center lands between sea level and the surface.

    The biome is checked at the height that results from that move.

  • New structure::mineshaft ports MineshaftPieces far enough for that: every piece's bounding box, in the game's order, drawing the same random numbers. That includes the corridor's rail and spider-web rolls, which only decorate.

  • New kind StructureKind::Mineshaft(MineshaftType), exported by the oracle.

No more "possible"

  • Removed Outcome::Unknown, StructureKind::NotImplemented, Found.exact and Marker.exact, plus the app's "possible" labels, inspector status and help text.
  • try_structure now returns Option<pos> instead of a nested Option.
  • A Hit always has a structure that generates.
  • Only the spawn block is still shown as an estimate.
  • The oracle now throws on a structure type it does not know, instead of exporting it as not implemented.
  • The structures example now lists mineshafts and buried treasure too.

Verification

  • New game fixtures, appended after the existing generators. The existing fixtures did not change.
    • mineshaft_pieces.txt: 800 whole piece lists (101,148 pieces), each with the random number that comes after it.
    • mineshaft_points.txt: 2,160 generation points of both types, on clusters centred on their biomes. 840 of them are badlands mineshafts that generate.
  • The 117 mineshaft attempts already in structures.txt now match the game as well.
  • Mutation testing: 12 of 13 mutations fail a test. Among them are the distance and depth limits, the random draws, the two-floor threshold, collisions, the badlands centre and the sea-level offset. The remaining one is equivalent and is recorded in docs/PARITY.md.

No version bump: 0.6 still needs saved settings.


Generated by Claude Code

Mineshafts were the last structure not checked like the game. Their
generation point depends on their pieces: MineshaftStructure grows a room,
corridors, crossings and stairs from the chunk, then moves the whole
mineshaft below sea level (or, in badlands, towards the surface) and checks
the biome at that height. structure::mineshaft ports MineshaftPieces far
enough for that: every piece's bounding box, in the game's order, with the
same random numbers.

New game fixtures: 800 whole piece lists (101,148 pieces) with the random
number that follows them, and 2,160 generation points of both mineshaft
types. The 117 mineshaft attempts already in structures.txt now match too.

With every structure ported, the unknown state goes away everywhere:
Outcome::Unknown, StructureKind::NotImplemented, the nested Option of
try_structure, Found.exact, Marker.exact and the app's "possible" labels.
Only the spawn block stays an estimate. The oracle now fails on a structure
type it does not know instead of exporting it as not implemented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SenGxDDRwLejx8nir8GXKG
@byRandom
byRandom merged commit c7b6989 into main Nov 14, 2026
3 checks passed
@byRandom
byRandom deleted the feat/mineshafts branch November 15, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant