[Bug] `#config automapper true` turns on mapper Record mode; in Genie 4 it only enabled the mapper (compatibility regression, breaks travel scripts)

Open
#401 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
desktop

Research direction

Start at GenieConfig.AutoMapper and MapperViewModel.SyncAutoMapperFromConfig, which copy the #config automapper value into the engine's Record state. Separate the two: #config automapper should only enable or disable the mapper, while Record stays under the toolbar button and #mapper record. Also turn Record off when a zone loads, and check that #mapper reset and #goto behave as the Genie 4 reference describes. Done when a script that runs put #config automapper true leaves Record off and #mapper reset switches zones.

Written by the indexing model from the issue text.

Description

area:mapper area:scripting bug design-question est:<1d P1

What happened

Community scripts written for Genie 4 run #config automapper true at startup. uber.cmd does this in its "set proper Genie flags" block:

put #config automapper true
put #config automapperscript true

In Genie 4 that line just made sure the mapper was enabled (File ▸ AutoMapper Enabled). In Genie 5 it turns on Record mode, so the mapper starts editing the loaded zone in memory while the script walks.

Once Record mode has made changes the user never saved, the mapper can't recover. #mapper reset refuses to reload the zone:

[mapper] Record mode is on and the zone has unsaved changes — not reloaded. #mapper save, then #mapper load to reload from disk.
[mapper] Re-resolving current room…

In my case the character travelled from Hawstkaal Road (zone 126) into Boar Clan (zone 127), but the mapper stayed on the edited Hawstkaal Road zone. It matched [Boar Clan, Split-Log Path] to zone 126's room 24 (Hawstkaal Road, Through the Forest), so $roomid was 24 in the wrong zone. Then #goto 644 (a room in Map127_Boar_Clan) returned DESTINATION NOT FOUND. The script retried every few minutes and never got to its hunting area.

What you expected

#config automapper should do what it did in Genie 4. Scripts and settings imported from Genie 4 rely on it, and full backwards compatibility is expected.

Genie 4 behaviour (source at f41a5a8):

  • automapper is the master on/off switch for the mapper, default true (Lists/Config.cs:38, public bool bAutoMapper = true;). It is the File ▸ AutoMapper Enabled menu item (Forms/FormMain.cs, AutoMapperEnabledToolStripMenuItem_Click). When it is on, game text, input and variable changes are passed to the mapper, which tracks the current room. When it is off, none of that happens, and #mapper/#goto reply "Mapper is currently disabled. Turn it back on in menu under [File/AutoMapper Enabled]" (FormMain.cs, ParsePluginText, Command_EventMapperCommand).
  • Record is a separate toggle: the Record button on the map window, or #mapper record true|false (Mapper/AutoMapper.cs, case "record":). It is off by default.
  • Genie 4 turns Record off whenever a map is loaded (Mapper/MapForm.cs, when a zone loads: ToolStripButtonRecord.Checked = false; // Turn off record. (Needs to be manually turned on when we are in a room on the map, or a clear map)). So a zone change never carries Record mode into the next map.

So in Genie 4, #config automapper true never started recording. A script could run it on every launch with no risk to the maps.

Genie 5 behaviour: GenieConfig.AutoMapper is documented as "record mode", and MapperViewModel.SyncAutoMapperFromConfig copies it into the engine's Record state. #274 wired #config automapper to Record mode on the assumption that automapper was the "auto-map as you walk" toggle, but in Genie 4 it never was. The session-only handling added since then (never persisted, so every launch starts with Record off) doesn't help, because the scripts set it again each time they start.

Suggested fix

  1. #config automapper (and Configuration ▸ Mapper / AutoMapper Settings ▸ Enable) means "mapper enabled" as in Genie 4: room tracking, #goto and #mapper on or off. Default true. It does not change Record mode.
  2. Record mode is controlled only by the Record toolbar button, the Maps menu and #mapper record on|off. Off by default and not persisted, as now.
  3. Turn Record off when a zone loads, as Genie 4 does, so that if it's left on it can't carry edits from one map into the next.
  4. When Record mode is on with unsaved changes, #mapper reset refuses to reload. Consider making that refusal more visible, for example an echo that names the zone and the number of unsaved changes, since it silently leaves a running script stuck on the wrong map.

Steps to reproduce

  1. Run any script that does put #config automapper true.
  2. Walk or #goto somewhere that crosses into another zone, or where the room text doesn't exactly match the map, so that Record mode records an edit.
  3. Run #mapper reset. Genie replies "Record mode is on and the zone has unsaved changes — not reloaded", and the mapper stays on the old zone with a wrong $roomid.
  4. #goto to a room in the zone you're actually in returns DESTINATION NOT FOUND.

Genie 4 with the same script: Record stays off, the mapper switches zones, and #goto works.

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

Logs / session capture

See the excerpts above. The script started with:

* Travel Script v5.6.2
* Start: Hawstkaal Road (MAP:126 | ROOM:102)
* Destination: BOAR
[mapper] Record mode is on and the zone has unsaved changes — not reloaded. #mapper save, then #mapper load to reload from disk.
[mapper] Re-resolving current room…

Anything else

Workaround: comment out put #config automapper true in the script. Room tracking and #goto work without it in Genie 5. If the mapper is already stuck: #config automapper false, #mapper load (discard, don't save), #mapper reset.

Related: #274 (wired #config automapper to Record mode), #391 (surfacing room-mismatch details), #398 (another automapper issue during fast 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.