Skip to content

Introduce Trainer Classes as a First-Class Database Entity #784

Description

@AerunDev

As a game developer,
I want Trainer Classes to be managed as dedicated database entities,
So that I can reuse them across trainers, centralize their translations and metadata, and avoid maintaining duplicated text throughout the project.

Today, Trainer Classes only exist as localized strings stored in the trainer text CSV (100029.csv).

When creating a Trainer, users manually type the class name and provide its translations. As a result:

  • identical Trainer Classes are duplicated many times
  • translations become difficult to maintain
  • renaming a Trainer Class requires updating every occurrence
  • the database lacks a reusable concept representing Trainer Classes.

Pokémon Studio should introduce Trainer Classes as a proper database entity that can be referenced by Trainers instead of duplicating localized text.

Objectives

The MVP should:

  • introduce Trainer Classes as a dedicated database entity
  • centralize translations
  • replace free-text Trainer Class editing by selecting an existing class
  • migrate existing projects automatically
  • prepare the data model for future Trainer Class features.

Acceptance Criteria

Trainer Class Database

  • Trainer Classes become a dedicated database entry.
  • Pokémon Studio provides a dedicated Trainer Class editor.
  • Trainer Classes appear in the database navigation alongside other project entities.
  • Trainer Classes support creation, edition and deletion.

Trainer Class Properties

Each Trainer Class contains at least:

  • Stable identifier (symbol)
  • Localized name
  • Optional maker description (not localized)

The identifier follows the same conventions as other Pokémon Studio database entities.

Trainer Editor

The Trainer editor no longer exposes a free-text field for Trainer Class.

Instead:

  • Users select a Trainer Class from a searchable dropdown.
  • The selected Trainer Class is stored by reference.
  • Changing a Trainer Class updates only the reference.
  • Trainer localization no longer duplicates Trainer Class translations.

Localization

  • Trainer Class names are translated only once.
  • Trainers automatically use the localized name of their referenced Trainer Class.
  • Existing localization workflows remain compatible.

Data Migration

Existing projects are migrated automatically.

The migration should:

  • Detect duplicated Trainer Class names.
  • Create a Trainer Class entity for each unique class.
  • Preserve localized names.
  • Update every Trainer to reference the generated Trainer Class.
  • Preserve project behavior.
  • Avoid unnecessary duplicate Trainer Classes.

Migration should be deterministic and repeatable.

Validation

  • Trainers cannot reference a missing Trainer Class.
  • Deleting a Trainer Class referenced by Trainers is handled explicitly.
  • Users receive appropriate feedback when references become invalid.

Serialization

  • Trainers reference Trainer Classes using stable identifiers.
  • Trainer Classes are serialized independently.
  • Renaming a Trainer Class does not require modifying Trainer data.
  • Existing Trainer identifiers remain unchanged.

User Experience

The Trainer creation workflow should:

  • make Trainer Class selection faster
  • reduce duplicated work
  • improve discoverability of available Trainer Classes
  • remain familiar for existing users.

The Trainer Class editor should remain lightweight and focused on managing reusable Trainer Class definitions.

Identified and Relevant Use Cases

Trainer Creation

  • Creating multiple Trainers sharing the same Trainer Class.
  • Selecting an existing Trainer Class from a list instead of typing its name repeatedly.

Localization

  • Translating a Trainer Class once for the entire project.
  • Correcting a translation in one place.

Future Features

The Trainer Class entity should provide a stable foundation for future enhancements such as:

  • artwork presets
  • battle sprite presets
  • overworld sprite presets
  • default AI level
  • default rewards
  • default battle music
  • other reusable Trainer Class metadata

The MVP only introduces the entity and its reference system.

Out of Scope

This story does not include:

  • default Trainer resources
  • Trainer templates
  • default AI configuration
  • default party generation
  • automatic Trainer creation from a Trainer Class
  • Trainer Class inheritance
  • Trainer Class categories
  • advanced filtering or tagging

These capabilities should be introduced through future iterations.

Product Notes

Trainer Classes represent a reusable gameplay concept and should therefore be modeled as a first-class database entity rather than localized text embedded in Trainer records.

This change improves:

  • data normalization
  • localization maintenance
  • project consistency
  • scalability.

It also aligns Trainer Classes with the overall Pokémon Studio philosophy, where reusable concepts (Pokémon, Moves, Abilities, Items, Maps, etc.) are represented as dedicated entities referenced throughout the project rather than duplicated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    User storyIssues related to a new feature or request

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions