Skip to content

Restore native GSC trainer friendship and source class predicates - #395

Closed
Roxas2712 wants to merge 25 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/upstream-gen2-trainer-friendship
Closed

Roxas2712 wants to merge 25 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/upstream-gen2-trainer-friendship

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 28, 2026 •

Copy link
Copy Markdown

Native Gold/Silver/Crystal trainer battles currently award friendship only from screen entry and only against the sixteen badge leaders. Apply the source pre-turn constructor award to all 22 classes in the combined leader list, including the Elite Four, Champion and Red, over the existing native ordered party references. Fainted, egg and out-of-scope party members are excluded, without constructing another battle or changing a mod.

The older offered host also lacked playerPartyView() and ignored the fourth trainer-constructor argument. Include the real ordered native party-selection prerequisite: lead/doubles, benches, generation-appropriate menus, party-wide effects, EXP/EXP.ALL and defeat use the selected original mons. Preserve the actual save-party table and ordering. A standalone older-host regression drives these production paths; the full trainer-preparation callback feature is not silently claimed here.

Expose the source model's class tables and isGymLeader/isKantoGymLeader predicates. The real native constructor calls the public seam, allowing API2 decorations to reach the existing controller. Imported numeric class identity is mapped canonically instead of comparing translated LEADER names. Keep badge/music/Yellow companion markers separate and other editions/hacks unchanged.

Bring the older host's actual friendship producer onto happiness.changed as well. Source event names (for example GYMBATTLE, not numeric4) and saturated/zero-delta applied-event callbacks match the frozen Gen1 implementation; the cartridge index remains available as eventId. Unchanged walking steps stay silent.

This draft continues the offered native stack: RNG #394, protection #393, volatile #392, priority #390 and their previously documented model/host prerequisites. The offered branch includes those prerequisites; please assess this incremental feature after the preceding changes. No upstream merge is performed by this work.

Validation status:

  • Fork negative baseline: 1,785 meaningful failed checks before the constructor/class fix.
  • Independent frozen Gen1 revision 535a5ec0 comparison on the corresponding fork implementation: 18,636 comparisons, 1,393 actual constructor pairs, 252 other native happiness-event cases; all pass with reference bytes unchanged. An earlier actual numeric4/stringGYMBATTLE mismatch failed and was corrected, not normalized away in the comparison.
  • Corresponding fork source 4e37741e passes the full official ROM-free command: 923/923 engine suites, 4/4 SDK suites, including 24,270 constructor/API2 checks, 30 semantic checkpoint checks and the corrected lifecycle suite. This is a result for that fork source only, not for this older offered host.
  • Independent older-host results on 607a0e77: 24,270/24,270 constructor/API2 friendship checks and 262/262 existing model-contract checks pass. The prior offered head a92fd975 fails directly in the actual constructor with missing playerPartyView, confirming the prerequisite. The separate new scope regression initially queried AI before real screen entry and supplied Gen1-shaped species to NDS constructors; that failed run is retained. The fixture now enters the actual native screen and supplies the correct six-stat/IV species layout without dropping an assertion or edition. On offered source b17a8f1b, the corrected production-path scope regression passes 651/651 checks across all supported editions. A separately executed frozen-Gen1 comparison on this older host also passes 18,636 comparisons / 1,393 actual constructor pairs / 252 event cases, using class identities directly from the pinned frozen Gold/Crystal manifests; the original reference bytes remain unchanged. The independently executed full older-host command now reports 73/84 engine suites and 3/3 SDK suites, with exactly the same eleven baseline failures as the preceding RNG host (71/82); both added suites pass and no new failure is introduced. The retained failures are fingerprint/meta/string gates, quit-thread shutdown, rebind capture/swap, soft reset, tool hooks, update-check/update expectations and wide-battle layout. This is not an all-green upstream baseline or release claim.
  • This host lacks the fork's semantic checkpoint backend; the fork checkpoint test/result is intentionally not copied or claimed here. GPU, complete source model/turn contracts, unchanged-VASC acceptance and exact release packages remain separate requirements.

Contributions by Roxas2712 — https://github.com/Roxas2712. Offered to Cedric / UNDERdecoded under the specific PR permission in LICENSE-ROXAS2712.md, with existing upstream and third-party rights retained.

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