State Machine Trains
An experiment in the Mathbreakers video game
The Mathbreakers game world has tons of potential for fostering exploration of mathematics. For the past year our focus has been educating kids in grades 2-5 by making negative numbers and fractions the core puzzle pieces in the game. But we’re not limited to elementary school concepts — we have designed experimental levels that embody algebra, graphing, trigonometry, calculus, functions, etc. Now that we’re on Kickstarter, we have an opportunity to prove how cool our game can be by prototyping more advanced topics. We decided to spend a few days this week building something interesting in our game:
This is the first in a series of whiteboard-to-prototype demos, and our topic is the Finite State Machine. We called up our friend and mathematics expert Pepe Swer to help us figure out how to design state machines in the 3D math universe that is Mathbreakers.
Our resulting design uses a train to represent the flow of state changes. The train has the input string arranged as a series of cars, each car containing a symbol (0 or 1). The train tracks represent the edges of the graph, and stations on the tracks represent the nodes. At each station, the front-most input value is consumed. Then, depending on what value it was, the tracks have a track-switcher set up to re-route the train along the correct edge.
I should mention that the point of the demo is not to explain Finite State Machines to children. Rather, we want to test the expressive limits of our game world. How much of mathematics can be sensibly represented in 3 dimensions with a player avatar, number primitives, and function machines? We think we’ve provided a compelling alternative visualization of state machines in this demo, plus we preserve all our other game mechanics. For instance, you can alter the values in the trains using any of our math gadgets and tools while it runs, and the switches properly accept the new values.
Coming very soon, we implement a Turing-Complete Machine, the Queue Automaton, in Mathbreakers, using the train as a base.
If you’d like to see the video explaining more about our game world and educational vision, head on over to our Kickstarter page!