Cooking Up Gumbo
written by Kevin Maloney and Sheridan Thirsk of Harebrained Schemes
Our most recent release, Shadowrun: Dragonfall – Director’s Cut (DFDC), features an in-house AI system that we developed called “Gumbo.” In this article, we will detail how Gumbo came about, what our goals for the system were, and how, in the end, it largely accomplished them. We hope that our takeaways from this project will be helpful towards your own turn-based (or real-time) AI endeavors.
First, a little background. After a Kickstarter campaign that ended successfully in April, 2012 with $1.8 million in funding, Shadowrun Returns shipped on July 25, 2013. Seven months later we released a major DLC expansion entitled Shadowrun: Dragonfall, and on September 18, 2014 we released Shadowrun: Dragonfall – Director’s Cut.
The Dragonfall DLC began as a stretch goal in our Kickstarter campaign. However, by the time it went out the door, it had grown into a full expansion that improved on many aspects of the core game.
Both the team and the community responded positively to the improvements in Dragonfall. Still, the team felt that a stronger version of Dragonfall was possible. Thus, we embarked on creating Dragonfall – Director’s Cut. Free to all owners of the DLC, DF-DC was not only an improved version of Dragonfall, it was also now standalone, so new fans could jump right in to our latest and greatest.
When we came up with a list of areas that we wanted to invest in for DF-DC, smarter AI was high up on the list (especially given that combat was also being overhauled). Both Shadowrun Returns and Shadowrun: Dragonfall used AI derived from a branching tree of xml edited in Unity. They also used custom code to read data and perform actions in the game. While this system succeeded in giving a variety of enemies’ basic behaviors, we felt that there was room for improvement on several fronts. With the existing system, any tuning or unique behaviors that designers wanted to make required engineering support, followed by the lengthy process of rebuilding our assets and code. This made iteration very slow and hid the AI agent’s decision-making process from the designers.
In game theory and economics, the term utility describes the ability to satisfy an AI agent’s needs and wants. In our games, we want to maximize agent’s utility in three ways, to reduce amount of damage taken, to assist allies, and to maximize amount of damage to the enemies. Often these goals require a sequence of actions, each with potential random elements and failure points. In an intelligent dynamic world, the AI agents should still make decisions which have high utility.
These were our primary development goals: Easy Safe Expandable and Fast