Skip to content

[DRAFT] Centralize ability balance values for localized descriptions#4032

Draft
Cinnlite wants to merge 8 commits into
keldaanCommunity:masterfrom
Cinnlite:feature/ability-definition-localization
Draft

[DRAFT] Centralize ability balance values for localized descriptions#4032
Cinnlite wants to merge 8 commits into
keldaanCommunity:masterfrom
Cinnlite:feature/ability-definition-localization

Conversation

@Cinnlite

@Cinnlite Cinnlite commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

This draft centralizes ability balance values so gameplay and localized descriptions can use the same numeric source.

It intentionally migrates only five abilities for now:

  • Aqua Ring
  • Blizzard
  • Freezing Glare
  • Protect
  • Struggle Bug

The goal is to validate the approach before migrating the remaining abilities.

Approach

Balance values are stored as plain objects in config/game/abilities.ts.

Ability strategies read values from this config and use AbilityStrategy.computeValue() to select the correct value for the Pokémon’s star level.

Translations retain their existing wording and presentation syntax, but numeric literals are replaced with named placeholders such as {{damage}} and {{freezeDuration}}. The corresponding ability config is passed directly to i18next.

The translation editor resolves these placeholders in its preview and prevents submissions when placeholders or dynamic-value formatting such as SP and LK no longer match English.

Benefits

  • Balance numbers only need to be changed once.
  • Gameplay and descriptions share the same numeric source.
  • Localized wording remains independent for every language.
  • Abilities can be migrated and reviewed incrementally.
  • Translation mistakes involving placeholders or value formatting are detected in the editor.

Trade-offs

  • The central config file will grow as abilities are migrated.
  • Each strategy requires a small adjustment to read its configured values.
  • Specialized calculations and unit conversions remain explicit in the strategy.
  • AP and Luck presentation markers remain in translations because they are interpreted by the existing tooltip renderer.

Cinnlite added 5 commits July 18, 2026 22:55
- derive gameplay and translated descriptions from shared values
- generate the client definition registry automatically
- validate translation placeholders and fallbacks
- migrate Blizzard and Aqua Ring as initial examples
Comment thread app/public/src/pages/component/ability/ability-tooltip.tsx Outdated

export const AbilityConfigs = {
[Ability.AQUA_RING]: {
heal: [20, 40, 80, 160]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would need a way to store the ap/luck scaling info for these numbers. I suggest using the string format convention we already use in translations

suggestion:

Suggested change
heal: [20, 40, 80, 160]
heal: "[20,40,80,160,SP]"

then the computeValue function would take care of parsing this format

@Cinnlite Cinnlite Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on hold: Will remove the different AP Scaling factors from abilities in separate PR and continue with this afterwards.

Comment thread app/core/abilities/aqua-ring.ts
Comment thread app/public/src/pages/utils/ability-description.ts Outdated
Comment thread app/public/src/pages/utils/ability-description.ts Outdated
const expectedFormats = getDynamicValueFormats(englishTemplate)
const actualFormats = getDynamicValueFormats(targetTemplate)
if (expectedFormats.join("|") !== actualFormats.join("|")) {
return `Dynamic value formatting must match English (including SP/LK): ${expectedFormats.join(", ")}`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if those formats per rank are part of the ability config and no longer the translation, no need to validate anything here

Cinnlite added 3 commits July 19, 2026 15:29
# Conflicts:
#	app/core/abilities/protect.ts
#	app/public/dist/client/locales/bg/translation.json
#	app/public/dist/client/locales/de/translation.json
#	app/public/dist/client/locales/en/translation.json
#	app/public/dist/client/locales/es/translation.json
#	app/public/dist/client/locales/fr/translation.json
#	app/public/dist/client/locales/it/translation.json
#	app/public/dist/client/locales/ja/translation.json
#	app/public/dist/client/locales/ko/translation.json
#	app/public/dist/client/locales/nl/translation.json
#	app/public/dist/client/locales/pt/translation.json
#	app/public/dist/client/locales/th/translation.json
#	app/public/dist/client/locales/vi/translation.json
#	app/public/dist/client/locales/zh/translation.json
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