Stat System Specification - wwestlake/Steamforge GitHub Wiki

Stat System Specification

Initialization Phase (New Game)

Starting Values

  • All stats begin with a default value of 50.
  • Player is granted 200 points to allocate across available stats.

Rules

  • All 200 points must be allocated before the player may enter the game world.
  • Player may only increase stats during this phase.
  • No stat may be reduced below its initial value of 50.
  • Allocation is performed via WBP_StatAdjuster widgets, each representing a stat.
  • + button is shown on all stats.
  • - button is only enabled for points added during the current allocation session (mistake correction).

UI Feedback

  • Attempting to spend more than 200 points: show message "No points left to spend."
  • Attempting to reduce a stat below its base value: disallowed, no UI.
  • All allocations are reviewed and submitted before game start.

Runtime Progression (In-Game)

Earning Points

  • Players can earn stat points via:
    • Leveling up
    • Achievements
    • Events or quests

Spending Rules

  • Earned points may be held in reserve.
  • Players may spend some points and save others for later.
  • All stat changes must be performed server-side.
  • In-game UI allows stat changes only when points are available.

UI Behavior

  • + button enabled only when player has unspent stat points.
  • - button is not shown during in-game use (no stat reduction allowed).
  • Display includes current unspent point total.

Widget Behavior (WBP_StatAdjuster)

Inputs

  • StatName (Name)
  • StatsComponent (reference)
  • IsEditable (Bool)

Visuals

  • Displays: StatName: Current / Max
  • Shows + if IsEditable
  • Shows - only if stat delta > 0 during setup

Events

  • OnStatAdjustRequested(StatName, Delta) — fired on button clicks
  • DisplayErrorMessage(Text) — called externally to show transient errors

Internal State

  • Tracks:
    • BaseValue
    • CurrentDelta
  • Uses these to determine valid + and - logic during setup

Server Authority

  • All stat changes are validated and applied by the server.
  • UI requests are routed via event delegates.
  • Server checks total point allocation and stat caps.
  • If valid:
    • Applies changes to the StatsComponent
    • Updates widgets with new values
  • If invalid:
    • Sends error message back to widget for feedback