Skip to content

refactor: Rework Trainer generation#1394

Draft
innerthunder wants to merge 46 commits into
betafrom
refactor/trainer-generation
Draft

refactor: Rework Trainer generation#1394
innerthunder wants to merge 46 commits into
betafrom
refactor/trainer-generation

Conversation

@innerthunder

Copy link
Copy Markdown
Contributor

What are the changes the user will see?

TBD

Why am I making these changes?

The current Trainer generation system has several glaring issues that limit its usefulness:

  • There is virtually no documentation for the data structures and methods involved.
  • There's no separation between the TrainerConfig data structure and the API for constructing it.
  • The party template system is very rigid, and its role in Pokemon generation isn't immediately clear through the API.
  • Much of TrainerConfig is built around the assumption that Trainers can only be either male or female.
  • The Trainer class has too many responsibilities. As a Phaser sprite subclass, it should at most include methods for the trainer's visual effects, not the ~800 loc dedicated to config access, Party Pokemon generation, and other miscellaneous things.

What are the changes from a developer perspective?

WIP

Screenshots/Videos

How to test the changes?

WIP

Checklist

  • ⚠️ If this is a PR for main (such as a hotfix), has the game version been updated (pnpm update-version:patch / pnpm update-version:minor?
  • Otherwise: I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • Have I tested the changes manually?
  • Are all unit tests still passing? (pnpm test:silent)
    • Have I created new automated tests (pnpm test:create) or updated existing tests related to the PR's changes?
  • Have I provided screenshots/videos of the changes (if applicable)?
    • Have I made sure that any UI change works for both UI themes (dark and light)?

Are there any localization additions or changes? If so:

  • Has a locales PR been created on the locales repo?
    • If so, please leave a link to it here:
  • Have I added the Localization tag to this PR?

If there are no locale changes:

  • Have I made sure not to commit any changes to the locale repo on this branch?

Comment thread src/constants/trainer-constants.ts
Comment thread src/constants/trainer-constants.ts
Comment thread src/data/egg.ts Outdated
Comment thread src/data/new-trainer-config.ts Outdated
Comment thread src/field/enemy-pokemon.ts Outdated
@innerthunder
innerthunder force-pushed the refactor/trainer-generation branch from c4583cf to 4e75c3a Compare December 9, 2025 22:04
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.

2 participants