Presented by

  • Jon Manning

    Jon Manning

    Jon Manning is the co-founder of Secret Lab, an independent game development studio. He's written a whole bunch of books for O'Reilly Media about iOS development and game development, and has a doctorate about jerks on the internet. He's currently working on the BAFTA- and IGF Seumas McNally Grand Prize-winning adventure game Night in the Woods, which includes his interactive dialogue system Yarn Spinner.


Programmers are used to their compilers catching tiny problems in their code. When you're a writer, it's harder to catch these problems. Wouldn't it be nice if you could run an error-checker on your dialogue? This talk discusses the application of compiler optimisation and correctness checking techniques to branching narratives, which allow authors to verify the logic of their narrative independently of running it in the game. Yarn Spinner is an open source narrative design tool used in many games, including Night in the Woods (Infinite Fall / Finji) and OK KO: Let’s Play Heroes (Capybara Games / Cartoon Network), that allows both writers and narrative designers to write, edit, script and manage their game's dialog using a simple scripting language that's reminiscent of Twine. While most games devise their dialog in script form, it's typically implemented using another system, such as a spreadsheet, or node-based tools. By contrast, Yarn Spinner implements a domain-specific language designed to be easy for a non-programmer to write their dialogue in, and easy for a programmer to implement gameplay-specific behaviour. Compilers for most programming languages are designed to catch common mistakes, and give warnings where appropriate. In recent years, tools for static analysis of programs - a technique where a compiler analyses the behaviour of code without running it - have allowed programmers to detect subtle bugs that a simpler compiler could not. For example, it's possible to identify a combination of branches that lead to an uninitialised variable being returned from a function. Because Yarn Spinner is a complete programming language, we are able to apply the same techniques from compiler design to assist writers. For example, a compiler is able to analyse a branching narrative tree, take into account the variables that are checked to decide what options are available, and determine that a line of dialog can never be reached. These techniques allow for more reliable testing of dialogue. Testing a branching piece of dialogue often relies on the tester repeating a number of decisions in order to set up the necessary state, which can be repetitive and tedious. However, a static analyser is able to identify what the values of certain variables _must be_ in order for a line to be accessed, which allows the tester to jump straight to the lines under test, skipping large amounts of per-test setup time. This allows someone who’s trying to test out a conversation to do it in realistic conditions, skipping past the repetition while also guaranteeing that the state of the dialogue is the same as if they’d performed it manually. In this talk, I’ll discuss work on Yarn Spinner that implements symbolic execution and basic block analysis, which allows writers to easily spot problems in the implementation of their narrative, saving development and testing time, and avoiding wasted production resources. Come and learn how to get started with these techniques, and how to use them in Yarn Spinner, the open source narrative design tool!