Keywords

1 Introduction

GAM, combining Games and Agent-Based Models (ABMs) in a single research design, is a unique way to investigate complex past, present, or future social phenomena. Using GAM, researchers benefit from the individual strengths of Games and ABMs and their synergistic effect. Games offer engaging environments to generate insights into social dynamics, perceptions, and behaviours, while ABMs support complexity analysis. The GAM field is relatively new and only a few methodological descriptions are available for those who want to venture into it. A recent Systematic Literature Review of the GAM field [15] provides a general description of six research designs to combine Games and ABMs. The designs are organised in two groups: (1) sequential combinations over time, either from a Game to an ABM or from an ABM to a Game, and (2) simultaneous combinations, where either the ABM provides support to the Game (e.g., to calculate the effect of player actions on their environment) or the ABM and the Game are merged into one integrated application. There is no systematic method description of how to implement this latter design (i.e. GAM type 6 ABM \(=\) GAME), which leads to practitioners and newcomers in this field still to largely rely on intuition and on ad hoc solutions (own creations or imitations). This study contributes to filling up this gap and proposes a way to “discipline” the process of transforming an ABM into a Game (i.e. an agent-based game). This study can be used by GAM practitioners who want to increase the learning value of their practices as well as the rigour and transparency of these. Coordinators of research using GAM designs, ABM modellers or game designers can use this study as guidance to structure the collaborative work in interdisciplinary teams that use these designs.

This study uses Quantum Leaper (QL) as an exemplar of GAM type 6 ABM \(=\) GAME. QL is a proof-of-concept video game made in Unity and based on the NetLogo implementation of the known “Artificial Anasazi” (AA) ABM. Here we present an overview of the QL development, highlighting the main design steps. Starting from these steps we propose a high-level reflection framework that integrates conceptual thinking from interdisciplinarity, ABM development, and game design, i.e. the GAM Reflection Framework. To capture the journey of making this framework, we used a storytelling approach to structure the remainder of this paper in a conclusive narrative.

2 The Settings: The Backdrop and Environment for the Story

The setting is the time and the location in which a story takes place. This setting can be very specific, but can also be more broad. In the case of our story, the setting was a foggy place. We reviewed the literature for general methodological advice about how to develop a GAM design of type 6 ABM \(=\) GAME, but were not able to find such descriptions. However, we found several individual examples of GAM studies (e.g. [7, 11]). In order to be able to orientate ourselves through the fog, we decided to use an exemplar of GAM study as our focal point and selected the Quantum Leaper video game for this role (more details about how this decision was taken are given in Sect. 3). From there on, we looked into studies similar to QL, but found only projects where a 3D game interface was used to visualise and query the output of ABMs depicting historical populations (e.g. [3, 16]). After coming to this understanding, the nature of the settings of our story came clearly in sight: we were exploring an uncharted domain, but we had a starting point.

3 The Characters: Their Role and Purpose

A story usually includes a number of characters, each with a different role and purpose, and there is almost always a protagonist and an antagonist or obstacle to overcome. In our story, there were four protagonists, each with their unique set of tools. Some of these tools can be seen as characters on their own right, having the role of deuteragonist, i.e. the constant companion to the protagonist during the journey. The interest in agent-based modelling and games was a common characteristic of the four protagonists. Otherwise, two of these were digital archaeologists and the other two were active in the natural resource management field. The latter were on a quest of disentangling the methodological intricacies of using games and ABMs as a research device for sustainable resource management when they came across the Quantum Leaper. Interested in connecting with the social simulation community, the QL designers joined the quest.

While the antagonist in this story is the difficulty of the disentangling process, the constant companions to the protagonists during their journey were the QL and the “Artificial Anasazi” ABM. QL was used as an (almost) ideal specimen of GAM design type 6 (i.e. an exemplar), as it clearly displayed an agent-based game: an ABM, a game, and the interconnection between the two. The possibility of directly working with its designers had the potential of making explicit the implicit decision-making processes of creating this agent-based game.

Quantum Leaper. QL, a side-project of two of the co-authors of this study, was initiated in 2017 and it was conceptualised as an experiment to embed ABMs into immersive video games, particularly considering the potential of such integrated approach for archaeology. It aimed to demonstrate that ‘playing’ ABMs immersively can reveal new insights about both the model and the system represented. Even though unfinished, QL was presented publicly on several occasions [2], raising the interest of a wide and diverse public, ranging from archaeologists to game designers. QL is based on the NetLogo implementation of the known “Artificial Anasazi” ABM. For more details, see the part of the development files in [1] and Chap. 5 in [6].

The “Artificial Anasazi” (AA) ABM. AA received great attention because of its implications for the socio-ecological resilience in front of climate change. It represents the population dynamics in the Long House Valley in Arizona (USA), between 800 and 1350 AD [4]. Archaeological data shows that the valley was abandoned towards the end of this period and the main hypothesis put forward pointed to climate change as the main cause. To address this and other hypotheses, the model relates a population of households with a simplified maize-based food economy, dependent on soil types and changing humidity conditions. Simulations are evaluated in reference to the historical estimations of population size and distribution per year. The original authors interpreted the results as indicative that climate change alone was not sufficient to explain the abandonment of the valley. The model was first implemented in Ascape, which is now virtually inaccessible, but was later implemented in NetLogo [19] and published in two quasi-equivalent versions: Janssen’s [9, 10] and NetLogo Model Library’s [14].

4 The Journey: The Travel From an ABM to a Game

The QL project was organised into three work packages whose tasks intertwined: (A) ABM replication, adaptation, and extension, (B) Game conceptual design, and (C) Game development.

A. ABM replication, adaptation, and extension

Both versions of AA (implemented in NetLogo 5.3.1) were reviewed and translated to C#, the primary language used for scripting in Unity, a popular cross-platform game engine. The alternative of running NetLogo from a C# script in Unity was considered, but discarded due to its technical complexity and potential licensing issues (i.e., releasing a copy of NetLogo together with the game). Bringing AA to C# and Unity involved these tasks.

A1. Creation of a C# library for ABM. C# is a general-purpose, object-oriented language (i.e., not specialised in ABMs). It has little resemblance to NetLogo’s syntax, lacking most of its key primitives (e.g., the ask command). Thus, the first, and necessary, step in translating the model was the creation of a C# library implementing those NetLogo built-in features used in AA.

A2. Code revision and modification in NetLogo. Code reviewing was guided and complemented with related publications scattered over the last thirty years, including the work done more recently in expanding the original model. By studying the model in detail and translating the NetLogo code line-by-line, the QL development team soon encountered a few issues that had to be addressed before moving to C#. These included the following.

Spatial input data. The files accompanying both NetLogo implementations (e.g., water.txt, settlements.txt) included impossible coordinates for a few “water points” and historical settlements. Given that this issue has a minimal impact on aggregate behaviour and the original raw data is hardly traceable, it was decided to exclude these data entries.

Scheduling and data time-series. The model scheduling was found to be shifted in respect to the palaeoenvironmental time-series data (e.g., adjustedPDSI.txt, environment.txt, water.txt), which regulate agricultural productivity in each year/location in the model. For instance, the data corresponding to the first year (800 AD) is used twice, during the setup and go procedures. The issue was solved by counting setup as the first year and updating the year counter at the start of time steps rather than at the end.

Inheritance of maize stock. In both NetLogo versions, the inheritance of maize stock, happening during household fission, was not functioning as the modellers (presumably) intended. When “fissioning”, the parent household discounts a certain amount of stock, as determined by a parameter (maize-gift-to-child, in NetLogo library’s version). However, the child household receives a different amount, completely unrelated to the parent’s stock. This was corrected by stating a perfect equivalence between the amounts discounted in the parent’s stock and received by the child’s.

After these corrections were made, still within NetLogo, AA produced system trajectories that were already quite different from the originals (Fig. 1).

Fig. 1
figure 1

Difference in trend after the revision of the Artificial Anasazi model in NetLogo. Simulations under two random seeds, 0 and 123, are given as examples

A3. Model adaptation and extension. After reviewing the code and consolidating the game concept (i.e., immersive, first-person, see Sect. 4), it became clear that the original model had to be further modified. These corrections and modifications made the simulation runs to display more path-dependent trajectories, as the success of new households was closely related to the previous success of the parent household. These are the most important changes.

Break up household population into individual members. Households are the atomic units of the AA model. These were modelled as if they were asexual organisms that are born out of a parent organism, give birth to other child organisms, and eventually die of starvation or old age. A household fitness at any given year depends on its stock of food (cultivated maize), the consumption rate per person-year, and the number of people inside. Under this design, the population of a household, e.g., five people, will appear from thin air in a given year (a household is born), generate new fully-populated households under certain conditions (household fission), and then disappear after a certain number of years (household death). However, this conceptualisation was considered an obstacle for designing an immersive game in first-person perspective. The solution was to expand the model by adding a “character” or “person” dimension within households. These characters are not proper agents; they are accounted in array variables inside each household agent (e.g., age \(= {34,25,7,5,1}\), indicate the ages of the five individual members in a household). Characters are the ones being born, having children, and eventually dying, while a household will only “die” if there are no characters inside. On game development, this modification was combined with a controlled random number generator to allow believable characters (with name, age, sex, lineage, etc.) to be tracked in time and space.

Convert constants and parameters. Several household parameters were re-interpreted as parametric or emergent distributions of household members variables. For instance, the consumption of maize per capita, previously applied to all households as a global parameter, became a set of parameters defining a probability distribution from which to draw values for each individual. The QL version of the model is consequently more stochastic, has fewer global parameters, and is less affected by specific parameter settings.

B. Game conceptual design

The main game concept is inspired by the NBC science-fiction television series Quantum leap (1989–1993). Thus, the player is an archaeologist from the future involved in an experimental technique that allows consciousness to time-travel. An accident happens and the player’s consciousness travels to the past, involuntarily replacing the consciousness of a person that lived in the Ancestral Puebloan culture, formally called Anasazi, in the Long House Valley (Arizona, USA) between 800 and 1350 AD. When this happens, the course of history changes. In order to come back to the present (i.e., finish the game), the player has the task to match the games’ course to the historical development (increasing a convergence score). This can be done by incarnating in individuals, immersing into their biographies, and influencing the behaviour of immediate peers through dialogue and social interaction. This combination of context and mechanics was considered the best solution for making the agent-level perspective compatible with immersive gameplay, given the centuries-long scale of simulations. The game flow is represented in Fig. 2.

Fig. 2
figure 2

Quantum Leaper game flow

C. Game development

The Unity game engine was chosen for the implementation of the game, as it is relatively straightforward to learn progressively, allowing for fast development while containing the potential for complexity, both in terms of code and aesthetics (Fig. 3).

These were the major QL development tasks.

Fig. 3
figure 3

Prototype in-game screenshots of the Incarnation scene

In-game management of simulation data. To connect simulations with gameplay effectively, one of the first tasks was to program a system to serialise and deserialise simulation data effectively. During gameplay, the system will create binary files, each containing the state of the simulation at the end of a time step (i.e. year). These files are re-written every time the simulation is run from an earlier year. Simulation data is deserialised when entering the Incarnation scene and used to generate or configure game objects (e.g., age affects characters’ height).

Loading and decorating the 3D landscape. Because AA is placed in a real location (Longhouse Valley, USA), the development team aimed at using real-world spatial data to configure the 3D space experienced during character incarnation. However, this presented three sets of challenges: (i) finding a Digital Elevation Model (DEM) with a good-enough resolution, importing it to Unity, and making it realistic when experienced from the first-person perspective; (ii) applying terrain textures and adding the scenery (natural environment, buildings, and characters) through procedural generation; and (iii) loading and deleting terrain chunks seamlessly around the moving player, which is required given the large size of the entire valley area. After overcoming these challenges, a set of Unity-C# assets were developed and released [1].

Dialogue system. An interactive narrative system using Twine-Tracery (the grammar-expansion library Twine combined with the interactive fiction tool Tracery) was employed to mediate between player and non-player characters. The player’s decisions regarding dialogue options feed information back to the simulation by modifying certain variables (e.g., convincing characters to eat less will decrease the consumption of maize of those individuals).

Artistic assets. Audiovisual elements (e.g., 3D models, textures, text, sound effects) in games are critical for player immersion. In QL, the development team used Unity’s own sponsored community (Unity Asset Store), which includes several basic free assets that can be used for learning and prototyping.

User interface (UI) and game system. A minimal UI and game system were created for QL using the resources found in Unity Asset Store, including a splash and start screen, options and game start menus, a loading screen, player controllers, and a HUD (heads-up display) showing the current year and convergence percentage in the top-right corner of the screen.

QL has been developed as a side project and remains as an unfinished and unpublished prototype. This project still lacks a functional system and text base to handle dialogues, which is the primary action during gameplay and a key factor for immersion. Additionally, to reach QL’s full potential, artistic assets should be curated by experts about the Ancestral Puebloans (e.g., anthropologists, archaeologists, native community representatives).

5 The Conflict Resolution: Where the Protagonist Finally Overcomes the Conflict, Learns to Accept It, or Is Ultimately Defeated by It

At the resolution point, usually the story ends. The protagonist fulfills the initial goal, does not fulfill it, or transforms it. In our case, after a close analysis of the journey, we propose the GAM Reflection Framework and invite the reader to discuss its usefulness.

How to describe in a meaningful way the integration of an ABM with a Game? Answering this question was not an easy nut to crack. As a first contribution to this answer, we propose a reflection framework. As explained by Rapoport, “[...] frameworks are neither models nor theories. Models describe how things work, whereas theories explain phenomena. Frameworks do neither; rather they help to think about phenomena, to order material, revealing patterns...” [13] (page 256). After closely examining the development of QL, especially the last sentence sounded appealing to us: as a first step in the GAM method, we think that one has to go through a structured reflection about what is being combined, how, and why. Reflection is considered the key learning activity to transform concrete experience into abstract concepts, to generalize main ideas and principles [12]. Moreover, reflection is a process that utilizes knowledge that “lies deep within (tacit knowledge)—so deep it is often taken for granted and not explicitly acknowledged, but it is the data humans use to make instinctive decisions based upon accumulated knowledge from past actions and experience” [8](page 22). As such, it seems to us of crucial importance to have useful tools that guide this process, especially in a tangled process such as using GAM designs.

The process of combining ABMs and games in a GAM design can be understood as a process of interdisciplinary research, in the sense that it involves disciplines with contrasting paradigms, forcing researchers to cross subject boundaries in order to create new knowledge, theory, and/or methods and solve a common research goal [17]. As such, the GAM Reflection Framework is an adaptation of the protocol for assessing the interdisciplinarity of models proposed by [18], which maximises the extraction of implicit knowledge and decisions. However, proposing tools seems easier than applying them. Thus, in order to give a taste of its applicability and encourage its use, we provide a demonstration on the QL case, which, out of space consideration, is included directly in the framework (Tables 1 and 2).

Table 1 The GAM reflection framework (Part 1) applied to the case of Quantum Leaper
Table 2 The GAM reflection framework (Part 2) applied to the case of Quantum Leaper

The core assumptions of the GAM Reflection Framework are: (1) that the analysed application includes an ABM (pre-existing or developed from scratch); (2) that the analysed application includes a Game, with all the necessary elements of a game (e.g., mechanics, dynamics, aesthetics); (3) that both the ABM and the Game co-exists and are integrated in one single application; thus, they run simultaneously; (4) that the GAM design has a research purpose.

The GAM Reflection Framework is divided in two parts: reflections structured around the interdisciplinarity of the endeavour (Part 1 Formal reflections; Table 1) and reflections structured around the general process of building the agent-based game (Part 2 General reflections; Table 2). While reflection are usually undertaken at the end of a task or activity, we encourage the possible users to use this framework before, during, and/or after the GAM design process is finished. We base this recommendation on findings from research on learning, which explain that in order to make reflection useful for development of cognitive levels and not only of the affective levels, reflection should be implemented in a well-structured, intentional manner with purposeful fidelity throughout the course of activities [5].

We envisage four types of users of the GAM Reflection Framework: GAM practitioners, coordinators of research that includes GAM designs, ABM modellers, and game designers. GAM practitioners can use the framework to increase the value of learning from their own practices, in addition to increasing the rigour and transparency of these practices. Using the framework can also help these users to express clearly the interdisciplinary characteristics of their agent-based game. Coordinators of research that includes GAM designs can use the tool to plan the research tasks, while ABM modellers and game designers can use it as guidance to structure the collaborative work in interdisciplinary teams that use these designs or to assess whether such work is something that they want to add to their portfolio.

6 Conclusion

Building on experience with interdisciplinary research, on insights from using reflection as a learning tool, and the description of the steps taken to transform the NetLogo ABM “Artificial Anasazi” into a Unity-based immersive first-person video game, Quantum Leaper, this paper attempts to “discipline”, or bring some methodological organisation, in the field of combining ABM and Games. As such, this study provides a framework for reflections during the process of combining these two. We aim at contributing to the discussion and consolidation of methodological principles that are generally applicable to research using GAM, the GAM Reflection Framework. We present a brief demonstration of this framework by examining the Quantum Leaper video game. This framework is intended as a tool that can be combined with other approaches and frameworks, contributing to the GAM field development. The framework is a potentially learning-rich tool for GAM practitioners, coordinators of GAM designs-based research, ABM modellers, and game designers alike.