Skip to content

Implement native GBA Disable identity and queued move interruption - #220

Closed
Roxas2712 wants to merge 58 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-disable
Closed

Roxas2712 wants to merge 58 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-disable

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 25, 2026 •

Copy link
Copy Markdown

Native GBA Disable currently chooses a random usable slot, draws 1–8 phases and ages on action attempts. A faster Disable also leaves the already selected attack executable, so public eligibility and actual PP/action behavior can disagree.

Bind Disable to the target's last executed learned move, draw native 0..3 + 2 duration and expire in the actual residual phase before Encore. Follow move identity through reordering and duplicates, retain the restriction at zero PP, and clear removed moves, switches and Transform correctly. Haze preserves native Disable. Interrupt a disabled queued move before PP, confusion and move-used events; clear last-move/multi-turn state, including Bide continuation. Called moves retain their native bypass.

Use the same live identity in move admission, mod.battle:snapshot(), stale-command tracking, UI hints and native AI predicates. Install builtin adapters per dataset before mods capture public handlers, preserving authored overrides/delegation and shared legacy statics. Other generations and legacy authored slot states retain their existing policy.

Include native move/timer in active link state; advertise command revision 5, party codec 1. Independently audit raw fixture 8be423c61a4477a2 → da62fe7b50f40107 using the unchanged #219 hasher with only the revision token changed. Older-generation goldens are unchanged.

Stacks on #219. Gen1 is an unchanged read-only reference; no Gen1 development or publication.

Validation at clean feature runtime 55f4301ab6ef190051b1f6d420f22636a61a1809 (later commits document acceptance):

  • 930 focused checks pass: 768 native command/lifecycle, 108 public-command/delegation/switch and 54 actual link/compatibility. Native protocol also passes.
  • 96 workers / 62,976 paired observations match clean Gen1 535a5ec088c1ae1bf4d91dd3e35a56f64cf46d91. The new Disable mode adds 810 observations per FireRed/Emerald profile, retaining every bounded RNG call/value, all battler HP/PP/learned moves/last moves, actual events and native state. Covers all four slots and duration words, failure guards, custom/duplicate/reordered/removed moves, PP depletion, called/queued/confused execution, Bide/multi-turn interruption, Haze/Transform and residual expiry.
  • Eligibility compares the actual Gen1 native Commands.selectionError with host BattleCommands.reason; it does not invent values for Gen1's omitted GBA snapshot disabled field.
  • Full feature: 116/125 engine suites, SDK 3/3, B30. The exact Counter of all 25 inherited FAIL lines across nine suites equals clean Implement native GBA Encore timing and forced move execution #219 (113/122), with no additions or removed observations. The full command retains its nonzero exit.
  • Unchanged Implement native GBA Encore timing and forced move execution #219 fails both assertions of the same public command: random slot 2 / duration 8, rather than last move / duration 5. Raw negative and exploratory reports remain retained.
  • Two real link roles complete three full turns: Tackle, faster Disable cancelling queued Tackle without PP, then independent Scratch. Every paired completed hash/component agrees; older native rules are refused before party selection.
  • Four CPU-only scenarios with actual local FireRed/Emerald imports pass canonical public enemy-action selection, preapplied/same-turn Disable, public submission, full turn/result queues and residual expiry. Imported accuracy is preserved with a controlled valid hit roll. No caches/ROMs/saves are distributed or normal SAVE issued.
  • Combined runtime abd621282715d072b421e7b30f3f5c60628d771d: 237/237 engine suites, SDK 3/3, B30, the same 96/62,976 comparison and four imported smoke scenarios. Existing native AI-order and item/residual scheduling are preserved.
  • Scoped StyLua, actionlint and whitespace pass.

See docs/native-gen3-disable.md for commands, schema mappings and boundaries. This does not certify broader canceller/locked-move controllers, all Haze/Transform rules, whole-game RNG/VBlank, animations, UI pixels or a full playthrough. Existing prepared-input boundaries remain documented; no RNG calls or differing observations are filtered.

The feature branch is pushed to Roxas2712/Gen2Recomped:codex/gen3-disable. The combined fork publication and hosted CI status are tracked separately from local acceptance.

Published combined snapshot: Roxas2712/Gen2Recomped:codex/portability-testing at 962fca8d879aba0520186acbbb4cb8e95f78cc5d. Changes after the tested combined runtime only add validation/publication documentation. Fork main remains 13af468b97dc37015d14ad5c71d7f067c3ee810d.

All eight hosted workflows currently require maintainer approval (action_required). The dedicated contract run has zero jobs, verified separately; local acceptance does not claim hosted execution. The app's 100-artifact identity cap rejected attachment, but the regular PR remains published and linked.

# 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