Skip to content

Expose native Gen2 round clock and share battler data construction - #396

Closed
Roxas2712 wants to merge 34 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/upstream-gen2-round-clock
Closed

Roxas2712 wants to merge 34 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/upstream-gen2-round-clock

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 28, 2026 •

Copy link
Copy Markdown

The source Gen2 battle model lacks its public round clock, and native battler data construction is coupled to picture/animation allocation. Expose the existing native counter (initially zero) and extract data construction into Battler.new; BattleState.makeBattler hydrates that same table through the existing sprite and animation factories. There is no second round counter, RNG stream, turn simulator, copied party Pokemon or replacement artwork.

This is a stacked draft on the separately offered model/RNG/friendship work (#395, #394 and their listed prerequisites). Party/move/stat/registry identities, badges, sleep, form-personal records and the older host's existing Gen2 bindings/poison defaults are retained. It does not depend on the newer fork-only HeldItemRead module.

Validation:

  • Actual older offered-host extraction source281e5185:577/577 fresh plain-Lua checks without LOVE and with presentation modules rejected;810/810 actual wild-constructor and switch checks over the host's15 advertised editions, invoking the real sprite and animation factories.
  • Previous offered-host clock source3e85ef0b:400/400 clock,7951/7951 RNG,210/210 actual native link participant/spectator and262/262 model checks pass independently. Its queue test executes real planner-owned closures in the older host's native insertion context; it does not invent the newer runQueueAction helper. That checkout lacks the newer semantic-checkpoint prerequisite, so the fork-only checkpoint test is not copied here.
  • Development-fork extraction source8025abc7:691/691 no-LOVE and972/972 actual native-construction checks over18 editions; an independent original-versus-extracted native constructor comparison matches all270 data/identity/art-selection cases. Separate fork clock negative probe failed295 of400 before the reader; clock400,link210,checkpoint57 and RNG7951 pass after it.

The latest offered head67a05ea1 adds documentation to the tested extraction. Complete current combined-host/regression/GPU qualification remains pending; the previous complete older-host baseline had11 unrelated existing failures. This draft does not claim upstream CI is green, full source Battle.new/standalone turn execution, arbitrary writable model fields, complete unchanged-VASC presentation or release acceptance. No mod changes and no upstream merge is performed.

Contributions by Roxas2712. The extracted engine data retains original authors' rights and applicable licences. The integration/tests are offered under https://github.com/Roxas2712/Gen2Recomped/blob/main/LICENSE-ROXAS2712.md including its specific permission for Cedric/UNDERdecoded with visible credit; https://github.com/Roxas2712/Gen2Recomped/blob/main/NOTICE.md retains provenance. These terms do not replace earlier permissions or assign ownership of the underlying engine.

@Roxas2712 Roxas2712 changed the title Expose native Gen2 round count through the source battle model Expose native Gen2 round clock and share battler data construction Oct 28, 2026
@Roxas2712 Roxas2712 closed this Nov 4, 2026
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