Skip to content

Archipelago: apworld, ap-build, client and bridge - #125

Merged
OruizGl merged 9 commits into
nightlyfrom
feat/archipelago-full
Nov 24, 2026
Merged

OruizGl merged 9 commits into
nightlyfrom
feat/archipelago-full

Conversation

@REALAZK

@REALAZK REALAZK commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Full Archipelago support for OOTRR: an apworld, a mod build from the AP patch, and a client that talks to the game.

How it works

  1. ootrr ap-export writes one logic bundle per preset (the compiled world, the shuffled locations, the pool, fixed items, local-only items and a detection rule per location). The apworld (archipelago/ootrr/) runs a Python port of OOTRR's search over it. It matches the Rust search on 200 probe cases across all five presets.
  2. Generation gives each OOTRR player a .apootrr patch. Dungeon items are pre-filled in their own world.
  3. ootrr ap-build <patch> <romfs> <load> --host longshot checks the patch with the Rust search, refuses a world it cannot beat, and builds the mod:
    • other players' items use the Archipelago medallion (a port of Moz's AP logo item), with You found "X" for P! text;
    • received items are mailbox records behind one OOTRR.AP.Pending flag and an OOTRR_AP_Dispatch event, with a Got flag each, so a reload never gives twice;
    • the seed marker leads every OpeningEvent entry, because the intro skip routes around Event3.
  4. The OOTRR Client (CommonClient, in the apworld) starts ootrr ap-bridge, which reads and writes game flags over JSON lines on stdio. It only writes OOTRR.AP.* flags.

archipelago/README.md is the player guide. tools/build_apworld.py packs the apworld.

Any settings (b0f9192)

  • A player may set settings_string instead of a preset. At generation the apworld runs the host's ootrr ap-export --settings for that slot's settings and seed. Presets need no app.
  • names.json holds every possible location and item, so IDs stay fixed for any settings. A Rust test checks 40 rolled settings against it.
  • Locations that take only the slot's own items are pre-filled before the main fill (progression first where filler cannot cover them, then filler). Without it, small custom worlds failed the fill.
  • Tested: Python matches Rust on 1400 probe cases (5 presets plus 30 random settings), 15 rooms with random settings pairs and 15 preset rooms generate, and ap-build accepted all three OOTRR patches of a mixed room. Not played in game yet.

Tested

  • Rust targeted tests for ap:: and chest_targets.
  • archipelago/tests/test_logic.py against Rust probes.
  • A generation sweep of 5 presets x 3 seeds with two OOTRR players plus APQuest.
  • A real MultiServer run with the client over a fake bridge.
  • In game on Longshot (test card 1): the seed linked on a new file, 6 items from APQuest arrived with a normal get, all 4 Mido chests were reported (two holding the other player's items, shown as the AP medallion), and neither a reload nor a client restart gave anything twice.

Not in this PR

  • No entrance shuffle. A settings string needs the OOTRR app on the computer that generates the room.
  • !getitem and item links are not handed over.
  • Dungeon items stay local. No DeathLink.
  • Songs and ocarinas from another world (the get window path) and the goal are untested in game.
  • 31 default-preset locations (mostly minigames) have no detection rule yet and hold only the player's own items.

The AP game name is OOTRR. IDs come from it, so it is frozen once a public apworld ships.

🤖 Generated with Claude Code

REALAZK and others added 9 commits November 24, 2026 20:44
- slice::generate splits its setup into prepare(), shared by the seed
  generator and the new ap::export, so the exported shuffled locations,
  pool and placement rules are the generator's own.
- ap::export writes one bundle per preset: the compiled logic world
  (regions, exits, rules as a small node tree), the shuffled locations
  with the items each may not hold, the pool, the fixed vanilla items and
  which items must stay in their own world. Upgrade families stay off
  spots that give one fixed tier. A test checks the bundle against a
  generated seed.
- ootrr ap-export <out> [--probes <dir>] writes the bundles and, for
  tests, random item sets with what the Rust search reaches.
- slice::edit::build_data takes a Data and an optional staging hook,
  run after every other stage of the build.
- archipelago/ootrr: the apworld. A Python port of the rule evaluator
  and search (it matches the Rust search on every probe of all five
  presets), a preset option, stable ids, dungeon item pre-fill, and one
  .apootrr patch per player. A two-slot generation with APQuest works.

Nothing is tested in game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ap::patch reads the .apootrr patch strictly (format, version, game,
  sizes, keys), checks that its locations are this build's shuffled
  locations for its settings, and runs OOTRR's own search over the
  slot's placements with every item from the other worlds. A world the
  Rust search cannot beat is refused.
- ap::mailbox gives each received item in the style its kind needs:
  the held-up get, the next tier of an upgrade family through the
  progressive chain, or the pouch add and get window for songs and
  ocarinas. Dungeon items are refused, they stay in their own world.
- One shared OOTRR.AP.Pending flag replaces the per-item watchers:
  MainUpdate requests OOTRR_AP_Dispatch and clears it, and the
  dispatcher clears the signalled record's Recv and gives its item only
  while its saved Got flag is false. One EventSetting and one
  GameAnalyzedEventInfo row.
- The AP staging reads the build's work copy of each file, so it lands
  on top of every other edit.
- The build hook now runs through build_for_with and the seed pack
  build. Data takes registered extra items (the foreign item labels),
  and in that mode the chest actor counts are topped up or trimmed
  instead of refused.
- ap::item holds the interface for the foreign item actor with a
  stand-in until the real actor lands.
- ootrr ap-build <patch> <romfs> <load_dir> [mod_name] [--host ...].
  A generated APQuest plus OOTRR multiworld builds its OOTRR mod.
- The apworld labels foreign items by a stable hash, since seed files
  take ASCII names only.

Nothing is tested in game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each foreign label gets a pouch actor Item_AP_<12 hex of sha256(label)>
cloned from the Forest Medallion key item, with its own ActorName, its rows
in ActorInfo, GameActorInfo and PouchActorInfo, and its get texts in every
language. register adds the label to the build data and the flow accept
list, stage writes the packs, rows and texts from the build hook.

Two small helper changes. chest_targets gives a foreign label its own actor
when no vanilla pool holds it. staging::grow_out sizes the files of a pack
the game does not ship from the shipped files inside it, it used to fail
reading the missing vanilla pack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ootrr ap-bridge talks JSON lines on stdin and stdout: hello, read
  (named Bools and 64-bit object keys from one memory snapshot) and
  write (only flags that start with OOTRR.AP.). The client starts it
  itself, so there is no port or token.
- The bundle gives each shuffled location its detection rule: the
  opened flag of each chest copy from OOTRR's catalog, the tracker
  target flags, Gold Skulltula death flags and object keys. Locations
  with no rule are listed as blind, and the apworld lets them hold only
  the slot's own items, which the game hands out itself.
- archipelago/ootrr/client.py: a CommonClient context that checks the
  seed marker, sends LocationChecks and the goal, and delivers received
  items one at a time through Recv and Pending, retrying and setting an
  item aside when the game holds it. Received items map to mailbox keys
  from the finder's slot and location id, starting items by their
  order. Launcher component and an ootrr_exe host setting.
- tests/fake_bridge.py and tests/e2e_server.py: a real MultiServer, the
  OOTRR client over the fake bridge, and a second client as the APQuest
  slot. All 6 items reach the fake game, the checks reach the other
  slot, and the goal reaches the server.

Nothing is tested in game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tools/build_apworld.py exports the bundles with ootrr ap-export and
  packs ootrr.apworld with a container manifest, so Archipelago 0.6.8
  loads it from custom_worlds without the manifest warning.
- archipelago/README.md explains setup, ap-build and the client.
- The dungeon item pre-fill now counts every item the slot owns,
  including ones already placed in other worlds by plando.
- tests/quester_bot.py plays the APQuest side of a test room.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of Moz's medallion clone. The model is a copy of the Fire Medallion
under the project Item_Medal_Arch with the glass, the glaze and the flame
relief collapsed, its six textures renamed Mt_Item_Medal_Arch_*, the albedo
repainted with the Archipelago logo in BC1 and the others set to constant
blocks. Held over Link's head it spins with the wallet's Item_Common
animation. The output matches the Python original byte for byte.

stage_look picks the look and falls back to the plain Forest Medallion when
any logo step fails. staging::grow_out sizes the new model and textures
from the shipped files they were made from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…kers must be reachable

The intro skip routes around Event3 of OpeningEvent, so a marker there
was never set. The seed mark now leads every entry of the opening flow,
and each mark is checked to be reachable from an entry of its flow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-full

Registered extra items now also add their actor to the NPC accept list
on every Data load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A player may set settings_string in their player file. At generation the
apworld runs the host's OOTRR app (ap-export --settings) for that slot's
settings and seed, and builds the world from the bundle it writes. Presets
still need no app.

- ap-export writes names.json, every location of the world with all spots,
  potion and skulltula checks on, the shop table and every item, so IDs stay
  fixed for any settings. A Rust test checks 40 rolled settings against it.
- ap-export --roll <n> <dir> writes random settings bundles with probes, and
  test_logic.py checks the Python search against them (OOTRR_AP_ROLLS).
- Locations that take only the slot's own items (blind, or not a chest or
  NPC reward) are pre-filled before the main fill: progression first where
  the slot's filler cannot cover them all, then filler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OruizGl
OruizGl merged commit 381d3f8 into nightly Nov 24, 2026
1 check passed
REALAZK added a commit that referenced this pull request Nov 25, 2026
Merging #125 after #126 left build_for with both bodies, the frost steps
and the old build_for_with call, so ootrr-core did not compile. The frost
steps now live in build_for_with, and build_for calls it, so seeds and
Archipelago builds both get them.

The DMT Trade Eyedrops rule from #126 read "is_adult andf (...)", which
stops the logic world from loading, so no seed could generate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants