background-shape
feature-image

Introduction

Last week I gave my first talk at Imperial College London! Titled “An Introduction to Game State”, I delved deep into an issue that is often overlooked in the world of software, state management. As a software architect for an indie game studio, I find myself designing frameworks frequently, so I wanted to arm my peers with the vocabulary and knowledge to better address and discuss state management.

General Overview

I started off by delving into some examples, explaining the intricacies of state from a hand-on perspective, tied to tangible examples, without overloading the audience with unnecessary details on the theory. The aim here was to introduce the ideas and concepts we would see later on, in a much more friendly, digestible way.

Following this, I discussed the different names we assign to different types of state, in their relevant contexts, including internal/external state, mutable/immutable state, and shared state. These are paradigm specific approaches to managing individual portions of state, so disambiguating their definitions was the big goal here.

I skimmed over issues associated with networking, including the idea of network consistency and latency, and the necessity for some state to be replicated but for some to be private.

After that, I decided to focus more on the paradigm side of things, explaining how paradigm influences state management, and the drawbacks of several industry-standard approaches to the problem. For example, the issues posed by the first-class-citizen of OOP, inheritance, with its propensity to compound internal state down the inheritance tree.

I also gave a general understanding to the audience that games are essentially state machines, composed of many different interlocking substates that interact with each other, leading into a more reactive approach to state management.

The pièce de la résistance of the talk was when it culminated in me displaying one approach to reactive game state management using Observable State Trees, before finally showing my current implementation in ROAST.

Conclusion

In retrospect, the talk went amazingly, albeit with a slightly lower turnout than expected! I’ll just have to canvass harder for my next talk.

If you’re interested, you can find the slides for this talk here.