Skip to content

Preserve native GBA party genetics across trades and link battles - #216

Closed
Roxas2712 wants to merge 40 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-party-codec
Closed

Roxas2712 wants to merge 40 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-party-codec

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 25, 2026 •

Copy link
Copy Markdown

The generic link codec rebuilds native GBA Pokémon from the older DV/stat-experience fields. It drops PID, IVs, EVs, nature, ability slot and secret trainer ID. A clean #215 negative control loses all six fields and changes the example's maximum HP from 92 to 67.

Dispatch GBA party serialization to a separate versioned codec. Preserve six-stat investments, personality, selected valid ability slot, original-trainer identity, PP-Ups/current PP, item/ball, friendship, contest/origin data, ribbons, language, markings, Pokerus and extension namespaces. Rebuild stats/nature/gender from authoritative data; auto-level heals HP/status while retaining genotype. Keep both public gender.roll entry points and preserve the native toxic/sleep representation.

Advertise native party revision 1 and refuse older/different codecs before trade or battle party exchange, in either role. Hash the codec revision and include native genotype in active/bench state components. Older-generation codecs/digests stay unchanged. The raw GBA fixture changes from 3a76cc5fce47a5c3 to 2fd444270c3d90db, independently audited using the unchanged #215 hasher plus the explicit new surface token. No golden is reblessed.

This stacks on #215. Gen1 remains an unchanged read-only reference; no Gen1 changes or publication.

Validation on clean feature b1795a79cb03a4de7171d50db93a39ce49dddd64:

  • 194,843 focused checks pass: 194,540 shared codec/hook checks and 303 transport/trade/link checks.
  • 80 workers / 59,394 paired observations agree with unchanged Gen1 535a5ec088c1ae1bf4d91dd3e35a56f64cf46d91. All prior modes remain. The new actual-codec matrix covers 25 natures; levels 1/35/100 plus forced levels; alternate/single abilities; Shedinja; zero/max/mixed IVs/EVs; canonical/raw/translated registries; native metadata and five public gender-hook policies. Only explicit engine ID/stat-key/gender-code schemas are mapped; no compared observations/calls are removed.
  • Full ROM-free run: 100/109 engine suites, SDK 3/3 and B30 pass. The exact Counter of all 25 inherited FAIL lines across nine suites equals clean Align native GBA accuracy and post-hit chance commands #215 (98/107). The combined fork carries their separate repairs.
  • Strict malformed packets return named failures without crashing. JSON/save round trips, actual two-role trade negotiation/application, invalid-row cancellation and older-peer controller refusal are tested.
  • Two complete seeded native-genetics link mirrors verify original sender genotype as well as every completed paired turn hash/state component. Matching equally degraded peer copies would not satisfy these tests.
  • Actual locally imported FireRed/Emerald Poliwag records round-trip all IVs/EVs/stats, selected ability, secret ID/current PP and public API-3 TOX/personality reads in a CPU-only smoke. No imported data/assets/saves are published.
  • Scoped StyLua, actionlint and whitespace checks pass. Original failed/negative reports are retained.

The packet contract is engine-local, with explicit schema mapping in comparisons; this does not assert cross-engine network packet compatibility. Full native egg-legality checks, other-generation codecs, timed side/volatile producers, whole-game RNG/VBlank scheduling and demo controller playback remain separate. No live UI/full-playthrough claim. Reproduction commands and limits are in docs/native-gen3-party-codec.md.

Combined fork acceptance: clean runtime abeaf23461ee80e95a7ff0f9cfd98bb5e5075062 passes 224/224 engine suites, SDK 3/3 and B30. All 80 workers / 59,394 paired observations remain identical there, and the actual imported FireRed/Emerald party smoke also passes. The documented snapshot is pushed as d0e5b52ef2857a7d2eee8c7e662cf38e95d9f46d to Roxas2712/Gen2Recomped:codex/portability-testing. Fork main remains 13af468b.

All seven hosted workflows currently require maintainer approval (action_required). The dedicated contract run has zero jobs. Local acceptance does not claim hosted execution. The app's 100-artifact limit prevented another PR attachment; 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