Godot State Charts
This library is still quite new and has not seen much use yet. While it works reasonably well, there may still be bugs and missing features. Please report any issues you find.
Quick Links
Install from the Godot Asset Libary | Read the manual | FAQ | Godot Engine Discord
What is Godot State Charts?
Godot State Charts is an extension for Godot Engine 4 or later that allows you to use state charts in your game. State Charts are similar to finite state machines, but they are more powerful and avoid the state explosion problem of traditional FSMs.
Features
- Built from scratch for the Godot Engine in an idiomatic way using Godot's nodes and signals. You need very little code to get started.
- Your code only interacts with a single class,
StateChart
which has two methods for triggering transitions and setting properties for expression guards. There is no need to create subclasses or implement interfaces. This makes it easy to integrate the library into your existing code base (or remove it if you find it unsuitable). - Declarative transitions with guards allow you to express complex logic in a simple way without writing any code.
- Transitions can be time-delayed to easily build things like cooldowns.
- Comprehensive in-editor error checking and warnings will help you avoid common mistakes.
- Built-in debug view allows you to inspect your state charts in game while they are running.
- Inactive states will not update every frame for improved performance.
- All states adhere to the pause mode, so state charts will pause when the game is paused.
- Comprehensive documentation with a proper manual and annotated examples.
Attribution
The demo projects use the very nice Pixel Adventure assets by Pixel Frog. Thanks for making them available in the public domain!