Home Rehabilitation Based on Gamiﬁcation and Serious Games for Young People: A Systematic Mapping Study

Featured Application: This work analyzes the current state of the physical rehabilitation ﬁeld focused on the techniques, devices, and methods used with children and adolescents. Moreover, we present improvements of a gamiﬁcation-based software prototype for home rehabilitation of young patients, based on this study and a previous experiment. Abstract: Physical rehabilitation of people who suffer from some motor disability involves an intensive treatment to reduce pain and improve quality of life. Research studies have proven the beneﬁts of technologies based on home-rehabilitation, which complement regular therapy in hospitals. Although there is a signiﬁcant number of studies that face this challenge when dealing with adults, it has not been explored with young people. In this research article, we focus on this population, since the repetition of physical exercises decreases the youth’s motivation, which entails a high risk of dropping out of therapy. That is why we present a systematic mapping study of the techniques, devices, and methods used to address home rehabilitation for children and teenagers. The conclusions indicate that it is essential to use gamiﬁcation techniques to adopt a plug-and-play metaphor, based on natural interaction mechanisms and on the use of non-intrusive devices, and to customize the rehabilitation process for each individual along with a methodology. We also present the improvements applied to an existing gamiﬁcation-based software prototype for home rehabilitation. In this system, physical exercises can be customized, laying the foundations to promote precision rehabilitation within the context of young people.


Introduction
The reduction of movement in specific parts of the body is caused by diseases whose origins are motor issues. In these cases, the treatment consists of rehabilitation therapies with a great number of sessions to increase the patient's quality of life. Unfortunately, there exist major obstacles beyond the disease that make therapies difficult. One of them is related to the economic burden, since health systems are hard to be sustained in the long-term because of the increasing prevalence of chronic diseases [1]. On the other hand, an inconvenience for patients (and their caregivers, in the case of dependent people) involves taking them to the hospital or the rehabilitation center. This situation has become really evident during the situation of confinement caused by COVID-19. Another, but no less important barrier, concerns the lack of motivation of patients when it comes to therapy engagement.
Given that rehabilitation sessions usually consist of repeating the same exercises over and over again, this task ends up being monotonous and extremely boring. Consequently, this can lead to an eventual loss of interest in the therapy, which may result in patients quitting the rehabilitation treatment. All of these obstacles, along with others, are discussed in [2].
The last two barriers should be especially considered when dealing with patients who are children or adolescents. On the one hand, they need to be accompanied by an adult to the rehabilitation center, which entails inconveniences for the families. On the other hand, while adults are aware that therapy itself benefits them, young people tend to have less determination to perform tasks if they do not obtain some short-term reward in exchange [3]; therefore, motivation is essential for them to maintain their commitment to the exercise program [4][5][6].
Technological advances have offered alternatives to mitigate this problem. Among these are telemedicine-based solutions, which allows us to reduce costs and avoid the inconveniences associated with taking the patients to the hospital or the rehabilitation center [7,8]. Additionally, in order to increase the patient's motivation, the use of serious games is considered [9,10]. These games promote entertainment while performing the exercises. In the field of physical rehabilitation, a specific type of serious game is used: the so-called exergames. They involve physical exercises while the patient interacts with the game. There is evidence that the use of exergames improves the motivation and adherence of patients in rehabilitation treatments. In fact, it has been demonstrated that exergames help to promote physical exercise and well-being, in addition to improving cognitive functions or psychological factors, among other benefits [9,[11][12][13].
A significant number of exergame-based systems can be found in the literature. Most of them make use of sensors attached to the patient's body, which can be uncomfortable and even difficult to use at home [14]. This problem has been solved, at least partially, by the appearance of commercial devices, such as Microsoft Kinect, Nintendo Wii, or Leap Motion. These devices are capable of capturing the patient's natural movements without the use of markers or devices attached to the body. These types of devices facilitate the deployment of exergames at home [4,5] and the execution of the exercises in a more straightforward way. Some video games support the graphic representation of the user (or player) in two or three dimensions, which is known as a virtual avatar. This type of representation makes the system work as a "virtual mirror", that is, it allows the patients to perceive their movements and provides them with immediate visual feedback to know their level of success. It has been proven that the use of these non-intrusive devices makes the treatment more motivating, which brings benefits to the motor recovery process [15]. Although there are some very advanced commercial exergames, they may not be suitable for use in rehabilitation tasks [16], since they do not generally take into account the particularities and clinical needs of the users with motor limitations [17].
Most of the conducted research has been oriented towards the development of specific systems for groups of patients with very specific characteristics (e.g., cerebral palsy), being also related to adults or elderly patients [11,12,18,19]. However, one of the groups that may benefit most from systems that make use of devices previously mentioned is the group of younger patients (children and adolescents), who are familiar with its use and often have some of them at home. There are some examples of rehabilitation approaches that make use of these devices. In [16], a Kinect-based system is presented for the rehabilitation of upper limbs in children affected by Friedreich's Ataxia. A system using Leap Motion for the rehabilitation of children affected by cerebral palsy is described in [20], and in [21] this same device is used to establish an environment that enhances children's motor skills. A system that employed the commercial Wii Fit game for the rehabilitation of adolescents with arthritis is shown in [22]. There are systems that combine some of these devices, as in [23], where the Kinect and the Nintendo Wii are used to evaluate the oscillation of the body in children with cerebral palsy.
In the field of rehabilitation of young patients, as already mentioned, motivation plays a key role. Therefore, the introduction of gamification techniques in rehabilitation software can provide great benefits [10]. There are some examples of systems in this line of work. In this context, García-Vergara et al. [24] describes a virtual reality environment in which children rehabilitate their motor functions blowing virtual bubbles on a monitor with their hands. In [25], adolescents are motivated by simulating everyday activities, which are replicated by a virtual avatar. However, one of the main drawbacks of the serious systems and kits available in the literature is their specificity, i.e., they are usually based on patients with very specific types of injuries or motor problems. Therefore, it would be ideal that the great efforts invested in the development of the rehabilitation system lead to the adaptation of the exercises according both to the patients' disease and their needs. This issue has been addressed through proposals for user-centered systems design [26] and methodologies for designing efficient and safe therapeutic exergames [27].
Besides, a very promising line of research has recently emerged, which advocates the combination of personalization and automatic generation of exergames. This approach offers the therapist greater possibilities of personalization and adaptation when defining the exercise routine to be followed at home by each specific patient. In this line of work, the system StoryTec [28] stands out, which applies the concept of a narrative story so that experts without knowledge of Information and Communication Technologies (ICT) can develop their own games using an editor. González et al. presents TANGO:H [29], a platform that includes a graphic tool for professionals to create games adapted to the needs of their patients. In contrast, in Theraplay [30] the therapist personalizes the exercises by recording movements and postures according to the patient's limitations. Then, a 3D avatar plays them back to help patients follow the exercises.
In this paper we present a systematic mapping study (SMS) of the main works that have addressed the problems mentioned above. The selected articles were analyzed according to several characteristics based on three fundamental aspects about the rehabilitation system: its use by the patient, its use by the therapist, and its gamification support, as a key factor for motivating young patients.
As a result of the SMS, we have improved a gamification-based software prototype for remote physical rehabilitation [31], trying to mitigate the main limitations of existing systems. To this end, it is able to adapt and customize serious games, which can be generated automatically.
The remainder of the article is structured as follows. Section 2 presents the methodology followed during the research process and offers a comparative analysis of the identified research works. Then, Section 3 discusses the improvements applied over an existing gamification-based system for home rehabilitation regarding children and adolescents. Finally, Section 4 draws the conclusions of this work and states upcoming challenges that may lead to future research.

Research Methodology
This section describes the research methodology followed to perform the systematic mapping study, based on the most commonly used guidelines for SMS [32,33]. The process is structured into six phases: (1) definition of the mapping questions; (2) searching for candidate papers; (3) study selection; (4) data extraction; (5) mapping of the results; (6) validity evaluation. These phases are detailed in the next subsections.

Definition of the Mapping Questions
With the aim of shedding light on the current state of remote rehabilitation systems based on gamification and serious games for young people, ten mapping questions have been defined. These refer to how the patients use them, how the therapists use them, and the level of support for gamification techniques. Regarding the patient's use, our interest is focused on the place in which the systems are intended to be used, the type of communication between the user and the specialist, the devices needed to capture movements, and the paradigm and style of the interaction. With respect to the use by the therapist when defining the exercises to be performed by the patients, the interest lies in learning the methodology employed, if any, to specify the therapy. Also, if the systems are capable of automatically generating the exergames, and if they allow us to adapt the exercises to the user's needs. About the support for gamification, the analyzed characteristics were whether the systems include techniques to motivate the patient and, if so, which ones. All questions are described in Table 1, along with their motivations.

MQ1
In which places are the rehabilitation systems used?
To determine if the system is designed to be used at home, preventing the patient from being checked by the therapist on the rehab centre.

MQ2
What is the communication mechanism between the user of the rehabilitation system and the therapist?
To know how the patient receives the feedback provided by the therapist.

MQ3
What are the devices used by the system?
To discover the devices most frequently used in rehabilitation systems to capture the movements of the patient.

MQ4
Which interaction paradigms are used? To explore the different paradigms used to interact with the system.

MQ5
Which interaction styles are used? To identify which are the interaction styles most used.

MQ6
Is there any methodology that therapists should follow to define the rehabilitation therapy?
To know if exergames should be designed and created following certain steps.

MQ7
Do the rehabilitation systems provide any support for adapting and customising rehabilitation exercises?
To determine if the system is capable of personalizing the exercises based on the patient's needs and his or her evolution throughout the therapy.

MQ8
Do the systems provide any capability to automatically generate the exergames?
To know if the rehabilitation system is able to facilitate efficiently the creation of exergames.

MQ9
Do the systems include any gamification technique?
To identify whether the rehabilitation systems include gamification or serious games to motivate young patients.
MQ10 What are the gamification techniques used? To explore the main and frequent gamification techniques used by the rehabilitation systems.

Search Strategy
The main aim of this phase is to identify the works that may potentially address the MQs of this SMS. To this end, a search string must be established and the bibliographic resources in which such string will be entered must be selected. Both tasks are described below.

Search String
In this study, the search string has been defined on the basis of the PICO strategy [33,34]. This strategy considers that the four essential elements to be addressed in any clinical research question are Population (P), Intervention (I), Comparison (C), and Outcomes (O). Population refers to the patient or the problem to be addressed, which in the context of our SMS is determined by the studies that describe remote rehabilitation systems for young patients. The intervention represents the exposure to be considered, defined in the SMS described herein by the interaction paradigms and devices that allow the rehabilitation system to be used remotely (mainly at home), the gamification techniques or serious games included in the system to complete the physical therapy or rehabilitation, and the adaptation capabilities provided by the system depending on the user needs. The comparison refers to the analysis regarding the effect produced by the intervention on the group that receives it and on the group that does not receive it; however, this is not applicable to systematic mapping studies, since their main objective is to characterize the studies available in the literature. Finally, the outcome includes the results which are of interest, that is, the devices, paradigms and techniques used to develop remote rehabilitation systems based on gamification and serious games for young patients and supporting adaptation capabilities to the user needs. Table 2 summarizes the strategy used to define the search string. Table 2. Identification of the search terms using the Population (P), Intervention (I), Comparison (C), and Outcomes (O) (PICO) strategy.

Scope Description Terms
Population (P) Studies that describe remote rehabilitation systems for young patients.
remote rehabilitation, physical therapy, physical rehabilitation, children, young patients, adolescents.

Intervention (I)
Interaction paradigms and devices that allow the rehabilitation system to be used remotely (mainly at home), including gamification techniques to complete the physical therapy or rehabilitation, and supporting adaptation capabilities.

Comparison (C)
Not applicable, since the purpose of the study is to characterize the studies available in the literature.

Outcome (O)
The devices, paradigms and techniques used to develop remote rehabilitation systems based on gamification and serious games for young patients.
Since the combination of all the search terms resulted in a too large string, it was split into the following five substrings to be divided among the researchers: • remote rehabilitation AND (gamification OR serious games OR exergames) AND (children OR young patients). • (remote) rehabilitation AND (virtual reality OR augmented reality) AND (children OR young patients). • ((personalized OR customized) rehabilitation) AND (children or young patients). • (physical rehabilitation OR physical therapy) AND (gamification OR serious games OR exergames) AND (children OR young patients OR adolescents). • (home OR in-home OR remote OR virtual) AND (physical rehabilitation OR rehabilitation) AND (gamificat* OR serious gam* OR exergam*) AND (children OR young patient* OR adolescents).

Literature Resources
In this SMS, three well-known digital libraries were used for searching the candidate papers that may answer the MQs addressed in this work: PubMed, Scopus, and Google Scholar. The first two databases were selected because both index a large number of books, journals, and conferences related to Medical Informatics and Computer Science. Google Scholar was selected because it contains an extensive list of documents which, although not indexed in the previous databases, are important, as the interest in the subject studied is rapidly increasing.

Study Selection
In this phase, the aim was to identify the relevant papers that was used to address our MQs listed in Section 2.1. An automatic search was performed using each of the five search strings previously enumerated. The potential relevant articles were identified by the four researchers reading the title and the abstract. Then, duplicates were eliminated. Subsequently, the inclusion criteria on the titles and abstracts were applied to exclude those studies that were not relevant to our study. Table 3 lists the inclusion and exclusion criteria used to select the relevant papers. Each researcher examined the candidate papers that were classified as included, excluded, or uncertain. A paper was classified as included if it satisfied all inclusion criteria, as excluded if it satisfied one exclusion criteria, and as uncertain if the researcher had difficulties regarding its classification.
Finally, an exhaustive process of compliance with the exclusion criteria was carried out, verifying by means of a complete reading of each article to determine whether it should be rejected. It should be noted that a discussion took place to decide on the categorization of the paper. All papers classified as uncertain were similarly discussed until a solution was attained. Figure 1 depicts the selection process. In short, from a total of 592 articles, 98 was left after reading the title/abstract and removing the duplicates. Then, 40 studies were rejected based on the exclusion criteria, remaining 58 (98-40). After that, the exclusion criteria were applied to this set of articles, thereby resulting in 34 studies.

Data Extraction
This step involved extracting the data required to address our ten MQs from the selected studies. This task was performed individually by each of the four authors of the paper, working on a common table to avoid duplicate data. In addition, to ensure that the content of the table was correct, it was validated by all researchers, once it was completed. Table 4 shows the template used to fill the form. The first item was assigned automatically when introducing a new study in the table. The following four items define data to easily identify the paper: year of the study publication, authors' names, the name of the journal, book or conference, and the DOI. This allowed each researcher to quickly access a paper in case of being uncertain when validating the results. The sixth item, Relevance, was included to facilitate the validity of the collected data. Thus, each researcher assigned a label to each paper, ranging from 'A' to 'C', depending on its relevance for the SMS. The next ten items represent each one of the ten mapping questions. The possible values of each item are defined in the second column of the table. They were all defined by mutually exclusive sets of values, with the exception of the devices.

Threats to Validity
The credibility of the reported results may be affected by the several threats to validity [33,35]: • Descriptive validity. This threat is related to the extent to which the observations are described accurately and objectively. With the aim of reducing this threat, a data collection form was designed. This form supported the recording of data to help objectify the data extraction process and it may always be reviewed by each reviewer. • Theoretical validity. It is determined by our ability to capture what we intend to. In this case, biases in the selection and extraction of the data play an important role.
-Study selection bias. This threat mainly concerns the reliability of the selection process that was followed to identify and select the relevant papers available in the literature on the topic under study. This selection relies on the papers returned by the automatic search performed in the three digital libraries previously mentioned. A large number of papers related to our were obtained. To mitigate this threat, each researcher ranked each study among three relevant levels according to the information provided by the abstract and even by the content of the paper. -Data extraction bias. This threat concerns with the extraction of the correct data to address the MQs of this mapping study. Although this step involves human judgment, the threat cannot be removed at all. This issue was mitigated by creating a form that was filled in by the four researchers for each paper selected. A validation step was then conducted to ensure the correctness of the data extracted. The disagreements were resolved by means of discussions between the researchers. On the other hand, the quality assessment of the obtained studies was not carried out, as it is not mandatory in SMSs [34].
• Generalizability. This threat refers to the extent to which the results can be generalized in other groups (external) or within a group (internal). This threat was mitigated by selecting a wide range of studies related to different contexts. • Interpretive validity. This threat is related to the researcher bias. This threat has been mitigated by involving the four researchers in the generation of the results. • Repeatability. This threat is based on the detailed reporting of the research process. This threat has been mitigated by describing the followed systematic mapping process, including the actions taken to reduce possible threats to validity.

Results
The systematic mapping study has allowed us to identify the studies that address the mapping questions (Table 1) in order to give an overview of the basic aspects to be considered in the development of a remote rehabilitation system for young people. In other words, the devices, paradigms, techniques, and methods used to develop remote rehabilitation systems for young patients based on gamification and serious games. Table 5 summarizes the results.

Discussion
The aim of this systematic mapping study was to analyze the current state-of-the-art, providing in-depth knowledge of the used game techniques, devices, interaction mechanisms, methodologies, and interaction styles. Moreover, the places where rehab systems are mostly used and the types of communication frequently employed. Last but not least, the automatic generation of exergames together with the patient adaptation is a characteristic considered as well.
Taking into account this consideration, we present an overview of the results obtained after following the methodology described in this section, discussing the main findings related to each MQ.
MQ1. This SMS has identified a large numbers of papers related to applications for rehabilitation. The analysis of the publication shows that there are some works that use the systems in the rehabilitation center. However, there is a noticeable trend towards remote rehabilitation so that patients work autonomously at home, which were described in 18 articles. We encourage researchers to keep working in this line.
MQ2. The majority of the articles adopted asynchronous communication to evaluate the patients, which is mainly related to the place to do rehabilitation. The system provides the patient with feedback in real time about his or her degree of success, allowing therapists to remotely supervise the therapy. It is of interest in case of people with problems to go to the rehabilitation center, among others. We thus encourage researchers to pay more attention of this type of communication.
MQ3. This study has identified that the majority of the articles found employed Microsoft Kinect, Nintendo Wii, or Leap Motion to do rehabilitation. Indeed, these share common characteristics, such as interaction paradigm or interaction style. However, Microsoft Kinect highlights among the rest, which has been massively used in the field of physical rehabilitation [36]. We therefore encourage researchers to keep using this kind of device for their research, while trying to replace them with more up-to-date devices.
MQ4. The most common interaction paradigm among the selected studies is the use of Virtual Reality, which is composed of different disciplines, such as augmented reality or mixed reality. This technology allows us to recreate artificially an environment-visual, audio, tactile-to immerse the subjects or the patients in a rehabilitation therapy. In this way, it is possible to easily modify the needs and specificities of the rehabilitation program or games based on the patient's disease. This leads us to recommend that researchers use this technology in their research.
MQ5. The majority of the papers use Natural User Interfaces (air-based) as a consequence of integrating VR in their systems. It is definitely important to promote rehabilitation at home, where patients have to work autonomously away from the therapist supervision.

MQ6.
There is lack of using methodologies when working with games for rehabilitation. This is clearly emphasized in Table 5, where [38] is the only work that uses a methodology. This approach is used to guide the design and creation of exergames, which also serves to prevent the exergames from being dangerous and harmful for patients [27]. Researchers are consequently encouraged to integrate this method in their studies; this would allow the research conducted to go beyond papers.
MQ7. This study identified 14 articles concerned with modifying relevant parameters of games to create specific ones capable of treating patient's concrete needs and limitations, unlike commercial games. Undoubtedly, this is a promising line of research because of the advantages it offers, for example, configuring parameters like range of motions, joints, speed, acceleration or sound, among others. However, the articles found are few compared to the total. Therefore, researchers are encouraged to investigate the integration of this technique in future contributions.
MQ8. The mapping study found that only three articles used the automatic generation of exergames technique to speed up the process of creation new exergames. It allows experts without knowledge of ICT to create their own games based on the patient clinical needs. For this reason, researchers are encouraged to implement this technique and validate their proposal in real-world scenarios.
MQ9 and MQ10. A large number of works that use gamification have been found to improve the quality of life of patients while they enjoy playing. Along with this, our study has identified several techniques to boost motivation by means of points, sounds, level difficulty and rankings, among others. We therefore encourage researchers to keep looking into techniques that motivate patients and help them restore their optimal functioning.

Home Rehabilitation Software Prototype for Young People
The desirable characteristics of a home-based rehabilitation system for young people have been identified in this review. This knowledge has been used to improve an existing prototype [31], initially developed by the authors of this manuscript, to address the physical rehabilitation of children affected by spine pain. Figure 2 shows the visual aspect of the current version of our prototype for home rehabilitation. The virtual avatar, who mimics the patient's movements, is about to make a right-left shoulder abduction exercise. The virtual spheres represent the movement of the trajectory, being ordered regarding their size, that is, from bigger to smaller.
The patient's hands are rendered in red to denote that they are the joints involved in the exercise. To the left, information about the number of repetitions, the current score, the remaining time, and the type of exercise to be performed is shown. To the right, contextual information, such as the available voice commands that can be issued, a short video of the exercise that can be played, and the next exercise that will be performed, is provided to guide the patient in an autonomous way. Above, a vumeter provides visual feedback when the patient talks to the system.

Improvements over an Existing Prototype for Home Rehabilitation
Based on the outcomes extracted from the SMS, some improvements have been developed to be integrated in the this prototype for home rehabilitation. • Autonomy. Initially, the prototype rehabilitation software was designed to support rehabilitation at home, trying to minimize the installation instructions, as well as the ICT skills that a patient should possess. However, the system suffered from a lack of autonomy, in the sense that it had to be connected to an external computer to start up the application. Therefore, taking into account this consideration and the characteristics of the systems studied, the design of a low-cost device has been considered, which integrates an Intel Next Unit of Computing (NUC) small PC along with the device Microsoft Azure Kinect Developer Kit (DK) (https://azure.microsoft.com/es-es/services/kinect-dk). Thus, we reduce the connections and facilitate the installation to the user, only connecting the device as-a-whole to the TV. This improvement was addressed by directly replacing previous hardware devices with new ones. This particularly affects the tracking device, since we replaced the deprecated Microsoft Kinect with the device Microsoft Azure Kinect DK. Since we developed and maintained an internal API to collect data from the tracking device, and since this API has not been changed, there was no impact when replacing the device.
• Monitoring and supervision. The initial version of the system favored a mixed approach based on synchronous and asynchronous feedback. Thus, it was able to assess, in real-time, the patients' degree of success regarding their physical activity. At the same time, the therapist was able to supervise the patients' evolution once they have finished the exercise routine, which involves asynchronous supervision.
However, the former version of the system lacked detailed monitoring when it came to monitor the patient's activity, such as the information related to the mobility of certain body areas. In other words, it was not metrics-oriented. For this reason, the current prototype includes the design of different metrics or indicators.
Two examples are performance and mobility. Their objective is to provide the therapist with relevant information about the patients' activity in order to measure the evolution of their therapy. The integration of this improvement was possible thanks to the use of Personalized Exergame Language (PEL) [60], which allowed us to define key performance indicators. These can be activated depending on the therapeutic goals of each exergame.
• Natural interaction. The interaction type is another feature that makes rehabilitation possible at home. After carrying out the SMS, it has been identified that interaction is not intuitive enough, that is, patients cannot understand which joint to use or which is the movement they have to do to achieve the task. For this reason, we have developed some advanced interactions. For example, the joints are colored in red so that the patient must know which ones have to be used to do the exercise, or the virtual spheres that are ordered regarding their size, i.e., from bigger to smaller to indicate the trajectory a patient must follow.
Apart from this, another drawback was considered, which concerns the navigation through our system by means of classic desktop interaction devices. In this sense, and considering the proposals of the cited works, we have enabled a natural interaction using voice commands. For this purpose, Microsoft's Speech SDK (https://azure.microsoft.com/es-es/services/cognitive-services/speech-services/) has been used to detect key words to facilitate navigation through the system for those people whose condition prevents it.
The more relevant voice commands involve game selection and menu positioning. The integration of this improvement involved the modification of certain graphical components of the application. On the other hand, the integration of voice recognition has been achieved thanks to the design of an additional software module, which is now integrated as an add-on.
• Performance. In virtual rehabilitation systems, it is essential to use devices that track the patients' movements and analyze their mobility. Among the most prominent ones, Microsoft Kinect and Nintendo Wii stand out, as seen in Table 5. However, all of the studied works make use of deprecated versions, which means that motion detection does not rely on cutting edge technology. In view of this situation, the developed prototype makes use of the new version of Kinect, named Microsoft Azure Kinect DK. This device not only significantly improves motion capture, but also allows the data generated by the device to be processed with the services provided by Microsoft's cloud. The integration of this characteristic was a direct consequence of replacing the hardware device used for tracking the patient's joints. This has been previously discussed when addressing the characteristic named autonomy.
• Personalization. Some of the articles studied highlight the possibility of customizing or adapting games based on rehabilitation. In general, most of them allow us to modify parameters such as time, score, speed, acceleration, or complexity, as it can be seen in Table 5. However, only a few allow the establishment of indicators or metrics that help the therapist to measure the patient's performance. In this respect, the distinguishing feature of our proposal is that it is based on the concept of personalized rehabilitation, a principle that the therapist makes use of technological solutions to design individualized treatments. In this context, our prototype makes use of language previously mentioned, PEL [60], which enables the definition of game dynamics associated with physical rehabilitation exercises. The integration of personalizing exergames was a real challenge, since the exergame definition, made by using PEL sentences, involved a major update in the internal architecture to generate the final executable file in an automatic way. To tackle this problem, we followed an approach based on continuous integration, including the incrementally different components of PEL into the system.
• Gamification. The initial prototype only considered basic gamification techniques, such as score and basic visual feedback after completing a repetition of the exergame. According to the studied articles, motivation is essential for successful home rehabilitation. Currently, a number of extra improvements have been added to include achievements or trophies, which can be unlocked under certain conditions. Furthermore, definition of levels and their complexity have been added to increase the engagement of the patient with the game.
Once again, the adopted approach is flexible enough to define this information and maintain the patient's level of engagement. The integration of this characteristic revolves around the idea of the so-called event listeners. When using the software design pattern named publish-suscribe [61], it is possible to make the capture of specific events independent of the actions triggered as a consequence of the former ones. Thus, the internal architecture can scale when integrating new gamification elements.
• Automatic exergame generation. The automatic generation of exergames is one of the approaches that has not yet been sufficiently exploited in this area. However, this feature is one of the strengths of our prototype, since it allows the complete generation of an exergame from a specification in text format. Basically, this is thanks to the glTF specification [62] that supports PEL, which contains the logic associated to the game, while glTF stores the multimedia resources of the game. As a result, the combination of both approaches allows the generation of personalized games for rehabilitation. The integration of this characteristic was as a result of the creation of PEL as a language to define exergames [60], including the lexicon, the syntactic rules, and the semantic rules, along with the use of a parser that is able to process PEL sentences.

Technical Details and Preliminary Evaluation
The architecture of the system for the rehabilitation process has been implemented using the Unity 3D game engine (https://unity3d.com/) together with the .NET ecosystem. Its design has been based on the Microsoft Azure Kinect DK device, which is a relatively new device developed by Microsoft. This has been selected because of the great number of possibilities it offers, such as the motion capture system and the advanced AI algorithms that underpin the device. However, our architecture is scalable enough to integrate other devices that contain skeleton tracking features, if desired.
This system integrates three software modules: capturing, processing, and displaying. The first one collects the data provided by the tracking devices, that is, the positions and rotations of each bone of the human body.
The second one is responsible for receiving the data from the previous module to evaluate, through a set of virtual spheres, a rehabilitation exercise. Regarding the displaying module, it provides the patient with feedback on how the activity was performed.
As previously mentioned, one of the distinguishing feature of this system is the personalization of exergames along with its automatic generation. It is possible, mainly, thanks to the use of the glTF format, which is an open format, based on the JSON standard, for distributing 3D scenes in an efficient and interoperable way. Taking advantage of this format, this system makes use of a custom language, named PEL [60], which is supported by the glTF specification. Basically, our language is made up of a series of components, which through parsing, automatically generate therapeutic exergames focused on rehabilitating patients. The components of an exergame are briefly described next: • Scene. This component contains three different views that the game is split into: tutorial view, participant view, and result view. The first one shows how the patient has to perform the activity. The seconds one is a scene in which the patient performs the activity that was previously visualized, with movements replicated by the avatar. The third one is a view where the results are shown as a consequence of the actions carried out by the patient.
• Actors. They represent the elements of the game that the avatar must interact with. These objects essentially make up a sequence of activity the patient must perform, with behavior that may be either static or dynamic.
• Gameplay. It defines the set of rules which are able to gamify the environment. Correct execution of the game mechanics deploys gamification elements to capture interest and motivate the user.
Finally, one experiment was conducted to validate the system, which involved 2 instructors and 20 girls enrolled in a rhythmic gymnastics club. The participants were aged between 11 and 19 and agreed to participate in the tests to assess the system in terms of usability, understanding, and suitability. Among them, eight girls suffered from an injury related to spine pain, which required home rehabilitation at that moment. In general, the participants valued the tool as an excellent starting point to facilitate the rehabilitation process, considering it fun, interesting, and easy to use. The reader is encouraged to refer to [31] to obtain more information about the conducted experiment. Also, prior to the beginning of the experience, both the girls and their parents were informed that the collected data will be exclusively used for research purposes in a confidential way. A consent form statement was filled out by every single patient (or legal tutor) before conducting the experiment. On the other hand, and in the context of the research project in which this work has been carried out, the Research

Conclusions and Future Work
The use of virtual systems for physical rehabilitation is a field of growing interest, in which a large number of contributions have been made in recent years. However, most of the existing developments are aimed at elderly people and patients with specific pathologies. Our interest is focused on the rehabilitation of a particular group, young patients (children and adolescents), in whom the lack of motivation and the risk of dropping out of treatment are greater. It is considered that the use of gamification techniques in rehabilitation software may partly mitigate this problem. On the other hand, since the patient's pathologies can be varied, it is also of interest that exergames and exercise routines may be defined by the therapist and adapted to the particularities of each patient and specific pathologies.
In order to have a better knowledge of the current state of this area, a systematic mapping study has been carried out. This analysis indicates that most of the published articles describe systems that allow the patient to work autonomously at home, which are mostly based on asynchronous communication with the specialist.
Moreover, they support a natural interaction (air-based) thanks to the use of generic and widely used gaming devices among young people, such as Microsoft Kinect, Nintendo Wii mote, or Leap motion. It is necessary to emphasize that there are few works that support the automatic generation of exergames and the personalization of the game features for the patients, and even fewer that propose some kind of methodology to be followed in the development or use of exergames.
The conclusions drawn from the mapping study have served to improve an existing software prototype for home rehabilitation. Thus, and in relation to the feedback received by the patient, this can be instant and provided by the application, or deferred and performed by the therapist. To better support asynchronous communication with the specialist, a set of metrics and performance indicators have been incorporated to the system. Regarding to the interaction style between the user and the application, the use of voice commands have been added, which allow a more natural communication, especially for patients with some severe movement limitation. A noteworthy and differentiating feature of the current proposal is the support for the personalization of exercise routines, as well as the automatic generation of exergames, which is carried out in the context of a co-creative methodological proposal among the different stakeholders involved in rehabilitation therapy.
The present work opens a series of working lines that are expected to continue advancing with the research.
On the one hand, it is necessary to deepen and incorporate to the developed system more gamification mechanisms, such as daily or weekly challenges. We also want to improve and expand the type and amount of information that the system provides to the therapist, for subsequent analysis and decision making. In this sense, we are working in conjunction with rehabilitation specialists and physiotherapists to define new metrics and parameters that are considered appropriate and necessary to record with the aim of including in the system. Another improvement to be integrated consists in extending the proposed exergame specification language. Moreover, it would be ideal that the system, once installed in the patient's home, may be calibrated and customized based on the previous and current patient's performance. We are working on this as well. Finally, and as the developed framework evolves, formative and summative evaluations of the system will be carried out, involving both experts in the area and end users. Funding: This research was funded by Instituto de Salud Carlos III grant number DTS18/00122, co-funded by European Regional Development Fund, European Social Fund "Investing in your future".

Acknowledgments:
The authors would like to thank José Jesús Castro-Schez for his support in designing PEL and Fátima Bernal for creating the visual designs of the graphical user interface.

Conflicts of Interest:
The authors declare no conflict of interest.