RPG Stats is a new systems package added in the 1.5.0 architecture wave.
It provides reusable stat/attribute foundations that can be consumed by inventory, equipment, combat, and UI layers.
What This System Solves
- a consistent “source of truth” for stat definitions and rules
- a shared language for modifiers/effects across gameplay systems
- a stable base for UI (display names, formatting, colors, comparisons)
Includes (High-Level)
- attribute definitions and catalogs
- attribute sets/modifiers/effects
- display configuration and color helpers
- element definitions and relationship tables
- resolver utilities and shared constants
Suggested Mental Model
- Attribute: a single stat definition (HP, Armor, FireResist, CritChance, etc.)
- Attribute set: a collection of attributes on a character/item/context
- Modifier / effect: a rule that changes stats (flat/additive/multiplicative, conditional, duration-based, etc.)
- Elements: typed tags (Fire, Ice, Poison…) plus relationship tables (strength/weakness)
Why It Matters
- centralizes stat logic in one package
- improves consistency across gameplay and UI systems
- enables cleaner integration with Inventory feature modules
Replacing old AttributeData
There is no AttributeData type in RPGStats anymore—use the shape that matches the job:
- Item/equipment modifiers (bonuses on gear):
AttributeEffect — list of AttributeEffectEntry (CatalogKey + additive + multiplier). Inventory uses this on EquipableFeature.Effects.
- Resolved or snapshot values (final numbers per attribute key, e.g. a combat unit after level/buffs):
AttributeSet — call SetValue(string attributeKey, float value) (or SetValue(AttributeDefinitionSO, float)) for each stat; read with GetValue. Replace patterns like new AttributeData() + AddValue with one SetValue per attribute.
Typical Integration Patterns
- Inventory (equipment): item features contribute modifiers; equipment slots apply/remove them.
- UI: preview “equipped vs. candidate” deltas and display element/stat colors consistently.
- Combat: consume attribute sets to compute damage/mitigation (using element relationships when relevant).
Related Pages