ON INFORMATICS VISUALIZATION

— Games are considered one of the most popular entertainment forms worldwide. The interaction in the game environment makes the players addicted to playing the game. One technique to build an addicting game is utilizing the player's emotions using Meta Artificial Intelligence (AI). The player's emotions can be utilized by adjusting the game difficulty. Most of the game offers static and steady difficulty development throughout the game. This research proposes a Meta AI game design using the player's affective states. We argue that a dynamic difficulty development throughout the game will increase the player's game experiences. The player's facial expressions are utilized to extract the player's affective state information. To recognize the player's facial expressions, a Facial Expressions Recognition (FER) model was trained using VGG-16 architecture and The Indonesian Mixed Emotion Dataset (IMED) dataset in addition to a self-collected dataset. The emotions recognition model (from player's facial expressions) achieved the best validation accuracy of 99.98%. The model was implemented in the proposed Meta AI game design. The Meta AI game design proposed in this game was implemented in several game scenarios to be compared and evaluated. The proposed Meta AI game design was evaluated by 31 respondents using Game Experiences Questionnaire (GEQ). Overall, the results show that the game with Meta AI and Augmented Reality implemented significantly improved the Game Experiences Questionnaire (GEQ) score and the player's overall satisfaction compared to the other game scenarios.


I. INTRODUCTION
Games have been considered the most popular entertainment form and culture these days. The critical aspect that makes games profoundly popular among all age groups is the players' experiences when interacting with the games (e.g., story, objects, mechanics). The players' affective states are the essential components of the game experiences [1]- [ 3]. Anger and frustration are triggered by the game story or activated when the players encounter predicament situations. For example: when the obstacles or enemies in the game are just too hard to be completed. Sadness can be triggered in the game story and through the characters' development process, and happiness can be activated when players achieve their goals in the game.
Moreover, the players' affective states can also be affected by the difficulties encountered by the players throughout the game [1], [2]. Both impenetrable enemies and effortless tasks would lead to the negative affective states activated for the players (e.g., bored, anger, frustration). In comparison, opportune difficulty and tasks would activate the positive affective states for the players (e.g., happiness, excitement). Satoi and Mizuno [4] argue that the best game experience is not having constant positive affective states. However, the roller coaster of emotions in the game would significantly enhance the players' experiences during the game [4], [5]. Hence, the ultimate goal in developing games is to design a game that creates unique and breathtaking experiences for the players. The goal can be achieved by implementing Meta Artificial Intelligence (Meta AI) in the games. Meta AI was coined by Satoi and Mizuno [4] to create unique experiences for the players. Meta AI is an AI system that dynamically controls the game's objects, events, characters, and mechanics [4]. Hence by implementing Meta AI in the game, the game system would dynamically change the objects, events, characters, and mechanics (e.g., the difficulties) according to the player's performances in the game. However, implementing Meta AI in the game is a relatively cumbersome task. The system needs to perceive the players' current state and then dynamically adjust the objects, events, characters, and mechanics (e.g., the difficulties) based on the players and the game's current states.
This research aims to develop such a game by utilizing the player's Affective States as Meta AI design in games. The goal can be achieved by elegantly composing the alternating positive and negative player's affective states (i.e., emotions) throughout the game. This research contributes to the design and development of Meta AI in games to enhance the players' game experiences. Research in Meta AI is still considered blue-sky research, where few researchers are exploring Meta AI in games. Hence this research also contributes to exploring the Meta AI design based on the players' affective states in the games. Moreover, this research also explores any other aspects or variables that can enhance the players' experiences. This research proposes the exploration of augmented reality to enhance the players' experiences as there is still limited research done in exploring augmented reality to enhance the players' experiences. The Meta AI design proposed in this research will provide dynamic adjustments in the game mechanics (e.g., the difficulties) based on the players' affective and current game states. The players' affective states are collected and perceived using players' facial expressions when playing the games. At the same time, the game states are collected and captured in the internal game mechanics (e.g., the players' Health Point (HP), number of obstacles or enemies, and enemies' HP). The goal is to build a system that can provide an adequate pace for the players throughout the game.
Ultimately the Meta AI imbued system can significantly enhance the players' experiences compared to those without Meta AI. The rest of the paper is organized as follows: the state-of-the-art research in-game technology, Dynamic Difficulty Adjustment (DDA), and Meta AI are comprehensively described in the next section. Section Affective States as Meta AI Design thoroughly illustrates the design of the proposed Meta AI system by implementing the players' affective states (i.e., emotions) from the players' facial expressions cues. The proposed Meta AI system was then implemented and evaluated in a mobile augmented reality game. The results are comprehensively discussed in the Results and Discussion section. Finally, the Conclusion and Future Work section demonstrate the research's conclusion and future direction in game technology and Meta AI.

A. Meta AI
Meta AI is still considered blue-sky research in the game technology area. The Meta AI term was coined by two researchers from Square Enix, Satoi and Mizuno [4] in the Game Developer Conference 2019. Meta AI controls the entire game components (e.g., story, mechanics, characters, and events). The goal is to present unique and breathtaking experiences for the players' experiences when playing the games. The game story, mechanics, characters, and events can dynamically change based on the players' affective states and game situations. For example, when players' affective states show that they are relaxing, more enemies or obstacles can be added to the game. In contrast, when the players' affective states show that they are stressing, buff items can be spawned near them. The implementation of the Meta AI in games can be diversified among the games, and the different genres also result in different Meta AI designs [5].
However, only limited research has been done to implement Meta AI in the games. Satoi and Mizuno [4] mentioned several commercial games that implement Meta AI, for example, Left 4 Dead and Far Cry 4. However, there are only succinct explanations of the Meta AI implementation details in their papers. Another researcher working on the Meta AI implementation in the games proposes a Meta AI system using facial expressions recognition to perceive the players' emotions when playing the games [3]. Setiono et al. [3] proposed a Meta AI design in an FPS survival computer game. The players' emotions are captured through their facial expressions with a web camera during the game. The perceived emotions then become the baseline to adjust some of the variables in the game dynamically. For example, the Meta AI system dynamically controls the enemies' Spawn Rate and the Maximum of the enemies' within an area. The game with the Meta AI design implemented resulted in improved players' game experiences compared to the one without Meta AI.

B. Dynamic Difficulty Adjustment
One of the critical components of Meta AI in games is the Dynamic Difficulty Adjustment (DDA) or dynamic balancing system. The balancing system in the game is generally designed in the development phase as part of gameplay and mechanism design. The balancing system ensures the game's difficulty and observes the players' character development. There are two classical methods to build balancing systems for a game, a flat difficulty system and a static build-up difficulty system. Fig 1 illustrates the difficulty system that can be implemented in the games. The Y-axis demonstrates the intensity of the difficulty in the game, and the X-axis represents the time spent in the game. The games that implement a flat difficulty system (see Fig 1 left side, the flat horizontal line) generally have invariable difficulty throughout the game. While the games with a static build-up difficulty system (see Fig 1 left side, the gradient line) make sure the difficulty increases statically alongside the players' characters' development throughout the game. The classic and most implemented DDA in the game uses a technique similar to the Hamlet System in the Half-Life Game Engine [6]. Hamlet system in the Half-Life Game Engine offers several functions to adjust the game difficulty dynamically. The functions primarily monitor the game states and variables and adjust the game environments based on the DDA policies and the game states. Sutoyo et al. [7] propose a DDA system that monitors and modifies Players' Lives, Enemies' Health, and Skill Points variables in a Tower Defense game. They explored several scenarios in using the DDA system in a Tower Defense game. Some Researchers also combined players' affective states to modify the game environments [2,8,3]. Research has shown that games imbued with affective DDA systems to modify the game environments significantly improve the players' game experiences compared to the ones without affective DDA systems [2], [3], [8]. Other researchers implement neural networks [9,10] and reinforcement learning [11] as the DDA system in games.

C. Affective Games
Affective games refer to game systems that are capable of perceiving, processing, and reacting to the players' emotions [1], [4], [12], [13]. Emotions play an essential role during the game [15]. Players generally voluntarily display their emotions through facial expressions, body gestures, and speech during the game [1]. The emotions can be captured and processed as part of the game mechanics to make the game more interesting [1]- [3], [8], [16]. An affect-aware system generally is designed as part of the game engine. The affectaware system aims to capture, process, and respond to the players' emotions during the game.
Some researchers capture the players' emotions through their facial expressions [1]- [3], [8], [16]- [18], or their speech [1], [18]. They classify the players' emotions into a discrete set (e.g., Six Basic Emotions, Positive and Negative Emotions) and modify the game environments based on perceived and state emotions. The affect-aware system will attempt to match the difficulty of the game with the players' emotional states and players' performances during the game. The affect-aware system will scale down the enemies' attributes (e.g., attack power or defense point) when it detects the players' frustration. On the contrary, the system will increase the enemies' capabilities when the system observes that the players are relaxed during the game. Most of the research has shown that games imbued with the affect-aware system statistically enhance the players' game experiences. There are several variables to estimate the players' game experiences based on Ijsselsteijn et al. [19]. The variables are Competence, Sensory and Imaginative Immersion, Flow, Tension, Challenge, Negative Affect, and Positive Affect. Most research tries to adjust the game difficulty to the players' emotions and performances.
However, current research has shown that the best game experience is not having constant positive affective states but transient affective states throughout the game (see Fig 1 right  side). The roller coaster of emotions in the game would significantly enhance the players' experiences during the game [4], [5]. Hence, this research aims to build an affectaware system that, instead of the difficulty matching with the players' affect states and performance, the difficulty will match the affect goal determined in the game design.

A. Affective States as Meta AI Design
In this paper, a Meta AI game design using the player's affective states was designed. The game design was implemented to an Augmented Reality (AR) endless run game genre on a mobile phone. Moreover, four-game scenarios were designed to evaluate the proposed affective meta-AI game design, and they are: Scenario A -The Baseline Game, Scenario B -Meta AI implemented without AR, Scenario C -Meta AI implemented with AR, and Scenario D -AR implemented with No Meta AI. Fig 2 illustrates the gameplay design. A simple endless-run game was designed with fourgame scenarios. The game's objective is simple; the player should avoid obstacles and collect as many coins as possible. There are three lanes with four types of obstacles in the games. The players can switch between the lanes by using a left or right swipe to switch to their left or right lane to pick up coins and Health Point (HP) or avoid the obstacles. In addition, the players can swipe up or down to jump and slide to avoid obstacles. The obstacles designed in the game are A high overhead wall with space in the bottom for the player to slide; A fence that can be passed by jumping; Objects (e.g., ball, wall) in the lane, which can be avoided by a move to the other clear lane (see Fig 2). Moreover, table 1 demonstrates the baseline game design that was implemented in all the game scenarios.  function that takes x as the start (min) number and y as the end (max) number to be randomized, the type of obstacle spawned in the game was randomized. However, the game design governs the minimum and maximum obstacles spawned in one lane (i.e., 2 to 3 objects per lane). Similarly, the game design sets the minimum and maximum coins spawned in one lane (i.e., 1 to 2 coins per lane). The speed was set between 14 to 20 m/s throughout the game. The AR game design is quite similar to the baseline game design. However, in the AR game design, the game's background uses a real-world background. The game design components' values are identical to the baseline game design, and the control is also similar to the baseline game design (i.e., swipe left, right, up, and down).
The Meta AI game design proposed in this research implements Facial Expression Recognition (FER) to track and manage the player's affective states. The FER model was trained using VGG16 architecture [21] and IMED dataset [20] with an additional self-collected dataset. Both datasets were annotated in seven emotions (Angry, Surprise, Sad, Fear, Disgust, Happy, and Neutral). A total of 11,850 images were used to train the model. The dataset was divided into 10,665 images (90%) for the training set and 1,185 (10%) for the testing set. Fig 3 demonstrates the FER model training architecture. Fig. 3 Emotions Recognition Model Training using Self Collected and IMED [20] Datasets using VGG16 [21] Fig 4 illustrates the proposed Meta AI game design using the player's affective states. The Meta AI designed in this research tracked and managed several variables in the game. The y-axis represents the player's stress level, and the x-axis represents the game's time in t seconds. Four build-up settings are proposed in the game, and the first build-up begins when the player starts the game (B0). The second build-up, B1, has a target of a player's stress level of 0.5. The third build-up B2 targets a player's stress level of 0.25. Finally, the fourth buildup, B3 or the peak, targets the player's stress level of 1. The player's stress level can be adjusted by dynamically change the game variables to adjust the game difficulty. The build-up pattern proposed in this research is [B0 -B1 -B2 -B3 -B2 -B1 -B2 -B3 -B2 -...]. The pattern will repeat B1 -B2 -B3 B2 and back to B1 until time t when the game ended (maximum of 5 minutes or the player died). The rationale of the game design proposed is to provide a transient and roller coaster of affective states throughout the game.  Table 2 demonstrates the build-up transition design of the Meta AI game design. The transition process is monitored by two variables: the player's Health Point (HP) and their Facial Expressions during the game (FER). The player will start with a FULL (6) HP and neutral FER. The FER is calibrated at the beginning of the game for every player. Four transition settings were proposed in the game. To bring a player from build-up B0 to B1, the game will try to make the player that currently has FULL (6) HP and Neutral (NEU) / Positive (POS) emotions to Medium (MED, 3 -4 HP) and Negative (NEG) affective state (FER). The targeted build upsetting can be achieved by changing three game variables: Obstacles Spawn Rate (OSR), Coins Spawn Rate (CSR) and HP Spawn Rate (HSR). To change the build-up from B0 to B1, the game will track the player's current HP (FULL: 6 HP, HIGH: 4 -5 HP, MED: 2 -3 HP, LOW: 1 -2 HP) and FER (NEU is Neutral, POS is Positive and NEG is Negative) and try to bring the HP and FER to the target HP and FER. The goal can be achieved by increasing the OSR to 5 per second, decreasing CSR to 5 per second and decreasing the HSR to 2 per second until the maximum value of each variable or the target is achieved (see Table 3). The proposed game design was implemented as a simple endless running game with augmented reality and evaluated by the players. Each respondent played with all four game scenarios, with the playing sequence between game scenarios randomized. Hence, four groups are playing the games in correspondence to each scenario. Group 1 (G1) played Scenario A, Group 2 (G2) played Scenario B, Group 3 (G3) played Scenario 3, and Group 4 (G4) played Scenario 4. Every time the respondent finished one of the scenarios, they filled out a questionnaire to evaluate their experiences in the game. The questionnaire was adapted from The Game Experiences Questionnaire (GEQ) [19]. Table 4 shows the GEQ items and aspects. There are 19 items in the questionnaire. The items were divided into nine aspects: Competence, Sensory & Immersion, Flow, Tension, Challenge, Negative Affect, Positive Affect, and Overall satisfaction.

III. RESULTS AND DISCUSSION
Four game scenarios were designed to evaluate the Meta AI game design with the player's affective states information from the player's facial expressions when interacting in the game. A FER model was trained using VGG-16. Architecture to acquire the player's affective states from their facial expressions during the game. The model was then implemented in the game Meta AI system. The training hyperparameters were set using a grid search method to find the optimum result. The hyper-parameters were batch size = 32, maximum epochs = 100, and optimizer = Adam. The training was set to stop when the model could not be improved during the training. The initial learning rate set was 0.01 and factored by ten every time the loss hit a plateau (patience = 50). The dataset was also augmented to enhance the quantity of the data, with the parameters set of sample-wise center = True, rotation range = 10, zoom range = 0.1, width shift range = 0.1, height shift range = 0.1, horizontal flip = True, vertical flip = False. The best model was implemented to the Meta AI system in the game to capture the player's affective states through their facial expressions during the game. Four game scenarios were designed to evaluate the player's experiences during the game. Thirty-one respondents were recruited to evaluate the game. Each respondent played with all four game scenarios with a random sequence of the game scenario. One player can play Scenario A -Scenario C -Scenario D -Scenario B, and others can play Scenario B -Scenario C.
-Scenario A -Scenario D. The respondents filled out a 5point Likert scale questionnaire (see Table 4) every time they finished playing each scenario. The respondents were also asked to self-assess how good they were at playing the endless running game between 1 and 10 points. On average, the respondents rated 7.27 out of 10 on the score. Fig 6 shows the average score for all questionnaire items from all the respondents. The x-axis indicates the questionnaire items (see Table 4), and the y-axis indicates the score ranged from 0 to 5. Overall, the highest average score belongs to item no 2 (Competent Aspect) in the questionnaire: "I felt my skill improves as I play", with an average score of 2.86 (G1 = 2.68, G2 = 2.84, G3 = 3.13, G4 = 2.77). While the lowest average score belongs to item no 15 (Negative Affect Aspect): "I felt bored", with an average score of 1.53 (G1 = 1,65, G2 = 1.48, G3 = 1.48, G4 = 1.52). Overall, Group 3 (G3) rated the highest score, followed by Group 2 (G2) and Group 4 (G4). The lowest score was rated by Group 1 (G1). Moreover, the respondents were also asked to rate how satisfied they were with the game between 1 -10 points. In average, the respondents rated 7.04 (G1 = 6.36, G2 = 6.90, G3 = 7.71, G4 = 7.19).   Moreover, Group 1 has several outliers outside the lower and upper quartile. A normality test using Shapiro-Wilk was applied to the questionnaire data to statistically evaluate the differences between the mean within the groups. The result indicates that the data most likely does not come from a normal distribution population (stat = 0.793 and p = 0.000. Hence, a Wilcoxon rank test was applied to the data to indicate the statistically significant differences between the mean within the groups. Table 5 demonstrates the p-value between groups. The results show no statistically significant differences between the mean of Group 1 and Group 4, Group 2 and Group 3, Group 2 and Group 4. However, there are statistically significant differences between Group 1 and Group 2 in several items (No 1, 3, 6, 19, and the Average). There is also statistically significant improvement between Group 1 and Group 3 in several items (No 1,3,4,13,16,18,19, and the Average). Finally, there is also statistically significant improvement between Group 3 and Group 4 in several items (No 2, 3, 13, 19, 19, and the Average).

IV. CONCLUSION
This paper proposed a Meta AI game design by using players' affective states information from their facial expressions. A FER model was trained with VGG-16 architectures, resulting in 99.98% and 0.0011 of validation accuracy and loss, respectively. The model is then implemented into the proposed Meta AI game system. Four game settings were designed to evaluate the player's game experiences during the game. The results demonstrate that games with both Meta AI and augmented reality implemented (G3) in the game significantly increase the player's game experiences in several items compared to the other models. There are some significant improvements from G3 on the GEQ items no 2, 3, 13, 18, 19 and overall score with p-value of 0.034, 0.048, 0.007, 0.023, 0.032, and 0.014, respectively, compared with only AR implemented in the game (G4). There are also some significant improvements from G3 on the GEQ items no 1, 3, 4, 13, 16, 18, and 19 and overall scores with pvalue of 0.012, 0.033, 0.047, 0.033, and 0.02, respectively, compared to the baseline game (G1, no Meta AI and AR implemented in the game).
Moreover, there are some significant improvements from a game with only Meta AI implemented (G2, without the AR) on the GEQ items no 1, 3, 6, and 19 and overall scores with p-value of 0.012, 0.033, 0.047, 0.033, and 0.02 respectively compared to the baseline game (G1). There are no statistically significant differences between the mean of the GEQ score of G1 compared to G4, G2 to G3, and G2 to G4. A more complex game genre (e.g., action, RPG) can be explored for future research direction. The player's stress level build-up pattern also can be designed with several variables to track to increase the complexity of the Meta AI game design. Moreover, other variables and players' affective states information can be explored to be tracked during the game (e.g., player's heart rate, player's EEG, and other in-game variables) to improve the Meta AI game design effectiveness. Research Meta AI is considered blue-sky research in the game community. Hence, more exploration must be done to find the best game AI design based on the genre.