SAGA: A DSL for Story Management

Lucas Beyak and Jacques Carette


Video game development is currently a very labour-intensive endeavour. Furthermore it involves multi-disciplinary teams of artistic content creators and programmers, whose typical working patterns are not easily meshed. SAGA is our first effort at augmenting the productivity of such teams.

Already convinced of the benefits of DSLs, we set out to analyze the domains present in games in order to find out which would be most amenable to the DSL approach. Based on previous work, we thus sought those sub-parts that already had a partially established vocabulary and at the same time could be well modeled using classical computer science structures. We settled on the 'story' aspect of video games as the best candidate domain, which can be modeled using state transition systems.

As we are working with a specific company as the ultimate customer for this work, an additional requirement was that our DSL should produce code that can be used within a pre-existing framework. We developed a full system (SAGA) comprised of a parser for a human-friendly language for 'story events', an internal representation of design patterns for implementing object-oriented state-transitions systems, an instantiator for these patterns for a specific 'story', and three renderers (for C++, C\# and Java) for the instantiated abstract code.

You can download the preprint (submitted to DSL 2011).

The code is available as download (as a .tar.gz). It has been tested under GHC 6.12.3 as obtained from the Haskell Platform 2010.2.0.0. Also required are MissingH-1.0.0 (or later), and parsec-3.0.0 (or later); it has successfully been tested with MissingH- and parsec-3.1.1. Further instructions are in the README.