Skip to content

Align API-3 GBA enemy-action battler selectors - #191

Closed
Roxas2712 wants to merge 17 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-enemy-action-arguments
Closed

Roxas2712 wants to merge 17 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-enemy-action-arguments

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 24, 2026 •

Copy link
Copy Markdown

An API-3 mod that selects an opponent by battlerId == 3 currently receives a detached battler record on Gen2Recomped. Gen1Recomp supplies a numeric selector (or nil for the native default). Align the GBA API-3 hook input, including the actual single/double controllers.

The public hook now receives (battle, battlerId). Zero-argument next preserves the current request; omitted/nil selectors ask for the native default; explicit selectors cross back to the actual native actor. Nested and reentrant hooks preserve each request's selector, and native errors clean up the scope without retrying AI. API-1/2 native and API-2 unified retain their existing actor argument and identity contracts.

Also retain execution ownership when a hook queries the other flank's native AI: the caller executes the delegated choice and spends its own selected PP slot. Querying the other flank does not spend that flank's PP.

Stacked on #190. Review feature commit 206052fb relative to that prerequisite (11 files).

Validation:

  • 438/438 focused argument checks for FireRed/Emerald: real public SDK, nil/explicit selectors, position-based choices, forwarding, nested hooks, reentry, foreign native queries and actual PP consumption.
  • Actual native single/double turn queues, mixed native/public hooks, API-1/2 legacy identity and native-error cleanup are executed.
  • All existing 1,252/1,252 move-result checks remain green.
  • Pinned unchanged read-only Gen1 reference 535a5ec088c1ae1bf4d91dd3e35a56f64cf46d91: 12 isolated worker runs / 162 paired observations pass, combining the existing API-2/API-3 move-result contract with API-3 argument cases.
  • Full local quick run: 78/88 engine suites versus 77/87 on clean Normalize public GBA enemy move choices and native PP ownership #190. The exact Counter of all 27 inherited FAIL lines across ten suites matches; no new failures. SDK 3/3 and B30 pass.
  • actionlint and git diff --check pass.

Scope: API-3 GBA input selectors and execution ownership. Native output record fields, public item/switch/watch actions, explicit move-target conversion, damage amounts and RNG traces remain separate contracts. Gen1 is used as a read-only reference; no Gen1 patch or publication is required. Hosted CI is reported separately from local validation.

Combined-fork validation: integrated into Roxas2712:codex/portability-testing, production runtime 6bb17f0. All 209/209 engine suites, 3/3 SDK suites and B30 pass. The same 12-worker / 162-observation pinned comparison passes on this runtime; public priority integration remains 32/32. Integration preserves native GBA turn-word preparation, both enemy selections before turn reset, held-item ID translation and identity-roll restore behavior.

Hosted CI: all three workflows report action_required pending maintainer approval. The dedicated contract workflow has zero executed jobs. These are separate from local acceptance.

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.

1 participant