## 2 Materials and Methods
### System Description
#### 2.3.1 Software Components  
The software part of the system consists of various virtual reality exercises developed using the Unity 3D game engine. The exercises are divided into two main categories, based on their purpose: physical rehabilitation and psychological rehabilitation. The two categories can be used separately for therapy or alternatively in a complex and complete physical and mental rehabilitation procedure. The game design of the exercises was created together with medical specialists and psychologists from our team, while changes to the mechanics or to the player's experience were implemented based on feedback from the collaborating medical institutions and from the patients involved in the clinical study. For the physical exercises, our goal was to create easy-to-play exercises, with intuitive gameplay, suitable for people suffering from affections of the upper body (spine or upper limb). The system includes a wide variety of exercises: throwing a ball to hit cans, directing a ball on an inclined plane to reach some targets, whack-a-mole, boxing, and collecting fruits. Only the last three physical games were used in the clinical trials, as they were evaluated as the most suitable by the medical professionals for the respective patients. For the mental rehabilitation exercises, advice from psychologists led to the creation of relaxation and mindfulness exercises suitable for treating anxiety and helping the rehabilitation process become more effective and less burdensome. The design process of the games had in mind the possibility of personalization based on the patient's medical state. For instance, the boxing game can be suitable for spinal cord issues that require full stretching of the arms, while fruit collection focuses more on improving fine motor skills. Personalization is possible according to the degree of the affection or associated conditions; thus, the games include various levels of difficulty and different skins or focus on different muscular groups (e.g., in the progressive muscle relaxation). We will further describe each one of the exercises used in the clinical trials, focusing on their purpose, medical suitability, functionalities, and gamification principles. An overview of the exercises can be seen in Table 3 below, including the main targeted health conditions, involved movements, and game mechanics. Physical Rehabilitation Exercises  
The implementation of all physical exercises was optimized so that they are suitable for space constraints and can be easily performed in a clinical setting. This optimization came with the cost of some patients wanting more space and liberty of movement, especially in the boxing scene. Each game has written instructions and scores displayed in the graphical interface, as well as appropriate audio cues. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Exercise** & **Health Condition** & **Movements** & **Game Mechanics** \\ \hline \multirow{3}{*}{Whack-a-mole} & Affections of spinal cord, musculoskeletal & Both upper limbs, movement of arm and hand & Score, time, levels of difficulty, enemies, accuracy \\ \hline \multirow{3}{*}{Boxing} & Affections of spinal cord, musculoskeletal & Both upper limbs, ample movements of arm & \multirow{3}{*}{Score, time, targets of difficulty, enemies, accuracy} \\  & & & \\ \cline{1-1}  & & & \\ \cline{1-1}  & & & \\ \hline \multirow{3}{*}{Fruit collection} & Carpal tunnel syndrome, affected fine motor skills & Fine hand movements, both hands, all fingers & \multirow{3}{*}{Score, time, accuracy} \\ \cline{1-1}  & Anxiety, panic attacks, stress & Chest movements, inhaling and exhaling & & Time, repetitions, skins \\ \hline \multirow{3}{*}{Progressive muscle relaxation} & \multirow{3}{*}{Arxiety, panic attacks, stress} & All upper body, contraction and relaxation of muscle groups & \multirow{3}{*}{Time, repetitions, skins} \\ \cline{1-1} \cline{4-4} \cline{5-5}  & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Overview of the exercises included in the clinical study.