Quick links: documentation
Versions: GM≥2023.4 (not LTS!)
SnowStateVis is a debugger-visualizer for SnowState, a finite state machine library for GameMaker!
This system is in beta, by which I mean: I wrote most of this code a while ago and I'm not sure if I have forgotten anything important.
- You start a little server that'll be doing coordination between the game and the "watchers".
If you are testing on PC, the game itself can be hosting the server. - One or more games can connect to the server and tell it what state machines they have and what's happening to them.
- One or more "watcher" (read: a webpage) can be opened to observe and manipulate (trigger state transitions) the aforementioned state machines.
Check out the docs!
Overall it's pretty normal code?
For graphs, I build little SVGs.
The arrows occasionally don't quite reach the state-blocks,
but I added a canvas renderer (see debugGraph
) and apparently that's exactly
what comes out of dagre
, so go figure;
There's a Fader
class in the JS portion,
which is because CSS transitions do not offer the desired result
when quickly flipping between states;
There are 4 macros for ports in obj_snowstatevis
total because we need:
- A TCP/HTTP socket that serves files to the watcher(s)
- A WS socket that serves events to the watcher(s)
- A TCP socket for native games
- A WS socket for HTML5 games
3 and 4 can be merged once GM's websocket implementation for native platforms matures a bit more.
1 and 2 could be merged (by doing an "upgrade"), but I don't think that's worth the effort.
- Dark mode
- Support for (similar but different) Goal Oriented Action Planning