Use Case: Add Emotion Tech to Games With Branching Choices


By: Forest Handford, DevOps Lead

The Walking Dead is a multi-platform game that has become a commercial success, just like the comic book and TV series that inspired it.  TellTale Games is the developer that created the game.  It sold over 1 million copies in the first 20 days.  It is considered one of the most emotional games ever made.  I won’t spoil it for you, but there is a scene you can watch people play on YouTube that causes players to cry while playing.  One of the ways the game makes an emotional impact is by having the player make choices that change the storyline. Those choices come with an emotional investment.

In this screenshot, Lee, the character you control, is talking to Kenny.  Kenny has a wife and son with him that he is trying to protect from the zombie apocalypse.   The image says, “You showed an interest in his family” because I (as a player) had Lee talk to Kenny about his son Duck.  The way I played the game helped me to create an alliance with Kenny.  The dialogue you have in The Walking Dead is from a multiple choice that is time limited.  

While the dialogue enhances player investment, it can also be a clunky interruption from the game’s flow.  If TellTale games were to adopt biofeedback, they could get emotional information from the player without interrupting the story line and changing the UI.  As an example, imagine what would happen when the player has to choose between saving Duck and saving Hershel’s son Shawn.  The player could feel one of several emotions.  They could feel anger, or sadness, at having to choose.  The player could feel joy that Duck is saved.  Some players could feel disgusted that a young boy, who had no apparent value during a zombie apocalypse, was saved.  There could be fear that if they didn’t help Duck, Kenny would drop his offer to drive Lee to his home in Macon.  Perhaps there is contempt because you don’t feel you owe Kenny anything.  Finally, the player could feel surprised that Duck survived, even if the player helped Shawn instead.  Kenny could make note of any of these reactions and the story could be changed because of it.  Here is some sample Unity code of how this could be done (note: TellTale uses their own proprietary engine so they’d need to use our native SDKs, but the code would be similar):

 Transform player;

   PlayerEmotions playerEmotions;


   void Awake ()


       player = GameObject.FindGameObjectWithTag ("Player").transform;

       playerEmotions = player.GetComponent<PlayerEmotions> ();



   void Update ()


       float dominantEmotion = Mathf.Max (playerEmotions.currentAnger, playerEmotions.currentDisgust, playerEmotions.currentSadness,

           playerEmotions.currentJoy, playerEmotions.currentSurprise, playerEmotions.currentFear, playerEmotions.currentContempt);


       if (dominantEmotion <= 5) {

           // "Kenny will remember you didn't care his son almost died."


       } else if (playerEmotions.currentJoy == dominantEmotion) {


       } else if (playerEmotions.currentAnger == dominantEmotion) {

           isAngry ();

       } else if (playerEmotions.currentSurprise == dominantEmotion) {


       } else if (playerEmotions.currentDisgust == dominantEmotion) {

           isDisgusted ();

       } else if (playerEmotions.currentContempt == dominantEmotion) {


       } else if (playerEmotions.currentFear == dominantEmotion) {


       } else {




We have multiple examples of the PlayerEmotions class in GitHub, that the above code relies on.  In order to use this data, you simply import the Affectiva Unity asset, add the Affdex Detector script to a scene’s main camera, and add the Affdex CameraInput script as outlined on the developer portal.

There are many other games that have player tailored storytelling and could adopt emotion recognition in order to determine the storyline.  A game I’m currently enjoying is Life is Strange by DONTNOD Entertainment.  The main character (Maxine) is a photography student whose choices impact the storyline.  She has the power to reverse time, which allows her to change outcomes of events and her decisions.  She has a limit to how far back she can go, so once the player has accepted an event or decision and moved on, there is no turning back.  Here is an examples of this type of decision where she has to decide to answer a phone call from a friend in need or to not answer it so she can spend time with a friend she hasn’t seen for years:


Like The Walking Dead example, Life is Strange could also have the player’s emotions impact the storyline.

Players react to games emotionally; games should also react to player emotions.  This is just one simple example of how our code could be quickly integrated into an existing game. If you want a more targeted use case for your game, please send  details to us at