[{"id": 15130, "state": 1, "location": "Room 5", "location_slug": "room_5", "sequence": 8, "name": "Compiling Your Story: Using Techniques from Compiler Design to Check Your Narrative", "slug": "Compiling_Your_Story_Using_Techniques_from_Compiler_Design_to_Check_Your_Narrative", "authors": "Jon Manning", "description": "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?\r\n\r\nThis 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.\r\n\r\nYarn Spinner is an open source narrative design tool used in many games, including Night in the Woods (Infinite Fall / Finji) and OK KO: Let\u2019s 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.\r\n\r\nCompilers 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.\r\n\r\nBecause 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.\r\n\r\nThese 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\u2019s 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\u2019d performed it manually.\r\n\r\nIn this talk, I\u2019ll 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.\r\n\r\nCome and learn how to get started with these techniques, and how to use them in Yarn Spinner, the open source narrative design tool!", "start": "2020-01-16T16:45:00Z", "duration": "0:45:0", "released": true, "license": "CC BY", "tags": null, "conf_key": "35", "conf_url": "https://lca2020.linux.org.au/schedule/presentation/94/", "host_url": null, "public_url": null, "rax_mp4_url": null, "archive_url": null, "archive_mp4_url": "", "twitter_url": null, "comment": "", "start_at": "16:40 16.01.2020"}]