Skip to content

Align native GBA Choice Band selection, PP ownership and caller provenance - #241

Closed
Roxas2712 wants to merge 93 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-choice-band
Closed

Roxas2712 wants to merge 93 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-choice-band

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 25, 2026 •

Copy link
Copy Markdown

Gen2's GBA path did not bind native Choice Band state or apply the same manual, AI and forced-move selection consumers. Mods could therefore observe different restrictions, selected PP ownership and called-move bookkeeping.

Add the native move-end command and fresh held-effect planner reads, physical-item manual admission, four-slot limitations and ordinary wild selection. Preserve API-1/2 native handles and API-3 positional actions, public stale-offer/refusal paths, and explicit unlimited-enemy-PP rules. Forced actions follow a replaced PP slot; removing that slot still executes the planned attack without spending retired or other learned PP, including Pressure.

Track native versus authored callers through Sleep Talk, Baton Pass and failed Mirror Move. Resolve canonical GBA ctx.callMove("TACKLE") references, preserve caller bookkeeping, and correct GBA Struggle's type handling. Canonical held/planner/speed ordering keeps actual host, guest and spectator simulations aligned with stateful hooks. Native command revision is 11; party codec remains 1.

Stacked on #230. The branch contains that prerequisite; Gen1 is used only as an unchanged read-only reference.

Validation on clean feature 60d5a6fe and combined candidate 83346a19 (subsequent changes are documentation and a CI path filter):

  • Feature: 143/152 engine suites, SDK 3/3, B30; the exact Counter of 25 inherited FAIL lines across nine suites matches a fresh unchanged Align native GBA held damage reads and pre-stage item modifiers #230 parent. Combined: 262/262, SDK 3/3, all quick tiers pass.
  • Each runtime: 148 worker runs / 80,132 identical paired enemy/action observations, 2,040 held-damage command rows, and 6,912 ordinary damage rows, against pinned unchanged native code.
  • All four held-item CI formats pass strict scheduling: API-1 native, API-2 native/unified, API-3 unified (40 workers / 1,914 paired rows).
  • Expanded forced-planning comparison: 276 equal rows; the exact old module fails 24 rows by spending retired PP. Complete captured payloads/RNG/state are retained.
  • Both actual FireRed/Emerald imported-data modes pass, alongside public Loader/menu/stale-intent and real two-turn host/guest/spectator tests. Independent revision-token hash audit, AST-verified formatting, whitespace and actionlint checks pass.

Known limits remain explicit in the scoped contract: a separate actual-script probe still differs in PP visibility/event admission at battle.move_used; successful Sleep Talk still has 10 native versus 11 host held reads. King's Rock/Shell Bell orchestration, successful Mirror Move history/target selection, Metronome catalog/RNG and complete playthrough/graphics parity are not certified here. Raw failures and interrupted matrices are retained separately from the completed acceptance runs. No ROMs, caches or normal saves are included.

Published combined game-testing snapshot: codex/portability-testing at 4d82a31f. Its production, tests, tools and example trees are identical to the accepted combined runtime; subsequent edits only record scope and CI path selection.

Hosted CI: all nine workflows currently require maintainer approval (action_required); the dedicated enemy/action run has zero jobs. Local acceptance above is separate from hosted CI.

# Conflicts:
#	src/mods/Loader.lua
# Conflicts:
#	docs/modding.md
#	src/mods/Loader.lua
#	src/world/WorldAPI.lua
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