ability-system

Installation
SKILL.md

Ability System

Build a data-driven ability system from Godot-native parts: abilities are Resources, an AbilityComponent node owns and runs them, and effects/stats/tags compose on top. No third-party addon required.

Related skills: resource-pattern for the Resource data containers, component-system for the component node pattern, event-bus for cross-system ability events, state-machine for caster states (e.g. casting/stunned), hud-system for cooldown UI.


1. Architecture overview

An ability system in Godot 4.x is built from three collaborating layers:

  • Data layer — Ability (Resource): Each ability is a Resource subclass with exported fields (ability_name, cost, cooldown, cast_time) and two methods: can_activate(caster) -> bool to validate preconditions, and activate(caster) -> void to execute the effect. Storing abilities as Resources lets designers create and balance them in the Godot editor without touching code.

  • Behaviour layer — AbilityComponent (Node): A single node added to any entity that should use abilities. It holds the granted ability set, enforces cost/cooldown, and drives the Ability.activate() call. Four signals keep the rest of the game informed without coupling: ability_activated(ability), ability_failed(ability, reason), cooldown_started(ability, duration), and cooldown_finished(ability). Grant new abilities at runtime with grant(ability) and trigger them with try_activate(ability_name).

Installs
6
GitHub Stars
312
First Seen
9 days ago
ability-system — jame581/godotprompter