Game State Machine HowTo (emphasis on Unity3d)

This is primarily focused on the overall state machine, like title screen, level screens, and so on, rather than finer-level states of game play.

All the sample code mentioned is available in the same GitHub repository:

I intend to work on that state machine and make something worth publishing to the Unity Asset Store. For now, it’s just here on GitHub.

A taste of the .pdf file:

1 Introduction

A Finite State Machine, more technically called a Deterministic Finite Automaton is a theoretical concept that models a simple robot that follows simple rules. It has been “invented” many times in many different forms over the centuries (Euclid’s straightedge and compass constructions are probably the earliest), but the most common model used in computer programming, and the one used here, was first described in detail in the mid 20th century scholarly paper: Moore, Edward F (1956). “Gedanken-experiments on Sequential Machines”. Automata Studies, Annals of Math. Studies. Princeton, N.J.: Princeton University Press (34): 129–153. (A “Gedanken-experiment” is a thought experiment, done in the head instead of in a laboratory).

In real life, finite state machines occur in lots of everyday products, nowadays controlled by computers but in earlier times, controlled by a mechanical process. An example would be a typical vending machine.

Privacy & Terms