Godot rpg stats

From thedivergentai/GD-Agentic-Skills · View interactive version

Godot rpg stats is an AI agent skill from the GitHub repository thedivergentai/GD-Agentic-Skills. Expert blueprint for RPG stat systems (attributes, leveling, modifiers, damage formulas) using Resource-based stats, stackable modifiers, and derived stat calculations. Use when implementing character progression OR equipment/buff systems. Keywords stats, attributes, leveling, modifiers, CharacterSt

How to use this skill

Skill file

Available Scripts

MANDATORY by scenario — read before implementing:

- Templates / base attributes → base_stats_resource.gd

- Runtime stack + reactive recalc → stats_component_reactive.gd + stat_modifier_stacking.gd

- Buff/debuff data → status_effect_data.gd (Type.ADDITIVE / MULTIPLICATIVE / OVERRIDE)

- Combat math → damage_formula_handler.gd

[base_stats_resource.gd](scripts/base_stats_resource.gd)

Core data container for base attributes (Str, Dex, Int) and derived scaling rules.

[status_effect_data.gd](scripts/status_effect_data.gd)

Serialized buff/debuff definition using StatusEffectData.Type { ADDITIVE, MULTIPLICATIVE, OVERRIDE }.

[stats_component_reactive.gd](scripts/stats_component_reactive.gd)

Orchestrator for JIT (Just-In-Time) stat calculation with active modifier stacking.

[exp_progression_resource.gd](scripts/exp_progression_resource.gd)

Data-driven level-up curve definition using growth factors and base XP.

[dynamic_stat_label_sync.gd](scripts/dynamic_stat_label_sync.gd)

Reactive UI hook for syncing Labels to stat changes without polling.

[damage_formula_handler.gd](scripts/damage_formula_handler.gd)

Centralized RefCounted utility for complex combat math and damage calculations.

[stat_modifier_stacking.gd](scripts/stat_modifier_stacking.gd)

Logic for handling unique vs. stackable buffs and refreshing durations.

[resource_stat_inheritance.gd](scripts/resource_stat_inheritance.gd)

Pattern for extending base stats with specialized attributes (Elemental Resists).

[persistent_character_stats.gd](scripts/persistent_character_stats.gd)

Managing the serialization of character progression to .tres files.

[level_up_system.gd](scripts/level_up_system.gd)

Logic for awarding experience and triggering level-up benefits.

[rpg_stat_resource.gd](scripts/rpg_stat_resource.gd)

Capped base stat Resource with setter clamps + stat_changed signal.

[derived_stat_resource.gd](scripts/derived_stat_resource.gd)

Derived stat that recalculates when base stat dependencies change.

[equipment_tooltip_helper.gd](scripts/equipment_tooltip_helper.gd)

BBCode equipment comparison tooltips (_make_custom_tooltip).

NEVER Do in RPG Stats


Decision Tree

| Layer | Responsibility | Script |

|-------|----------------|--------|

| Resource template | Designer-authored base attributes, curves, inheritance | base_stats_resource.gd, exp_progression_resource.gd, resource_stat_inheritance.gd |

| Runtime StatsComponent | Duplicate/instance template, apply/remove modifiers, emit signals, JIT derived stats | MANDATORY stats_component_reactive.gd + stat_modifier_stacking.gd |

| StatusEffectData | Typed buff rows (ADDITIVE / MULTIPLICATIVE / OVERRIDE) | status_effect_data.gd |

| DamageFormula (RefCounted) | Pure combat math shared by Player/NPC | MANDATORY damage_formula_handler.gd |

| Persistence | Save progression; strip runtime buffs first | persistent_character_stats.gd |

| UI sync | Labels listen to signals — no polling | dynamic_stat_label_sync.gd |

Do not paste beginner class_name Stats / Dictionary equipment tutorials — route to the scripts above.


API alignment (StatusEffectData)

# Author buffs as Resources — not ad-hoc Dictionary modifiers
var haste := StatusEffectData.new()
haste.name = "Haste"
haste.type = StatusEffectData.Type.MULTIPLICATIVE
haste.attribute = "speed"
haste.value = 1.25
haste.duration = 8.0

var flat_str := StatusEffectData.new()
flat_str.type = StatusEffectData.Type.ADDITIVE
flat_str.attribute = "strength"
flat_str.value = 5.0

var break_def := StatusEffectData.new()
break_def.type = StatusEffectData.Type.OVERRIDE
break_def.attribute = "defense"
break_def.value = 0.0

Stacking / refresh / unique-vs-stackable behavior: MANDATORY stat_modifier_stacking.gd. Apply through stats_component_reactive.gd so derived stats recalc once per change.


Elite reminders (script-backed)

  1. Caps — rpg_stat_resource.gd; clamp on setters; never allow overflow attributes.
  2. Dependency graphs — derived_stat_resource.gd; derived stats recalc from signals when bases change — never _process.
  3. Equipment — Register/remove modifier IDs on equip/unequip via stacking API; tooltips via equipment_tooltip_helper.gd.

Deep dive (load on demand)

Equipment hooks, damage formula, skill gates, elite cap/derived/tooltip patterns — references/elite-stat-patterns.md.

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.

Official Documentation

Related Skills

Prerequisites
Complements
Downstream / consumers
Master
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.