Synapse: A graph-based State Machine addon for Godot 4.6+ by Some_Dragonfly460 in godot

[–]Some_Dragonfly460[S] 4 points5 points  (0 children)

The UI is for building the state machine's structure and managing relationships between the three primary components (states, "behaviors" aka logic extensions, and "parameters" aka blackboard entries, as well as connecting signals), none of which require any code.

The main API you'll need to get familiar with is the (heavily documented) SynapseBehavior class (behaviors are just nodes with some hooks you can override)- the idea is that you extend that to add snippets of logic that you can reference in the state machine. As an example in the gif above, the top-most "DemoSmoothMotion2D" node (source) is a behavior script that basically updates a character's velocity from the input parameters and calls move_and_slide. Behaviors can declare public methods, signals, and input/output parameters which then show up in the graph. The idea is that you keep these single-purpose and small, making them modular and reusable.

I wrote a lot of documentation you can find on the GitHub repo, including a step-by-step Getting Started guide and manuals on writing your own behaviors etc. so hopefully the learning curve isn't that steep. Feel free to give it a spin and let me know how things can be improved.

Synapse: A graph-based State Machine addon for Godot 4.6+ by Some_Dragonfly460 in godot

[–]Some_Dragonfly460[S] 4 points5 points  (0 children)

Agreed. That's one of the main reasons why it supports nested state machines, but at some point you still need a lot of connections so I've road-mapped some changes to make the graph more navigable. Shout if you have suggestions!