Godot combat system

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

Godot combat system is an AI agent skill from the GitHub repository thedivergentai/GD-Agentic-Skills. Expert patterns for combat systems including hitbox/hurtbox architecture, damage calculation (DamageData class), health components, combat state machines, combo systems, ability cooldowns, and damage popups. Use for action games, RPGs, or fighting games. Trigger keywords: Hitbox, Hurtbox, DamageData

How to use this skill

Skill file

NEVER Do


Golden Path (MANDATORY)

  1. damage_data.gd — typed DamageData Resource with enum / flags for damage types (no String elements).
  2. health_component.gd — take_damage + i-frame gate + health_changed / died signals.
  3. hitbox_hurtbox.gd / hitbox_component.gd — Area hit delivery into hurtboxes.
  4. combat_system_patterns.gd — duck-typing, hit-stop, nodeless AoE, frame sync.

Do NOT re-inline Hitbox/Health/Combo/Ability tutorials in scenes. Route abilities to godot-ability-system; compose components per godot-composition; FSMs via godot-state-machine-advanced.

Decision Tree

| Task | Load | Do NOT Load |

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

| Define damage payload | damage_data.gd | String damage_type fields |

| HP + i-frames | health_component.gd | Direct health -= n |

| Melee/projectile volumes | hitbox_hurtbox.gd / hitbox_component.gd | Permanent monitoring Areas |

| AoE / hit-stop / duck-type | combat_system_patterns.gd | Spawn temp Areas every tick |

| Ability cooldowns / skill bar | godot-ability-system | Inline AbilityManager novels here |

| Combo buffers | godot-input-handling + state machine | Embedding hit logic in _input |

Damage Type Contract (aligned with NEVER)

# From damage_data.gd — prefer this shape everywhere
enum DamageType { PHYSICAL = 1, FIRE = 2, ICE = 4, LIGHTNING = 8, POISON = 16 }

@export_flags("Physical", "Fire", "Ice", "Lightning", "Poison")
var damage_types: int = DamageType.PHYSICAL

Hitboxes must pass DamageData (or equivalent AttackData built from the same flags), never "Physical" strings.

Available Scripts

Elite Deltas (keep short)

MANDATORY for telemetry, networked hits, combos, and moved inline tutorials: elite-combat-patterns.md. Do NOT Load for first DamageData + HealthComponent pass.

Reference

Progressive disclosure: Skim Official Documentation only for the APIs you are implementing (Areas, layers/masks, Resources, signals, timers, animation hit windows). Open Related Skills when wiring adjacent systems—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.