Dynamic Difficulty Adaptation in Digital Games using Emotions and Narratives

Carol Salvato
EmotionAI
Published in
7 min readFeb 14, 2021

Digital game technologies are in constant development, from the arcade times to the present day where they are found on smartphones, tablets, computers, and the most diverse devices. Its constantly expanding market is one of the largest in the entertainment industry. And as if the great recent success of the market were not enough, there was also a great growth in the field of study and development of serious games. With objectives of use games that go beyond entertainment, applied in diverse fields, like education, training, health, and science, for example, games that serve as an environment for the application of intelligent systems [1, 2, 3].

The use of intelligent systems along with digital games is present in the history of Artificial Intelligence. One remarkable example happened in 1994, Garry Kasparov (until then chess champion) was defeated in a Chess game by the IBM Deep Blue computer [4], and when Lee Sedol (Go champion) was defeated by the AlphaGo system of company DeepMind in the board game Go, in 2016 [5].

The games are being very useful in the testing and applications of smart systems, and they also benefit from the evolution of smart system technologies. The advancement of Artificial Intelligence and other technologies helps in the development and games quality, making it possible to develop more realistic, intelligent, and challenging Non-player Characters (NPCs). The use of Affective Computing has been making NPCs more affective, interactive, and improving the immersion and player interest, making the experience more realistic in simulated universes of digital games [6].

Affective Computing is a field of study that seeks to identify and reproduce emotions using computing. Main efforts in the field involve the developed ability to identify human emotion to evaluate the quality of a certain product. Simulating emotions in 3D agents bringing a more friendly feeling to people when interacting with artificial avatars. It has also been used in conjunction with intelligent systems, in an attempt to use emotions for decision making [7, 8, 9].

In digital games, affective computing can be used in several ways. Among them in the development of facial expressions for NPCs in three dimensions, and in the development of more friendly interfaces, or in enemies control [2, 3, 6, 10].

An application that uses affective computing with machine learning is in the development of a dynamic adjustment of game difficulty level, based on the current player emotional data. This application works on problems caused by the way the level of difficulty is currently selected in most games. The increase in the level of difficulty is progressive (changes as the player progresses in-game) or is fixed, being selected at the game beginning. This can impair the player’s experience, often causing frustration, or boredom if it is too easy. Figure 1 graph from Zohaib’s paper [11] illustrates the concept of the flow channel, the ideal difficulty space according to the player’s expertise. The progressive increase in difficulty can fail since each player has their learning curve. For some players, this increase can be too fast making the game very difficult, and for others it can be slow, making the game very easy.

Figure 1 — Flow Channel (Image extracted from: [11]).

Figure 1 — Flow Channel (Image extracted from: [11]).

Narrative games have been gaining strength in the market. The narrative concept is described as a story or part of it, that is being narrated or transmitted in some way. In games, the narrative can be presented to the player through a character inserted in the story and controlled by the player. The narrative can be a static, unique story or dynamic, a set of stories passed through missions. The main idea in this style of play is to involve the player, make him feel part of the story. So it is important to have a focus on immersion and realism [12, 13].

In the paper of Mohammad Zohaib, it is said to be important that the change in difficulty based on emotions is not perceived by the player [11]. Therefore, proposed to use the narrative as an intermediary in making the change, avoiding the player’s perception of a pattern and also avoiding the immersion break. The first step in building this application is to collect data that allows the system to understand current player emotions [3, 7, 8]. There are several theories and techniques for interpreting human emotions [7, 8]. It can be done through texts, tone of voice, or images of facial expressions captured through a webcam. Once the player’s current emotion is understood, an analysis of recent game data (e.g. number of wins and losses) should be made to conclude the reason. This way it will be defined if the game should intervene by inserting a new narrative whose difficulty is more similar to the player’s skill level (Figure 2).

Figure 2 — Model representing changing the narrative using emotions (Image prepared by the author).

Figure 2 — Model representing changing the narrative using emotions (Image prepared by the author).

Let’s think about a more practical example, imagine the player is venturing into a game. When he finds himself among enemies of a level much higher. After some attempts to win the battle, the system should perceive emotions such as frustration, anger, boredom, or unhappiness. Added to the number of player failures, it will show a situation in which the system should intervene. The negative emotion added to a large number of current failures indicates a very high difficulty. The new narrative of lower difficulty will be selected by the system and sent in the format of a Non-Player Character that will intervene in the current narrative. Continuing our example, already frustrated during a difficult battle, the player hears someone approaching. A powerful hunter who lives in those parts appears and helps the player to chase away the enemies, who promise to return to take revenge at another time. Now safe and in debt to the hunter, the player will receive a task that will pay his debt. The request will take to another adventure, in a less dangerous place, and with weaker enemies. This will help the player to become more skilled and closer to being prepared for challenges that once frustrated him.

This is an example of how the narrative will change along with the game difficulty level. When emotional feedback is positive, it is known that the current narrative is fulfilling its purpose and can be continued. The use of dynamic difficulties guided by narratives and emotions can make games more adaptable according to the individual rhythm of each player, bringing a more satisfying feeling of gameplay.

Going beyond entertainment, the proposal presented by affective computing applications in digital games can also help serious games. In the area of education, there is the possibility of measuring the student’s interest in the content, and the quality of learning, modifying the content according to the needs of each student. In health, games help with psychological treatments or even physical training can have their intensity and level of exigency controlled according to the player’s emotional feedback being treated. The development of such technologies can help more than the only games, bringing great scientific and technological contributions.

References

[1] Fleury, A., Nakano, D. and Cordeiro, J. H. D., (2014) “Mapeamento da Indústria Brasileira e Global de Jogos Digitais”. GEDIGames, NPGT, Escola Politécnica, USP, para o BNDES.

[2] Hudlicka, E., (2008) “Affective Computing for Game Design”. In Proceedings of the 4th Intl. North American Conference on Intelligent Games and Simulation (GAMEON-NA), McGill University, Montreal, Canada, 2008, pp. 5–12.

[3] Guthier, B., D¨orner, R. and Martinez, H. P., (2016) “Affective Computing in Games”. : Entertainment Computing and Serious Games, LNCS 9970, pp. 402–441. DOI: 10.1007/978–3–319–46152–6 16.

[4] Campbell, M., Hoane, A. J. and Hsu, F., (2002) “Deep blue”. Artificial Intelligence. 134. 57–83. 10.1016/S0004–3702(01)00129–1. Available in: <https://www.researchgate.net/publication/222544943_Deep_blue>

[5] DeepMind (2016) “AlphaGo”. Available in: <https://deepmind.com/research/case-studies/alphago-the-story-so-far>

[6] Zohaib, M., (2018) “Dynamic Difficulty Adjustment (DDA) in Computer Games: A Review”, Hindawi Advances in Human-Computer Interaction, Article ID 5681652, 12 pages, https://doi.org/10.1155/2018/5681652. Available in: <https://www.hindawi.com/journals/ahci/2018/5681652/>.

[7] Picard, R. W., (2003) “Affective computing: challenges”, Int. J. Human-Computer Studies 59, 55–64.

[8] Tao, J. and Tan, T., (2005) “Affective Computing: A Review”, ACII 2005, LNCS 3784, pp. 981– 995.

[9] Cambria, E., (2016) “Affective Computing and Sentiment Analysis”. AFFECTIVE COMPUTING AND SENTIMENT ANALYSIS 1541–1672© IEEE INTEllIGENT SYSTEMS Published by the IEEE Computer Society.

[10] Gilleade, K. M., Dix, A. and Allanson, J., (2005) “Affective Videogames and Modes of Affective Gaming: Assist Me, Challenge Me, Emote Me”. Proceedings of DIGRA 2005 Conference: Changing Views — Worlds in Play.

[11] Zohaib, M., (2018) “Dynamic Difficulty Adjustment (DDA) in Computer Games: A Review”. Hindawi Advances in Human-Computer Interaction, Article ID 5681652, 12 pages.

[12] Qin, H., Rau, P. P., and Salvendy, G., (2009) “Measuring Player Immersion in the Computer Game Narrative”. International Journal of Human-Computer Interaction, 25:2, 107–133, DOI: 10.1080/10447310802546732.

[13] Dubiela, R. P. and Battaiola, A. L.. “A Importância das Narrativas em Jogos de Computador”.

--

--

Carol Salvato
EmotionAI

Game Developer | Game Designer | Master's student in Artificial Intelligence and Cognitive Systems for Games{ carolsalvato.com }