Skip to content

Custom character stat storing #741

@PlayJeri

Description

@PlayJeri

General description

Problem

Currently custom character stats are stored as absolute values instead of deltas from base stats.

Current behavior

  • Each character document contains stats like hp, attack, shield, speed.
  • These stats are stored as numeric levels
  • Every character has predefined base stat levels.
  • When a character is created, the base stat levels are saved directly in DB.
  • When player levels up a character, the updated stat levels overwrite these values in the DB.

Issue

Because the database stores final stat levels, we lost the distinction between:

  • base stats defined by game balance
  • stats gained through player progression

If we later need to balance a character base stats:

  • We don't know which portion of the stored values comes from the base stats vs. player level-ups.
  • Updating base stats would require complex migrations or would risk breaking player progression.

Solution

Store stat level-ups as deltas from base stats.
Instead of storing absolute stat levels in the database, store only the level-up amounts (deltas) relative to the character's base stats. Then end points that return the custom character stats / levels you return the saved level-ups from db + the character base stats.

Tasks

  • Check if the schemas / DTOs related to character stats need to be updated (documentation or code itself)
  • Update service methods that return character stats to return base stats + stored level ups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    changeChange of the existing functionality

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions