State Graph

An asset by BabaDesBois
The page banner background of a mountain and forest
State Graph thumbnail image
State Graph thumbnail image
State Graph hero image

Quick Information

0 ratings
State Graph icon image
BabaDesBois
State Graph

A Godot plugin that manages state machines & state transitions.It features: - A StateMachine based on nodes - Nested StateMachines - Pushdown Automatas - Automatic animation triggering directly AnimatedSprite - A powerful GraphEditor to handle state transitions - State change based on signals and/or as many conditions you want

Supported Engine Version
3.4
Version String
1.0.0
License Version
MIT
Support Level
community
Modified Date
2 years ago
Git URL
Issue URL

A Godot plugin that manages state machines & state transitions.

It features:

  • A StateMachine based on nodes
  • Nested StateMachines
  • Pushdown Automatas
  • Automatic animation triggering directly AnimatedSprite
  • A powerful GraphEditor to handle state transitions
  • State change based on signals and/or as many conditions you want

This addon is under MIT license which means its free to use/copy/modify etc. If you want to help financally its creator, you can tip him here


💾 Install 💾

You can either:

  • Browse for StateGraph in the AssetLib tab inside Godot, and install it from there, using the Godot's plugin install interface.
  • Clone this repo in a folder addons/StateGraph a the root of your project; then activate the plugin in ProjectSettings -> Plugins

📃 Documentation 📃

You can find a detailed, by class documentation, as well as a tutorial on how to use the GraphEditor here.


🕵️ Overview 🕵️

Basic use

StateGraph is an implementation of the State -also known as Finite State Machine- design pattern.

It uses basically two types of nodes: a StateMachine node that handles its State children, like in this exemple bellow.

README image

You can inherit the State class to associate it with your own logic, or just use basic State nodes if you are doing a StateMachine dedicated to animation for exemple.

If you inherit the State class, be aware that your scripts must have the tool keyword for it to work with the GraphEditor. You can find more informations about how to use the State class and every others in the Documentation.


Graph Editor

The GraphEditor is a tool that runs inside the Godot's editor and allows you to manage & edit the connexions between states as well as standalone triggers.

Connexions can be triggered either by signals or in the _physics_process() of the StateMachine. Additionaly it can take any amount of conditions that must all return true for the change of state to operate.

The graph also implements standalone triggers that works exacly as connexions, but does not need to be in a particular state to trigger.

It is designed to be very flexible and to keep the graph as readable as possible, by minimising the number of connexions you need to make between two states. If it is correcly used, it will prevent you from writing any boilerplate state transition code. (You can still do it by code tho)


README image

A Godot plugin that manages state machines & state transitions.

It features:

- A StateMachine based on nodes
- Nested StateMachines
- Pushdown Automatas
- Automatic animation triggering directly AnimatedSprite
- A powerful GraphEditor to handle state transitions
- State change based on signals and/or as many conditions you want

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
State Graph icon image
BabaDesBois
State Graph

A Godot plugin that manages state machines & state transitions.It features: - A StateMachine based on nodes - Nested StateMachines - Pushdown Automatas - Automatic animation triggering directly AnimatedSprite - A powerful GraphEditor to handle state transitions - State change based on signals and/or as many conditions you want

Supported Engine Version
3.4
Version String
1.0.0
License Version
MIT
Support Level
community
Modified Date
2 years ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers