[Bug] Mapper compares a room only with its first stored description, then falls back to "any shared exit": rooms with day/night descriptions resolve to the wrong room (Genie 4 regression)

Open
#407 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 5 days

@dylb0t is already working on this.

Since Nov 30, 2026.

  • #463 by @dylb0t — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
28/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp, xml
Domain
backend, tooling

Research direction

Start in src/Genie.Core/Mapper/AutoMapperEngine.cs at the tier (c) description match (around L877-L890), the tier (e) description tiebreaker (L911-L929) and the tier (f) title plus exit-overlap fallback (L931-L965), and in MapNode.cs where Description returns Descriptions[0]. Reproduce with a mapper unit test that uses a room stored with two descriptions, night first, and check that a day-text lookup resolves to the right room. Done means both description checks accept any stored variant and the fallback no longer picks the first title match on a shared exit alone.

Written by the indexing model from the issue text.

Description

area:mapper bug est:3-5d P1

What happened

On Himineldar Shel's ice road (Map123), where every room is called Himineldar Shel, Mountain Road, the mapper placed the character in the wrong room. Then:

  • the route sent exits that don't exist ("You can't go there");
  • automapper.cmd decided the character had left the ice and took the ice skates off halfway along the ice road;
  • the character kept slipping and falling;
  • travel.cmd restarted 5 times, always from the wrong room (MAP: 123 | ROOM: 22, 28 or 29), while the character was actually in rooms 50–52.

I checked each room the character entered against Map123_Himineldar_Shel.xml:

  • It was daytime throughout. Rooms 22, 23, 37, 43 and 45–52 each store two <description> elements, the night text first and the day text second. For example, room 51 stores "Nightfall covers the region…" then "Majestic snowcapped peaks…". Every visit showed description 2 of 2, and the game text matched the stored text exactly.
  • The first pass worked, because while a route is being walked the mapper follows the arc from the previous room (tier b), so descriptions aren't needed.
  • It broke when the mapper had to identify the room from scratch in the middle of the road. The character was in room 47 (exits east and northwest) with ice east next, and a fresh #goto restarted automapper.cmd ([script] automapper reloaded). From then on, every recovery (#mapper reset, look, restarting the route) identified the room the same wrong way, so it never recovered.

Why (source at 4a6de10)

  1. Only the first description is compared. MapNode.Description returns Descriptions[0] (MapNode.cs#L8-L16). Both description checks in AutoMapperEngine use it:

    • tier (c), "Disambiguation 2: description match", L877–L890;
    • tier (e), "Description tiebreaker", L911–L929.

    Genie4MapImporter reads every variant into Descriptions, and the MapNode comments say that preserving them matters, but matching never looks past the first. So a room whose current text is any variant other than the first can't be matched by description. With night-first maps like this one that's every multi-description room during the day; with day-first maps it would be every one at night.

  2. The fallback is too loose. Tier (f), "Title + exit-set OVERLAP" (L931–L965), takes the first room with the same title that shares any one exit with the live Obvious paths. On a road of 40 rooms with the same name, that's nearly always the wrong one. Room 47 (east and northwest) resolved to room 22 (southeast and northwest) because both have northwest, and room 22 comes first.

What you expected

Match rooms the way Genie 4 did. Node.Compare (Mapper/NodeList.cs at f41a5a8, L807) requires:

  • the same name;
  • the same number of compass exits, with every compass exit present (ContainsArc);
  • the room text to match any of the node's descriptions (Descriptions.Contains(n.Descriptions)).

Suggested fix:

  1. In tiers (c) and (e), compare against every entry in candidate.Descriptions, not just Description / Descriptions[0].
  2. Make tier (f) stricter: require the same compass exit set (as Genie 4 did), or at least prefer an exact match over a partial one. When several candidates still qualify, treat it as ambiguous (report that the room is unknown or ambiguous, #391) rather than picking the first. A confident wrong room is worse than "unknown": scripts act on it (here, by taking the skates off).

Steps to reproduce

  1. During the day in game, start in Himineldar Shel past room 46 (the ice section of Mountain Road). Wear skates or not; the wrong match happens either way.
  2. Run #mapper reset, or start a #goto (for example to Shard) from a room such as 47, 50 or 51.
  3. $roomid resolves to an earlier Mountain Road room (for example 22) that shares one exit, and the route's first move fails with "You can't go there."
  4. At night the same steps work, because the night text is stored first.

Environment

  • OS + version: Ubuntu 24.04 arm64 (Oracle Cloud Ampere A1), GNOME on Xorg via xrdp
  • Genie 5 version: 5.0.0-beta.9.10.1 + 4a6de10
  • Install type: built from source (dotnet publish -c Release -r linux-arm64)
  • .NET version (source builds only): 10.0.403
  • Connection mode: Direct SGE
  • Map: Map123_Himineldar_Shel.xml from the Genie Maps repository

Logs / session capture

The route restart in room 47 (exits east and northwest; the correct next move is ice east):

Obvious paths: east, northwest.
Next move: ice east
...
[script] automapper reloaded (previous instance stopped)
[script] automapper started (.../Scripts/automapper.cmd)
southeast                                  <- route from room 22, not 47
<<  MOVE FAILED - Type: REAL | Movement: east | Depth: 2
You can't go there.
...
<<  Removing ice skates!  >>               <- mapper now thinks we're off the ice
remove my skates

Later, travel.cmd restarting repeatedly from the wrong room:

* STARTING AREA:
* [Himineldar Shel, Mountain Road]
* MAP: 123 | ROOM: 22                     <- actually room 51
...
At the speed you are traveling, you are going to slip and fall sooner or later.
Your excessive speed causes you to lose your footing.
You end up falling down.
Some ice has hurt your chest in the fall.

Anything else

This was worked out from the session log and the map file, not from #config mapperdebug output. A mapperdebug trace showing the e: / f:title+exit-overlap tiers firing would confirm it, if a maintainer wants one.

Related: #391 (surface room-mismatch details), #398 and #401 (other automapper issues found during the same travel).

Dominant language
C#
Stars
2
Forks
5
Avg merge
4d 3h
Merged PRs (30d)
22

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GenieClient/Genie5

All issues in GenieClient/Genie5

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.