Td-stategraph-fsm : a graph based FSM

Hey,

I wanted to share a project I’ve been working on : td-stategraph-fsm.

It’s a graph-based finite state machine system for TouchDesigner, built around a visual state graph editor. States and transitions live as nodes, with a clear execution flow and explicit enter / update / exit logic.

This came out of using (and re-using) a lot of different FSM approaches in TouchDesigner over the years, from parameter-driven logic, to DAT-based state tables, ad-hoc Python controllers.
Over time, I ended up with a pretty clear idea of what I actually needed for my own projects.

The system supports nested state machines, different transition modes, and is designed to stay deterministic. I built a complete custom node editor with complete undo redo feature, alignment etc for more fancyness.
I started a 10 days ago, but since vibe-coding exist i got a bit ahead of myself and at this point it’s basically feature-complete on my side.

I’m currently doing final cleanup and locking the v1 behavior. Once that’s done, I’ll share it publicly on ASSET.

If anyone’s curious, or has strong opinions about FSMs in TD (good or bad), I’m happy to discuss.

(deleted the previous post by miss-click)

TouchDesigner_PRNRZOMXbg

TouchDesigner_VB8n2JfRuI

TouchDesigner_nGVIqpb20w

3 Likes

This looks awesome! I’ve built and rebuilt this type of thing many times and I love the UI and workflow you’ve built for this. Excited to play around with it.

1 Like

Thanks !
I still want to implement the dive in/out sub state machine, and maybe add a special timecode controlled transition type for more show oriented applications.

Here is a bit more fanciness from today.

chrome_UZ2mPl2kOr

Discovering beautifull bug whil making GIFs

TouchDesigner_DgQpYM6j1I

Looks incredible! Is there a reliable way to turn off this visual flair and UI cooking during perform mode? Like Matt said I seem to rebuild one of these every large project, but this is a whole other level! Very excited to peek under the hood.

Yes their will be flag to turn off animation while UI is open.

But once the ui is hidden, only runtime code of the statemachine cooks ( one state at a time so pretty cheap 0,02 ms if i remember correctly) and if the state machine is idle, nothing cooks as long as user don’t move nodes as it will recook the wire rendering.