The Emotional State Machine

Emotional_AI.jpg

In a recent article I introduced the concept of the branching narrative, or a bending story, as a key feature of a AAA interactive drama product. The player’s actions, interactions and decisions push the content of the storytelling forward in specific predetermined directions based on choices that the player makes.

In this article I want to hypothesise on delivering a different method of bending the story. Rather than producing vast branches of storyline that alternate based on player activity, what if the interactions within the story are bent as a reaction by the game to the way in which the player is perceived by the virtual world according to their actions?

In other words, the sequential presentation of key events does not necessarily change drastically in this scenario and as such the player is a guaranteed recipient of all of the core content which is produced by the studio as part of the game production, but the experience that the player receives within that narrative structure is significantly tempered with during the course of the gameplay by an underlying ‘game intelligence’.

In support of this Keith Stuart cited in 2019, ‘the mainstream future of interactive storytelling is likely to be a clever combination of A.I and authored content: we still get a gripping handwritten plot, but we also get characters and story elements that seem to be reactive to us as individuals’.

Emily Short, a prolific writer, game designer and academic of the subject of narrative structure within interactive storytelling, brings reference to this concept in an article from 2016 in which she coins the phrase ‘Salience-based narrative’, or put simply ‘interactive narratives that pick a bit of content out of a large pool depending upon which content element is judged to be most applicable at the moment’.

On a commercial level, the enquiry of this article addresses a very salient point when considering that the production of a AAA game will run into tens of millions of dollars, possibly even hundreds in the most notable cases. On a executive or publisher level, one would surely question the rationale for producing hours of branching content that may never been seen by much of the audience that experiences the game simply in order to produce a personal story experience for the player through choices. It would be far more palatable for the financier to invest in a system that can react to the player in order to create a unique story-driven experience but within the parameters of a linear or semi-linear narrative environment context.

reactive systemic design

Credit: Harbing Lou & Shannon McArdel - Harvard University

Credit: Harbing Lou & Shannon McArdel - Harvard University

The root of delivering this concept lies in a clever design of artificial intelligence. A.I in video games has been enhancing player experiences since the 1990’s, with the most common role being in the control of non player characters (NPC’s) and enemies in order to make the world around the player appear to have a form of intelligence and reaction to the actions of the player.

As an example and at the most basic level, there is the concept of a ‘Finite State Machine’, which as Harbing Lou cites ‘[in this example] an NPC would begin with ‘wander’ status, and then engage in ‘attack’ if a human player is near. If the player is out of sight, the NPC goes back to ‘wander.’ In other words, NPCs are always wandering when you cannot see them. If a player is attacking back, NPCs can ‘evade.’ If NPCs’ health points are low, they can go ‘find aid’ and then ‘wander’ again’.

Fast forward now to 2018 and there have been some significant advancements in artificial intelligence systems to enable the creation of reactive virtual characters that can track character knowledge and personality traits. Borne out of the genre of interactive fiction, until the most recent generation this A.I has operated as a ‘text based system’, but what is notable is that the technology is emerging to enable voice control of characters, making it a plausible consideration as a system design for virtual character interaction within a AAA context.

Character Engine is a middleware SDK which Kevin Denyer of Spirit A.I, the product developer, describes below. I also encourage you to view the video clip below from a talk by Emily Short at Digital Cultures (2018) for further understanding of the product’s capabilities.

‘Character Engine is a platform for authoring and running dynamic conversations. It is a tool that lets authors create content which can be used by the system to flexibly respond to the user, rather than content that exists only in a fixed structure (such as a dialog tree). The tool exports data which the runtime uses to respond to player input, choosing the best response and plugging into a game engine or other system to perform it.

The engine can work with either natural language input, or generate contextual menu options to show the user. A combinatorial text engine allows either kind of project to make use of dynamic text that can vary in response to the current context.

Character Engine supports a dynamic knowledge model of information about the story world or conversation domain, which the user can naturally query and the system can organically respond to. Authors can easily extend the model's structure, how to recognize and respond to questions, and the data itself using the authoring tool.’

What this emergent technology means to a AAA game developer is that it is now possible to create a reactive NPC using artificial intelligence: one that the player can interactive with via procedurally generated dialogue trees or by their own spoken word. The content that the authoring tool produces in game at runtime, whilst derived from the narrative data that has been authored by the developer during production, can be directly influenced by input data going into the system. For example the actions that the player has taken during gameplay, the choices that the player makes during current dialogue or in past dialogues, external influences or factors that occurred in game and have been measured & recorded as variables: these can all be used to drive the gameplay in a specific direction, thus creating a tailored and emotionally resonant virtual experience that will vary from player to player.

the emotional state machine

I have previously referred to a key pillar of Interactive Drama being ‘storytelling driving player emotion’.

Storytelling drving player emotion.png

In this empirical enquiry, I want to extend that concept so that it becomes a dynamic looping game system. To be specific, the game is tracking the actions and reactions performed by the player in order to establish an emotional player state. In tracking and recording this data it can now feed it back into the game to via the Character Engine in order to influence the dialogue of the engine, and of particular importance here, then use the dialogue outcome from the Character Engine event to trigger the next sequence of narrative events that the player will experience within the game.

In other words the NPC interaction is tailoring the next path (or branch) of the story based in part upon the emotional state variable derived from measurable player interactions. This concept of managing the gameplay sequence and narrative experience through data analytics is a game system that I am calling ‘The Emotional State Machine’.

 
Emotional State Machine_Flow_Chart_1.png
 

If we contextualise this concept then we can see the idea starting to come to life. The player has sight of his emotional state and how it changes through an emotional meter system which is available through the UI interface.

Credit: Until Dawn (Supermassive Games)

Credit: Until Dawn (Supermassive Games)

This idea of evolving emotional measurement throughout a play cycle has been done before within AAA interactive drama. In Supermassive Games’ Until Dawn there is a dynamic meter system, displaying emotional resonance between characters and individual character traits. The data is constantly updated as a result of each interaction that you make between the character you are playing and other cast members.

However the concept of this article is a significant evolution of that game system, whereby the game is using this very same data to affect how the NPC is going to interact with you through procedural generation of the dialogue which is selected from authored story options using the Salience-based narrative approach.

On the basis of the outcome of that NPC interaction, the game adapts your narrative path, sending you on quests or explorations that suit your current situation, then returning you back onto a core narrative path upon completion. In the meanwhile, your expositions have further impact on your own emotional state and game continues to collect historical data, both of which will further inform the delivery of subsequent NPC interactions and gameplay evolution.

In summary to this article, I do understand that this topic introduces a very new & complex evolutionary idea which is right on the edge of executional plausibility in a AAA context. It can be achieved through melding contemporary artificial intelligence systems and procedural character performance systems in order to act as the trigger point to affect the narrative timeline of the game experience. I will continue to explore this further in my studies as I understand this concept would act as the USP of a major AAA game release in the 2020’s, with the potential to cast wider reaching impact upon a generation of AAA game product designs.