Make sure you've already gone through a tutorial already as these example projects aren't tutorials. They generally highlight a few interesting features.
Most of these examples use the older (but still good) .csx method of running StateSmith. You can search for ss.cli for newer examples. More will come.
You can generally learn lots from these older examples even if you aren't setup to run the .csx files. There's good stuff in the diagram files and also how the generated files are connected to user code.
Not all projects are listed below. Feel free to explore this directory. A number of the projects in here are straight up experimental. See each project's readme.
Since 2024, I only recommend using .csx files if you need very advanced features of StateSmith like custom modding the state machine graph just before code gen.
See tutorial 2
- trigger-map - short hands for events/triggers.
- parent-alias-1 - useful strategy for commanding a specific state.
ss.cli - multiple state machines in a single diagram - connect state machines together through variables & events.
- sm-design-describer-1 good for git diffs, understanding
Not recommended for beginners.
- multi-lang-2. Single diagram generates code for Python and C++. Custom user pipeline transformations.
- multi-lang-1. Kinda meta. Inheritance of render configs. Inheritance and composition for expansions.
- modding-logging
- custom-triggers
- user-post-process
- visitor-graph-1. Analyze a state machine graph using the Visitor Pattern.
- logging-simple-1. Basic user runtime logging.
- logging-simple-script-2. Easy logging added at code generation phase.
- modding-logging. Advanced code gen logging visible in diagram.
- rtos-event-queue-c
- csharp-space-menu-1 - Advanced menu system with C#. Concurrency. Deep nesting, entry/exit points, parent alias and more.
- mario-sm-3 - Adds invincible star state, history, thwomp. Uses new 0.12.0+ lib features.
ss.clidrawionew - mario-sm-2 - Adds invincible star state and history.
ss.cliplantuml - mario-sm-1
- history-storage-1 Resumes a state machine from a clean start and some storage (file/database/...).
- embedded-solar-1 - Shows how to make a nested menu state machine with PlantUML.
ss.cli - csharp-space-menu-1 - Advanced menu system with C#. Concurrency. Deep nesting, entry/exit points, parent alias and more.
- todo - migrate laser tag example simulation.
- button-simple-1 - Cross platform design. Easy to generate for any desired language. A simple button state machine that can be easily customized to your needs.
ss.cliplantuml - buttons-lights-1 - Multiple button state machines sending events to a light state machine. Arduino simulation.
drawiocsx - plantuml-arduino-buttons
- todo - migrate laser tag example simulation.
- embedded-solar-1 -
ss.cli - button-simple-1 -
ss.cli - rtos-event-queue-c
- todo - migrate laser tag example simulation.
- embedded-solar-1 - Shows how to make a nested menu state machine with PlantUML.
ss.cli - mario-sm-2 -
ss.cli - button-simple-1 - A simple button state machine that can be easily customized to your needs.
ss.cli - c-include-sm-basic-2-plantuml-tutorial -
ss.cli - parent-alias-1 -
ss.cli - plantuml-basic-1
- plantuml-arduino-buttons
- c-include-sm-basic-2-plantuml-tutorial - easy connection between user code and fsm. No expansions needed.
ss.cli - c-include-sm-basic-2-drawio - easy connection between user code and fsm. No expansions needed.
ss.cli - rtos-event-queue-c
- example-drawio-1 repo
- logging-simple-1
- logging-simple-script-2
- csharp-space-menu-1 - Advanced menu system with C#. Concurrency. Deep nesting, entry/exit points, parent alias and more.
- cpp-inheritance-1 - Shows easy state machine testing. Uses a base class.
ss.cliplantuml. - cpp-inheritance-2 - Shows easy state machine testing. Uses custom
ClassCode.ss.cliplantuml.
- button-simple-1 -
ss.cli - embedded-solar-1 -
ss.cli - buttons-lights-1 - Multiple button state machines sending events to a light state machine. Arduino simulation.
drawiocsx - plantuml-arduino-buttons
- TODO: migrate laser tag example simulation.
- mario-sm-3 - Adds invincible star state, history, thwomp. Uses new 0.12.0+ lib features.
ss.clidrawionew - mario-sm-2 - Adds invincible star state and history.
ss.cli - mario-sm-1
- history-storage-1
- Be the first to create an example and send us the link! It can be as simple or complicated as you like.