
Statement
Statement: A state machine framework with an in-game visual debugger
Statement turns "what am I doing right now?" logic into clean states (Enter / Update / Exit), and gives you 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).
- 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 mode, heatmaps.
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 both Pulse AND Statement, for only $10.99!
Statement Lens: debug your state machine visually, in-game
Most state machines help you write logic. Statement also helps you see logic.
Statement Lens (the 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 edge, join the Discord and tell me.
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?"
-
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 turns into a pile of "what am I doing right now?" logic. 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 frameworks
Statement is part of a growing suite of GameMaker frameworks that are designed to play nicely together. If you like this style of tooling, you might also want:
- Pulse - a signal and events system with queries! Ask your game a question and anything that might want to provide an answer can!
- 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!
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 | 2 days ago |
| Published | 22 days ago |
| Status | Released |
| Category | Tool |
| Release date | 22 days ago |
| Rating | Rated 5.0 out of 5 stars (1 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:



