Skip to content

SGL 2026 preset update and altar Ganon BK hint with vanilla LACS crash - #2631

Merged
cjohnson57 merged 2 commits into
OoTRandomizer:Devfrom
Elagatua:feature/sgl-2026
Sep 13, 2026
Merged

cjohnson57 merged 2 commits into
OoTRandomizer:Devfrom
Elagatua:feature/sgl-2026

Conversation

@Elagatua

@Elagatua Elagatua commented Sep 9, 2026

Copy link
Copy Markdown

SGL 2026 is going back to using all locations reachable instead of beatable only. When switching back, I discovered a localization crash that only affects the SGL preset.

Generation crashes during ROM patching for any settings combination that uses Ganon's Boss Key on LACS with the vanilla LACS condition (Shadow + Spirit Medallions) while the Temple of Time Altar misc hint is enabled:

  Patches.py:1802   build_altar_hints(...)
  Hints.py:1947     adult_text += build_ganon_boss_key_string(world)
  Hints.py:2079     "verb": verb_singular if count == 1 else verb_plural
UnboundLocalError: cannot access local variable 'verb_plural' where it is not associated with a value

Two separate problems on the same code path, both introduced by the localization refactor in 56b5047:

  1. build_ganon_boss_key_string() unpacks verb_singular / verb_plural in the non-vanilla lacs_condition branch, but the vanilla branch assigns only item_req_string and count. Both branches then fall through to the shared hint_text.ganon_lacs_bk lookup, which reads the verbs — so the vanilla path raises UnboundLocalError. Fixed by binding the verbs from the ganon_medallions hint text, which matches the Shadow and Spirit Medallions that the vanilla condition actually requires, and keeps the strings translatable rather than hardcoding "is"/"are".

  2. The English ganon_lacs_bk string references {item_req_string}, but the call site passes item_req. Language._resolve_external indexes the externals dict directly, so this would have raised KeyError as soon as the first bug was fixed. The Japanese string and the sibling ganon_grant_bk string both already use {item_req}, so this is just a typo in the one English entry. Fixed in data/lang/property_build.py and the generated data/lang/English/property.json.

The rendered text is unchanged from the pre-refactor behavior: provided by Zelda once the #Shadow and Spirit Medallions# are retrieved.

No preset shipped in presets_default.json on Dev hits this combination, which is why it went unnoticed — it was found via the SGL tournament preset that does.

Testing

  • Reproduced the crash with shuffle_ganon_bosskey: on_lacs + lacs_condition: vanilla + altar in misc_hints; confirmed it is deterministic and seed-independent.
  • The same settings generate successfully after the fix (patch file, cosmetics log and spoiler log all written).
  • Checked the rendered altar string in both English and Japanese. English matches the pre-refactor wording exactly; Japanese is unaffected, as its template does not use {verb}.
  • Unittest.TestLanguageFile passes, covering key parity between property_build.py and the per-language property.json files.

Elagatua and others added 2 commits September 8, 2026 13:47
build_ganon_boss_key_string read verb_singular/verb_plural on the
shuffle_ganon_bosskey == on_lacs path, but the lacs_condition == vanilla
branch only assigned item_req_string and count, raising UnboundLocalError.
Bind the verbs from the ganon_medallions hint text, matching the Shadow
and Spirit Medallions the vanilla condition requires.

The English ganon_lacs_bk string also referenced {item_req_string} while
the call site passes item_req, which would have raised KeyError once the
verb error was fixed. Japanese and the sibling ganon_grant_bk string
already use {item_req}.

Only the SGL 2026 preset combines on_lacs, vanilla LACS and altar misc
hints, so it was the only preset that hit this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cjohnson57 cjohnson57 added Type: Bug Something isn't working Status: Needs Review Someone should be looking at it Component: Hints related to how we help the player Component: Patching Affects the patching of the ROM labels Sep 13, 2026
@cjohnson57 cjohnson57 added Component: Presets Settings and hints presets and removed Status: Needs Review Someone should be looking at it labels Sep 13, 2026
@cjohnson57
cjohnson57 merged commit 6c0c116 into OoTRandomizer:Dev Sep 13, 2026
6 checks passed
@cjohnson57 cjohnson57 added this to the next milestone Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Hints related to how we help the player Component: Patching Affects the patching of the ROM Component: Presets Settings and hints presets Type: Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants