Repository navigation
Map: stop mapping look-alike rooms twice, and fold fresh copies back - #29
Merged
MHohlios merged 2 commits intoNov 3, 2026
Merged
Conversation
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
deleted the
wiffletree/map-stop-duplicating-look-alike-rooms-into-islan
branch
November 3, 2026 11:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
What changed
text_denies_move, next tonumber_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.Layout::fold, sharingabsorbwith 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. Thejoin.rsandtracker.rsdocs describe this exception.Layout::reads_exactlyis now shared bycandidates,described_match,text_denies_moveandbranches.Tests
a_room_shown_again_while_a_move_waits_is_not_mapped_twice,a_recall_into_a_room_mapped_twice_starts_no_islandanda_room_added_before_its_description_folds_into_the_known_room_it_isfail on main and pass here.a_look_after_a_refused_move_leaves_nothing_waitingfails without the queued-look fix.walking_a_field_of_rooms_alike_in_everything_stays_on_its_mapguards 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_withcan move a room placed beside a known room, not just island rooms, in a contradictory walk (crates/mudling-core/src/map/tracker.rs:143).crates/mudling-core/src/map/tracker.rs:391).Reviewed with Wiffletree: 1 full review and 1 re-check, 2 rounds (Tests, Claude, Style)