Skip to content

Map: stop mapping look-alike rooms twice, and fold fresh copies back - #29

Merged
MHohlios merged 2 commits into
mainfrom
wiffletree/map-stop-duplicating-look-alike-rooms-into-islan
Nov 3, 2026
Merged

MHohlios merged 2 commits into
mainfrom
wiffletree/map-stop-duplicating-look-alike-rooms-into-islan

Conversation

@MHohlios

@MHohlios MHohlios commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

In Avatar's Meadow, the map showed "Still working out which room this is." on a separate map, then switched to another map. The player's saved map held the Meadow twice: about 80 rooms on the main grid and a 37-room exact copy on a far island, with 40 links between the copies drawn as long lines. Once a twin exists, no room in the area can be told apart, so the tracker never settles and keeps redrawing between the copies.

What made the copies

  • A refused move followed by a look. When the game refuses a move in words the rules don't know, the look's Room.Info is paired with the pending move. The tracker ruled out the player's own room ("a move leads somewhere else") and mapped it again.
  • A recall or death into a room already mapped twice. The arrival came before the room's text, so the tracker offered "new room" next to the known twins and started an island.

What changed

  • A room shown again is a look. text_denies_move, next to number_denies_move: when the room shown reads exactly like the player's room and the mapped path that way leads elsewhere, the arrival counts as a look. The queued look is answered with it, so later Room.Infos stay paired with their own commands.
  • No new island for an exact match. An arrival no move explains gets no "new room" choice when every candidate reads exactly like it.
  • Fresh copies fold back. A room added during an unsure walk, before its description was shown, folds into the one known room it then reads exactly like (Layout::fold, sharing absorb with the maze collapse). Rooms walked from it move along by the same offset onto free squares. Rooms saved before the walk are never folded, so existing duplicates still go through the manual Join. The join.rs and tracker.rs docs describe this exception.
  • One exact-match rule. Layout::reads_exactly is now shared by candidates, described_match, text_denies_move and branches.

Tests

  • a_room_shown_again_while_a_move_waits_is_not_mapped_twice, a_recall_into_a_room_mapped_twice_starts_no_island and a_room_added_before_its_description_folds_into_the_known_room_it_is fail on main and pass here.
  • a_look_after_a_refused_move_leaves_nothing_waiting fails without the queued-look fix.
  • walking_a_field_of_rooms_alike_in_everything_stays_on_its_map guards a 5×5 field of identical rooms.

Checks

  • cargo test --workspace: all pass, with desktop at 524.
  • cargo clippy --workspace --all-targets: clean.
  • cargo fmt --check: clean.

Follow-ups

  • added_with can move a room placed beside a known room, not just island rooms, in a contradictory walk (crates/mudling-core/src/map/tracker.rs:143).
  • Answering the queued look assumes no Room.Info for a refused move. A game that sends one, with moves typed ahead, drifts by one (crates/mudling-core/src/map/tracker.rs:391).

Reviewed with Wiffletree: 1 full review and 1 re-check, 2 rounds (Tests, Claude, Style)

mhohlios added 2 commits November 2, 2026 22:37
A Room.Info that shows the player's own room again while a move is
pending (a refusal the rules don't recognize, then a look) is now taken
as a look when the room reads exactly like the player's and the map's
path that way leads elsewhere, instead of mapping the room a second time.

An arrival no move explains is no longer offered as a new island room
when known rooms match it exactly, description included.

A room added during an unsure walk for an arrival shown before its
description folds into the one known room it reads exactly like once
the description is read. Rooms already on the map are never folded.
…walk along

When a Room.Info is taken as a look after a move refused in words the
rules don't know, the look queued behind the move counts as answered too,
so later Room.Infos aren't read against the command before them.

Folding a fresh room into its known twin now moves the rooms the unsure
walk added with it by the same offset, onto free squares, so no long
path is left back to its island. A fold keeps self-links the known room
already had.

The exact-match rule (identity, exits and the description shown) lives in
one Layout::reads_exactly helper.
@MHohlios
MHohlios merged commit b5c2175 into main Nov 3, 2026
6 checks passed
@MHohlios
MHohlios deleted the wiffletree/map-stop-duplicating-look-alike-rooms-into-islan branch November 3, 2026 11:54
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