# Game Difficulty Prediction Based on Facial Cues and Game Performance
## 3 Methods
### Experimental Procedure  
Based on previous research [13; 21], predicting game difficulty with machine learning models generally requires constructing a dataset with objective features (i.e., physiological signals, facial expressions) as input and subject ratings as labels. Then, after training the classification model on the collected dataset, it can be applied to recognize game difficulty. Therefore, in this study, we first need to create a dataset. When selecting the game for data collection, the following aspects were mainly involved: first, the operation should not be complex to prevent a high learning burden. Previous studies have used games, including Tetris [13], Pacman [14; 19], and Pong [21], which all meet this requirement. Second, the game should contain various modes to stimulate unequal physiological states and facial cues. Third, it can simultaneously record and process the facial data when the participant plays the game. With this, the workload during data processing can be significantly reduced. Based on the above three aspects, we ultimately chose the popular game Dinosaur Run and modified it with multiple modes. We referred to the research [21] when determining the game mode settings. They used a Pong game to study difficulty prediction and generated nine game modes based on the ball speed and paddle size. Therefore, this study also established the game mode based on two aspects: dinosaur speed and cactus size. To create multiple difficulties in our game, we developed nine modes (I-IX) by adjusting dinosaur speed (slow, medium, and fast) and cactus size (small, medium, and large), as shown in Table 1. From the table, it can be observed that the difficulty in each row or column is progressively increasing. Therefore, different game modes were expected to elicit various levels of facial cues. Subjects were required to play in each mode, and their facial cues, game performance, and game difficulty ratings for each game mode were automatically collected to create the dataset. Further, we would train several machine learning classifiers on this dataset and compare their performances to obtain the best model. \begin{table}
\begin{tabular}{c c c c} \hline
**Dinosaur Speed\(\backslash\)Cactus Size** & **Small** & **Medium** & **Large** \\ \hline Slow & I & II & III \\ Medium & IV & V & VI \\ Fast & VII & VIII & IX \\ \hline \end{tabular}
\end{table} 
Table 1: Game mode settings. The left picture in Figure 1 shows the interface at the start of the game. Users can press the space key or click the start button to enter the game. The right picture in Figure 1 shows a screenshot during gameplay. After the participants arrived at the lab at the appointed time, we introduced them to the game's contents, rules, and duration. Then, they filled out the consent voluntarily. Next, participants were requested to play one or two random modes to familiarize themselves with the game. All users indicated that they were aware of the game operations and experimental requirements after the pretest. Subsequently, the formal experiment started. Figure 2 shows the experimental procedure. To mitigate the order effect, we randomly disrupted the order of the games before the formal experiment started. The experimental procedure is detailed as follows: Participants enter the game interface after clicking the start button or pressing the space key. During gameplay, they tap the space key to jump over the cactus. If the user does not avoid a cactus, the number of failures increases by one, and the game continues. The duration of each game is 30 s. After completing one mode, the game returns to the initial interface. Users need to rate the difficulty on a scale from 1 to 9, where 1 means extremely easy, 5 represents normal (neither easy nor hard), and 9 indicates very hard. Then, they take a break for about 1 to 2 min to prevent fatigue. Afterward, users enter the game in a different mode by pressing the start button again. The entire experiment took about 15 min, and we only recorded users' facial data while they were playing.