This extension provides a framework for implementing game mechanics. It's inspired by Unreal Engine's Gameplay Ability System.
- Installation
- Class overview
- Tutorial (coming soon)
- Clone this repository somewhere into your project files
- Update
ability_system.gdextension
with the path to thebin
folder in your project, if necessary - Open or restart Godot
- Copy the
bin
folder, theassets
folder (for the icons), and theability_system.gdextension
file somewhere into your project - Update
ability_system.gdextension
with the path to thebin
folder and theassets
folder in your project, if necessary - Open or restart Godot
Follow the regular installation steps first.
- Restart your editor
- Make sure
AbilitySystem.cs
is copied somewhere into your project - In Godot's menu bar, click:
Project
→Tools
→Ability System
→Generate C# Bindings
- Build your project
This node can be added as a child to give its parent access to abilities, tags, attributes, etc.
An ability defines an action or skill that can be granted to any node that has a child AbilitySystem
.
- Restore health
- Do an attack
- Find an object
An ability event defines the state of an Ability
after activation. This class controls the ability's Effect
s.
Attributes are a numerical value representing some in-game property.
- Health
- Hunger
- Intelligence
An effect defines what happens in-game when an Ability
is activated.
This is where the bulk of your custom game logic will go. It has access to the AbilitySystem
so an effect can read tags, modify the scene tree, or really anything else.
- For an attack spell ability, the effects could be...
- Decrease the mana attribute
- Play a cool spell animation
- Decrease health of any enemies in the surrounding area
- For an object finding ability, the effects could be...
- Locate the object within the world
- Move character to the object
- Play pick up animation
AttributeEffect
- modifies anAttribute
TagEffect
- adds or removesTag
s fromAbilitySystem
WaitEffect
- arbitrarily delaysAbilityEvent
TryActivateAbilityEffect
- attempts to activate anAbility
on theAbilitySystem
LoopEffect
- runs all the previous effects again
Tags are names that classify and describe the state of an AbilitySystem
node. They can be used together with abilities to create super dynamic states.
spells/is_casting
spells/has_cast_recently
is_sleepy
These classes are mainly used for debugging purposes. They are Control
nodes that can be added to your scene. Each of them export an AbilitySystem
property and will be reactive to changes on that AbilitySystem
. They work both in-editor and in-game.
A container for the other viewer nodes. Displays Tag
s, Attribute
s, AbilityEvent
s, and Ability
s when provided an AbilitySystem
.
Displays Tag
s when provided an AbilitySystem
.
Displays Attribute
s and their values when provided an AbilitySystem
.
Displays AbilityEvent
s when provided an AbilitySystem
.
Displays Ability
s when provided an AbilitySystem
.