All skills
thedivergentai avatar

/godot-combat-system

@9d6e91e

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, HealthComponent, combat_state, combo_system, ability_cooldown, invincibility_frames, damage_popup.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-combat-system

This session only. Nothing lands on disk.

referenceselite-combat-patterns.md

≈633 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Elite Combat Patterns (load on demand)

MANDATORY for combat telemetry, authoritative multiplayer damage, combo buffers, and in-game hitbox visualization. Golden path remains DamageData → HealthComponent → Hitbox.

Combo buffers

combo_system.gd — windowed StringName buffer; finishers stay normal attacks gated by combo_executed. Wire input via godot-input-handling, not _input hit logic.

Combat state gating

combat_state.gd — can_act blocks attack/dodge overlap. Prefer godot-state-machine-advanced when states multiply.

Damage popups

damage_popup.gd — pool Labels in production; this script shows the tween + crit scale pattern.

Combat telemetry

WHY batch JSON flushes: Writing every hit to disk stalls combat. Batch ~10 events then flush to user://combat_log.json.

combat_logger.gd

Authoritative networked damage

CAUTION: Clients must never apply final damage locally in competitive multiplayer.

networked_damage_manager.gd — request_damage → server validates → client_confirm_hit. Add lag-compensation / distance checks server-side.

Hitbox visualization

hitbox_visualizer.gd — toggle debug_collisions_hint; color attack vs hurt volumes differently.

Inline tutorials (moved — use scripts)

Pattern Script
DamageData payload damage_data.gd
Health + i-frames health_component.gd
Area hit delivery hitbox_hurtbox.gd
AoE / hit-stop combat_system_patterns.gd
Abilities / cooldowns godot-ability-system

Critical hits

Roll crit on DamageData construction before take_damage — keep crit math out of UI.

func calculate_damage(base_damage: float, crit_chance: float = 0.1) -> DamageData:
	var data := DamageData.new(base_damage)
	if randf() < crit_chance:
		data.is_critical = true
		data.amount *= 2.0
	return data

Source: SKILL.md on GitHub

1 warning17d4 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides a comprehensive set of GDScript components for building combat systems in Godot, including health management, hitbox/hurtbox logic, and damage data structures. All external links point to trusted documentation or the author's own repositories, and file operations are confined to standard local game directories.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    3/3 files flagged

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-combat-system