## 3 Materials and Methods
### Fuzzy Inference  
Adjustment of the box position  
Six fuzzy output sets with trapezoidal membership functions were defined to adjust the box position. Figure 5 shows the three fuzzy output sets for the X axis and three fuzzy output sets for the Y axis (i.e., easy, medium, and hard).  
Figure 4: Fuzzy input sets based on the ROMs that were used to compute the box size: (**a**) Fuzzy input sets for radial movement. (**b**) Fuzzy input sets for the flexion movement.  
Figure 3: Fuzzy input sets based on the ROMs that were used to compute the box position: (**a**) Fuzzy input sets for ulnar movement. (**b**) Fuzzy input sets for the extension movement.  
Additionally, six rules were defined to compute the fuzzy output for the box position:  
* IF ulnar_ROM is low THEN X-position_difficulty is easy
* IF ulnar_ROM is medium THEN X-position_difficulty is medium
* IF ulnar_ROM is high THEN X-position_difficulty is hard
* IF extension_ROM is low THEN Y-position_difficulty is easy
* IF extension_ROM is medium THEN Y-position_difficulty is medium
* IF extension_ROM is high THEN Y-position_difficulty is hard  
Adjustment of the box size  
Similarly, six fuzzy output sets with trapezoidal membership functions were created to set the box size. Figure 6 presents the three fuzzy output sets for the X axis and three fuzzy output sets for the Y axis (i.e., easy, medium, and hard).  
Moreover, six rules were defined to compute the fuzzy output of the box size:  
Figure 5: Fuzzy output sets for the box position: (**a**) Fuzzy output sets for the X axis. (**b**) Fuzzy output sets for the Y axis.  
Figure 6: Fuzzy output sets for the size position: (**a**) Fuzzy output sets for the X axis. (**b**) Fuzzy output sets for the Y axis.  
* IF radial_ROM is low THEN X-size_difficulty is easy
* IF radial_ROM is medium THEN X-size_difficulty is medium
* IF radial_ROM is high THEN X-size_difficulty is hard
* IF flexion_ROM is low THEN Y-size_difficulty is easy
* IF flexion_ROM is medium THEN Y-size_difficulty is medium
* IF flexion_ROM is high THEN Y-size_difficulty is hard  
Defuzzification  
Once the fuzzy rules were aggregated, the fuzzy outcome was defuzzified to obtain either the specific box position in X and Y, or the specific box size in X and Y. The center of sums method was used to defuzzify:  
\[z^{*}=\frac{\sum_{i=1}^{n}z_{i}\,Ac_{i}}{\sum_{i=1}^{n}\,Ac_{i}} \tag{5}\]  
where n is the number of fuzzy output sets (i.e., three fuzzy output sets), z\({}_{i}\) is the center of each fuzzy output set (e.g., easy, medium, and hard), and \(Ac_{i}\) is the area of each fuzzy output set.  
The box position in the Z axis was kept the same for all the boxes displayed in the game scene. Regarding the box size in the Z axis, this was the average of X and Y axes that were computed.  
2.5 Engagement Measurement and Participants' Opinions on Game Mode Preferences Engagement Measurement  
The engagement index was computed using the equation proposed by [PERSON] et al. [38]. This equation considers the theta (\(\theta\)) and alpha (\(\alpha\)) bands from the frontal and parietal lobes. Due to the EEG channels provided by each EEG sensor, the engagement index was computed from the participants using variations on the EEG channels:  
\[Engagement_{Index}=\frac{\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\