
Statement (GameMaker State Machines)
Make a statement with your states!
Statement: A state machine framework with an in-game visual debugger
Statement turns confusing "what am I doing right now?" state logic into clean, visible states, coming with Statement Lens: a live, interactable, visual graph debugger you can drive in real time.
- Write clean logic: named states, Enter/Update/Exit, optional Draw (plus customs state events if you want to add them).
- Scale safely: queued transitions, payloads, stacks, history, non-interruptible states, substates, native delta timing (and more).
- Debug visually: debug live in real-time with a live state graph, control the state machine directly through the visual interface, set breakpoints, step through state execution one cycle at a time, heatmaps and more!
Debug visually: 
(Open the first screenshot on the right to see a user drive their state machine through Lens, and even set a breakpoint on a transition they want the state machine to pause on!)
Docs: Full detailed online documentation (Quickstart, common usage & patterns, full scripting reference, integrations with other frameworks by RefresherTowel Games).
Get the Ignition Kit bundle, featuring Pulse, Catalyst AND Statement for a discount!
Or get the Full Suite Pass bundle to get all current and future tools for one low price (price will increase each time a new tool launches, so get in early for substantial savings!)
Statement Lens: debug your state machine visually, in-game
Most state machines help you write state logic. Statement also helps you see state logic.
Statement Lens (a fully interactable in-game visual debugger) lets you:
- View your state machine as a live graph
- Watch transitions fire in real time
- Set breakpoints on state entry or on transition fire
- Pause the machine and step one tick at a time, then resume
- Jump to states live (yes, actually drive the state machine)
- See heatmaps (time spent per state, visits per state)
- Search machines, search states, filter noise, hide labels, hide transitions, show only recent activity, etc
If you've ever said "why is this state doing that" and then spent 45 minutes sprinkling debug messages everywhere...Lens is the antidote.
Note: Lens is new and still getting polish passes, but it is already extremely useful. If you find a janky point, join the Discord and tell me and I'll fix it up!
What Statement does
Instead of this:
switch (state) {
case STATE_IDLE:
// ...
break;
case STATE_MOVE:
// ...
break;
// more cases, more flags, more trouble...
}
You create the machine, create your states, and Statement handles the boring plumbing:
// Create Event
state_machine = new Statement(self);
var _idle = new StatementState(self, "Idle")
.AddUpdate(function() {
image_angle += 1;
});
state_machine.AddState(_idle);
// Step Event
state_machine.Update();
// Draw Event (optional)
state_machine.Draw();
You get clear, named states with Enter / Update / Exit (and optional Draw) handlers, and Statement keeps your flow sane as your project grows.
Key features
-
Clean, fluid API
Fully integrated with Feather to keep the workflow smooth. Simple, single lines of code to create machines and states. -
Named states with built-in handlers
Enter / Update / Exit (and optional Draw) per state. Owner bound, so each instance keeps its own behavior. -
Advanced flow tools (when your game stops being simple)
- Queued transitions: request a state change now, apply it safely later.
- Declarative transitions: attach conditions and let Statement switch automatically when they are met.
- State stacks: PushState / PopState for pause menus, cutscenes, and temporary overlays.
- Transition payloads: pass data with a state change without cluttering instances or globals.
- Non-interruptible states: lock a state so it will not exit early unless you explicitly force it.
- Per machine pause flag: freeze a state machine without tearing it down.
- Per state timers to track durations and delays.
- History: go back, inspect, debug, or just ask "what was I doing a second ago?"
- Add child state machines to states
- Recursively run state machines as deep as you want for any state.
- Natively supports conditions like "Don't exit the parent state until the child state machine has entered a particular state" (perfect for things like "Don't leave attack state until attack animation state has finished").
- Set inheritable pausing so child state machines auto-pause when their parents do.
- Global hooks that you can set when a child state machine starts or stops.
- Plenty more...
-
Works in real projects
- Works with instances or structs.
- Introspection helpers so you can ask the machine what it is doing.
- Delta-time friendly update controls (per machine or global).
- Time scaling (per machine and global) for slow-mo / fast-forward / debugging.
-
Debugging made easier
- Statement Lens: visual debugger (graph, breakpoints, stepping, heatmaps, live jumping).
- Full state history and helpers for inspecting previous states.
- Convenience functions for inspecting and describing the current machine.
Statement also comes with extensive online documentation and multiple playable examples in the package, with heavily commented code.
Why you need Statement
Because at some point, every game needs a well thought out, easy to use state machine. You start with a few innocent proto-states, maybe a switch block or two.
And then two weeks later you have:if (state == STATE_JUMP && can_wall_jump && !is_stunned && ...), a switch block the height of a small apartment building and a bug that only happens when you roll, into a ladder, while taking damage, on a Tuesday
Statement is here to stop that spiral.
Echo debug logger included
Statement includes Echo, a lightweight debug logging framework + debug UI builder for GameMaker:
- Level based logs (NONE -> COMPLETE).
- Tag filters (for example, log only "Physics" messages).
- Per message urgency (INFO, WARNING, SEVERE).
- Optional stack traces.
- Rolling history and one shot dump to a timestamped text file.
You don't need to buy Echo separately if you own Statement. If you only want the logger, Echo is also available as a standalone tool.
Documentation
Statement ships with full online documentation:
- Getting started guides and usage examples.
- A complete scripting reference for the entire public API.
Statement docs:
https://refreshertowel.github.io/docs/statement/
If Statement helps you, leaving a rating on itch is massively appreciated (it helps the page get seen)!
Requirements
GameMaker 2.3 or later (GML with structs and methods).
Support and feedback
If you run into issues or have ideas for improvements:
-
GitHub Issues (bugs and feature requests):
https://github.com/RefresherTowel/Statement/issues -
Discord (questions, discussion, show and tell):
https://discord.gg/8spFZdyvkb
Part of the RefresherTowel Games Toolkits
Part of a growing suite of GameMaker tools that are designed to play nicely together. If you like this style of tooling, you might also want:
- Catalyst - makes modifiable numbers & statistics super easy.
- Pulse - a signals and events framework (supporting queries that allow you to ask questions instead of just broadcast signals!)
- Statement - a state machine framework (with a fully visual in-game debugger).
- Echo - advanced debug logging (level filtering, tags, optional stack traces, history dumps) that now comes with an advanced, yet easy to use debug UI builder!
Get them in the Ignition Kit bundle for a discount! Or buy the Full Suite Pass bundle (get access to all past and future tools) in one go!
I have been dogfooding these tools across my own projects for a long time, and I hope they make your codebase calmer, cleaner, and harder to accidentally sabotage at 2am.
| Updated | 5 days ago |
| Status | Released |
| Category | Tool |
| Release date | 42 days ago |
| Rating | Rated 5.0 out of 5 stars (2 total ratings) |
| Author | RefresherTowel |
| Made with | GameMaker |
| Tags | code, finite-state-machine, framework, Game Design, GameMaker, gml, refreshertowel, sourcecode, state-engine, state-machine |
| Links | Documentation, Discord |
Purchase
In order to download this tool you must purchase it at or above the minimum price of $5.99 USD. You will get access to the following files:
Development log
- Statement v1.3 - State templates & transition hooks10 days ago
- Statement v1.2 - Statement gives birth to children18 days ago
- Statement v1.1 launched! Features Statement Lens: a fully interactable advanced...35 days ago
- Tutorial: Build a Basic State Machine (in GML)39 days ago
- Statement Launch!40 days ago



