The Blexer system – Adaptive full play therapeutic exergames with web-based supervision for people with motor dysfunctionalities

This work presents the “Blexer” (Blender Exergames) system for therapeutic exergames designed for people with physical dysfunctionalities. The users control the games with corporal movements, captured by the Kinect® sensor. Games incorporate an amplifying functionality that enhances the immersive feeling. Via the medical platform “Blexer-med”, clinicians configure the games individually for each patient. On the user’s PC, the middleware “Chiro” is used to transmit configuration data and results between the games and the web platform. Opposed to similar approaches found in literature, our system does not rely on pathology specific mini-games but focus on the design of generic “Full-Play” games, with a complete and compelling gaming environment. The principles of eight Core Drives defined in the Octalysis framework have been applied in the design of the first prototype game “Phiby’s Adventure” presented here. It contains four generic exercises useful for daily training.


Introduction
For people with physical impairments, the possibilities to do sports are very limited.Nevertheless, they need to keep fit just as anyone else; even more, if they are wheelchair dependent because muscles tend to reduce with a lack of usage.Many people suffering from chronical diseases need to visit a physiotherapist multiple times a week, which is a costly and time-consuming burden.
Due to this situation, exergames are becoming more and more popular, as they offer a cheap possibility to exercise at home.Many scientific studies for application in rehabilitation systems have appeared recently, especially with the availability of 3D motion capture cameras like the Microsoft Kinect, proving that home exercising using virtual reality environments is healthy and safe [1,2,3].It has also been observed that video games, not specially designed for clinical purposes, are just as efficient as conventional therapies and can lead to even better therapeutic outcomes.Furthermore, games prevent monotony, increase motivation, provide direct feedback, and allow double-task training [2,4].
Nevertheless, most proposals found in literature present exergames specifically designed for the rehabilitation of frequent diseases like Stroke or Parkinson's, which affect mainly the elderly.It is difficult to find solutions for a broader range of people with different disabilities, i.e. young people suffering from rare diseases are underrepresented.
Furthermore, it is rare to find solutions that qualify for more than mini-games.By mini-game, we refer to a noncomplex environment with a simple game mechanic (usually only one scene, one character, one goal) and playable in a short time.Usually, mini-games aim at performing few and specific movements, as e.g.catching apples from a tree or throwing bowling balls.A definition of a mini-game can be found as: "a minor or incidental game within a larger video game".* Minigames merely represent the translation of the exercises to a virtual environment and involve very few of the multiple motivational factors inherent to common game mechanics.Usually, the only condition that maintain the player engaged after finishing it is to beat their high-score or the one of other players.In our opinion, physical exercises are too tiring to use this type of motivation, and even more for people with restrictions in motor functions, so the player at the end would be exhausted instead of engaged.Those are quite important to achieve the engagement of the players such that they forget about the exercise itself.The more an exergame equals to a game than to an exercise, the better would be its effect on the patients.The more they immerge into a game, the less they are aware of doing rehabilitation, while forcing themselves more by doing the exercises necessary to follow the gameplay.They are motivated to win and therefore do what the game requires.To achieve this, the exergame should be complex and incorporate a story or purpose, independent from the exercise to do.Instead, exercises should just build the method to reach goals, so that the player exercises without being conscious about it.
Considering all the mentioned facts, the best and most efficient way would be to camouflage exercises in a large and compelling game environment, in such a way that the player is not conscious about the physical effort.
From now on, the authors will refer to a large game in contrast to a mini-game as a "full-play-exergame".It could include the exercises in form of mini-games, but they could also be resolved implicitly (by moving a character, opening/closing menus etc.).
Engagement is a very important factor to increase the motivation of a person in many situations of life, as can be learned from Yu-kai Chou in his book "Actionable Gamification" [5].Chou discovered the existence of eight main core drives (CDs) that usually engage people and analysed them in the so-called Octalysis framework: It is possible to apply the CDs to any task that should be gamified, so in this work, we took them as a guideline to create motivational factors in an exergame.CD 2 and CD 4 are the easiest and most straightforward elements to implement in a game: CD 2 is represented by the goal to be reached and CD 4 by the award to be obtained for it.
* https://www.wordnik.com/words/minigameHowever, all other core drives, although subtler, are the ones that really engage the player.A very important one is CD 1, "Epic Meaning & Calling", which refers to the identification of the player with the main game character of a game and their feeling to be part of its history.As a consequence, the creation of full-play-games with a complex history and meaning, seems to us a very promising way to really engage patients in doing their exercises, above all the long-time exercises, which are needed in case of chronical diseases.Other interesting motivational factors are: CD 3, which is expressed when users are engaged in a creative process or CD 7, which keeps a player constantly engaged with the desire to find out what is happening next in the game.
So, the best way to really engage patients in their exercises, especially in long-time therapy, seems to be fullplay-games with a complex story and purpose.In this sense, the first prototype of a full game, which is going to be tested as beta version, has been created as part of the project "Blexer" (Blender Exergames), which aims at creating a complex exergaming environment for people with physical disabilities.The game is a follow up of our former work published in [6], where a group of people suffering from rare muscle diseases tested the four minigames that build the basis of our full-play game "Phiby's Adventures".A preliminary version of the game was recently presented in [7], the medical platform "Blexermed" in [8].
The remainder of this article is organized as follows: Section 2 gives an overview of the state of the art of similar exergame applications.Section 3 presents the global "Blexer" system architecture, followed by sections 4 and 5 that explain in detail the full-play game and the connected medical web-platform "Blexer-med".Here, as a major concern, the possibility of personalization and the adaptability of the games to any patient is highlighted.Taking into account the different capabilities and needs of the player, we focus on two important functionalities:  Amplification of weak user movements to wider ones, to achieve a deeper immersive feeling and identification with the game character. Individual configurability of the exercise's difficulties, to be performed remotely by a clinician with help of the "Blexer-med" web platform.Finally, section 6 adds a description of the operational cycle of the whole system, providing also the visualization of a fictitious example use case.Real results still cannot be provided, as to the time of writing, long-term tests are in preparation.Section 7 concludes with our mayor findings and presentation of ongoing and future work of the project.

State of the Art
To the best of our knowledge, the work presented here is the first communication of a full-play-exergame based on The Blexer system -Adaptive full play therapeutic exergames with web-based supervision for people with motor dysfunctionalities 3 Kinect, as opposed to mini-games with very specific purposes.To give just two out of many examples: a rehabilitation game aimed at training dynamic postural control for people with Parkinson's disease is presented in [9] and the authors of [10] designed "PhysioMate", a game for stroke patients and elderly, that helps to train the upperbody for balance and motor coordination.
Physical Therapy and Fitness is important and necessary for everybody, as it provides opportunities for strength development, physical conditioning and functional training.Unfortunately, the possibilities to do sports are very limited for people with physical impairments.If they are wheelchair dependent, there are even less, such that they usually depend on attending some days a week to physiotherapist sessions.To overcome this problem, exergaming, i.e. using active console video games that track player movements to control the game (e.g., Xbox-Kinect, Wii), may provide an alternative form of exercise, if the games were configurable to the possibilities and needs of the disabled.Bonnechère et al. showed that video games, not especially designed for clinical purposes, are as efficient as conventional therapies or even lead to better therapeutic outcomes.They also have numerous advantages, such as preventing monotony and boredom, increasing motivation, providing direct feedback, and allowing double-task training [4].
There are many proposals in literature that present especially designed exergames for the rehabilitation of frequent diseases like Stroke or Parkinson's, which mainly affect elderly.Younger people, who are much more receptive to games, are less frequently addressed.There are proposals for children with Cerebral Palsy as e.g.[11] but no proposals have been found for rare diseases.To the best of our knowledge, there is also no proposal for a general solution useful for a broad range of people with different disabilities, which goes beyond the possibilities of a minigame, i.e. incorporates some kind of a history or purpose other than the exercise, to engage the player.
Regarding the remote configuration and management of the therapeutic games, which has the advantage that people can use them at their homes under supervision by the therapists, the solution is a web platform that can be connected with the gaming software.Some commercially available solutions have been found, e.g.MIRA Rehab Limited [12] and VirtualRehab [13].Similar to the here presented work, these games register movements with help of the Microsoft Kinect camera and the clinician receives this data via the platform to evaluate the progress of the patient and gets the chance to reconfigure the adjustments.Both systems are applicable to different types of users like patients with Down syndrome, muscular diseases or cerebral palsy.
Furthermore, two similar systems have been developed in the same research group of Valladolid University: TELEKIN [14] and "La Isla EPIKa" [15].The TELEKIN environment consists of four modules: an administrator web, a therapist web, a family web and the game module.The games work with either a Kinect sensor or a Leap Motion sensor to capture only the hand movements."La Isla EPIKa" aims at the rehabilitation of stroke patients.Again, via a web platform, the therapist can adjust a number of difficulty parameters; the web offers also a guided mode for patients with severe paralysis.
Apart from these works, the European project REWIRE [16] (Rehabilitative Layout in Responsive Home Environment), funded by the seventh framework program, has to be mentioned.The consortium developed a rehabilitation platform for stroke patients based on virtual reality that allows the patients to do their exercises at home under remote monitoring by the hospital.The platform is composed of three parts: the patient station, the hospital station and the networking station.The patient station offers different simple exercise games, which are working with different sensors, as there is the Microsoft Kinect camera, a Balance Board and a haptic device.The clinician at the hospital who also receives the session output results, via the web, can configure them.
All mentioned systems have one thing in common: they manage a number of mini-games, i.e. games without interrelation as each represents a different exercise in a different environment and with an own purpose.The patients have to use those corresponding to their needs repeatedly to improve their physical state, but the exercise itself is not very different to doing it in a clinical centre together with a therapist.The difference of our work is to overcome this pure translation of exercises from the gym to a virtual environment.Instead, the exercises are integrated into a meaningful gaming environment, where the user is not aware of doing exercises.Instead, they are engaged to have a good gaming experience and to win.This avoids that the patients are getting bored, tired and demotivated through too much repetitiveness and too evident exercises.Here, the application of gamification rules is very useful, as they help to create a gameplay that captures the players, such that they continue without being forced.

The "Blexer" System Architecture
The whole "Blexer" system environment consists of two main parts as shown in Fig. 1: the user side (left), and the clinical side (right, yellow part).The user side represents an infinite number of users, who host one or more of the exergames provided by the platform on their PC, together with the middleware "Chiro" [17].The clinical side consists in a database and a web server that hosts the platform "Blexer-med".An infinite number of medical centres and their belonging therapists and doctors can use it.Here, clinicians enrol their patients, select the adequate games for each and configure them individually.Then they have the possibility to monitor their performance and adjust the parameters constantly.

Patient's side
The patient's PC is working as gaming station, with the exergame(s) and the middleware "Chiro" installed on it.
Chiro is in charge of transmitting the data obtained from one or more sensors to the game.It can be configured for the Xbox 360 Kinect camera, a mobile phone and a VR headset [18].The VR headset allows capturing additional movements like wrist and head rotation, which are not included in the SDK library provided by Microsoft for the Kinect.Chiro is modular and can host different middleware, which enables to add other sensors easily.In this way, i.e. a heart rate measure or an oximeter could provide additional information about the physical state of the patient, with the aim to adapt the course of the game to their actual condition.Nevertheless, for the game presented here, we only use the Kinect data.

Clinical Side
The right side of Fig. 1 shows how the medical´s access to games is resolved in the "Blexer-med" web platform.It consists of a web server connected to a MySQL database that handles the communication between the clinicians and the middleware.The clinicians (therapists or doctors of different centres) can register their patients, assign one or more games of those available in the platform (currently it includes the one presented below) and adjust the parameters of the exercises involved in the games to the capabilities and needs of the patients.When the patient starts the game at home, he/she first logs into the middleware, which then connects to the database and downloads the configuration information of the patient, stored in JSON (Java Script Object Notation) format, into a text file.After each playing session, the game writes the results (scores, playing times etc.) into another text file which is then uploaded by the middleware to the web platform.In case of a successful upload, the information is deleted from the file, if not, it is kept until the next successful internet connection.In this way, the clinician can analyse the results as soon as the patient terminated their exercise and evaluate their performance.According to it, the professional can readjust the parameter for the next play if needed.
The "Blexer" environment is modular and designed to manage an unlimited number of different games.Those games could be of any genre (action, adventure, role-play, strategy etc.), as long as they are designed for a "corporal play", i.e. the player has to perform gestures and movements.The first prototype game we developed for the platform and presented in the next section only uses movements captured by the Kinect.As modelling environment, we applied the Blender game engine [19].

Requirements
The goal was the creation of a large full-play game for people with restricted motor functionalities that motivates them to do physical exercises in addition to their regular physiotherapy sessions.The basis were four types of exercise, already tested for functionality in [6].The aim was to include those exercises into an interesting environment and engaging gameplay that allows the repetition of the exercises without inducing boredom.To achieve this, specific game mechanics were added that motivate the player according to some of the formerly introduced core drives.In the following, we describe the flow of the game and the included exercises.

Gameplay, character, story, world and mechanics
The first step before creating the game was choosing an adequate genre.The decision fell on the adventure type, as it provides many possibilities to resolve the CD 1 (Epic meaning & Calling).Here, a cute game character and a nice story can help the player to identify with it, even more due to the tasks that have to be resolved to reach the goal.Those tasks (that are actually the exercises) give sense to the game and therefore the player performs them willingly they want to help the game character.The character we created is the young amphibian called "Phiby" (see Fig.  The story can be resumed as follows: After a spaceship accident, Phiby's egg has fallen into the lake on an unknown planet; Phiby is born and has to find his family.In this first part, he explores the world around him to find the way out of a valley.To do so, he has to overcome certain obstacles like lakes ("Dive and eat"), rivers ("Row the boat"), and slopes ("Climb the tree").There are also fallen trees he has to chop to obtain pieces of wood ("Chop the wood"), which later can be used to build bridges over the rivers or little huts to rest and save the progress.These tasks are the physical exercises to be performed by the player (exercise names in brackets) and described in the following section in detail.Fig. 3 shows screen shots of the four exercises.
To achieve a repetitive execution of the exercises without boring the player, a game flow has been designed that lets the user decide which tasks to do next.Therefore, motivation comes from the game mechanics described as following.Most of them are objectives and awards that provoke CD 4 (Ownership & possession) and CD 6 (Scarcity & Impatience), but some also tackle others as indicated:  Wood: Every chopping exercise rewards 7 kg of wood.
Fig. 3. Screen shots of the game-exercises from left to right, up-down: "Dive and eat", "Chop the wood", "Row the boat" and "Climb the tree".The text shows points/target and the time left to reach the target.
 Bridges: 5 kg of wood is required to build a bridge over a river after having crossed rowing.The bridge allows returning to the former cell without effort. Huts: Every 10 kg of wood permits building a hut in a specific point of the map.At this point, the status of the game will be saved, such that the user can resume the game from that point on. Map: Whenever one of the tests is passed, a new area of the "world" is discovered, so the player gradually gets aware of the surroundings (CD 6 -Scarcity & Impatience & CD 7 -Unpredictability & Curiosity) and is motivated to keep on exploring the landscape and to bring "Phiby" to his destination (CD 1 -Epic meaning & Calling).Whenever the player decides to build a hut, a larger part of the map is discovered, such that it is easier to find the way to the end. Apples.In-between the obstacles, eating apples help to recover the energy lost during the exercises.Every apple recovers 10% of the energy lost in an exercise.
Fig. 4 shows a simplified diagram of the currently implemented game structure.The layout of the game environment is stored in an XML file and consists of a map of 16x8 square cells, each representing a patch of the landscape to be explored.The XML parser reads the information of the scenes to be built from the file and passes it to the game engine.Every cell has one obstacle (lake, trunk, river, tree or a wall) in each border, which has to be passed to enter the adjacent cell by executing the corresponding exercise, DIVE, CHOP, ROW, and CLIMB, except for the wall, which is an insurmountable barrier.The user can freely choose where to go by moving a red arrow with the right hand that Phiby is constantly following.When Phiby reaches the arrow close to an obstacle, the scene of the corresponding exercise is loaded.The Blexer system -Adaptive full play therapeutic exergames with web-based supervision for people with motor dysfunctionalities Fig. 5 shows screen shots of an intermediate scene where Phiby arrived climbing up the tree behind the wall.He has the possibility to choose the way through two different lakes (north & west), through chopping wood (east) or to the scene before (south) going down the tree again (no exercise required).Energy is on 85% and 7kg of wood have been gained.Phiby is constantly moving and the user controls the direction he should go with the right hand; the red arrow helps to see the direction.Once reaching the object (lake, trunk or tree), the corresponding exercise starts.The lower image shows the same scene with the apple eaten (energy 100%) and the map opened (by raising the left hand).The game is paused until the map is closed by raising the other hand.It can be also quit in this moment by raising the left hand again.The map in the figure shows that in that moment three cells have been visited.

Technical description of the exercises
As stated at the beginning, apart from enhancing the motivation of the users to play and do their exercises, two more objectives are inherent to the work presented here: 1) Augment the immersive feeling during the play by amplification of the user's movements.2) Adapt the difficulty of the exercises to the user's possibilities and needs by adjustment of the corresponding parameters.
The amplification of the user's movements means that small movements are virtually represented as larger ones, such that the game character does not simply copy them but compensates the missing amplitude.E.g. if the game character has to raise the arm with the axe to chop the wood, but the patient is not able to raise it as high as needed, the maximum point of the patient's arm movement is calibrated to the maximum point of the game character's arm movement.In this way, every movement is scaled inside the game and appear the same as if a user without physical restrictions was playing.Fig. 6 visualizes this principle and how it is applied to the skeleton of Phiby.To achieve these scaling factors, the first step is always the measurement of the user's maximum motion ranges of all limbs, head and trunk, performed with a game-independent tool [6,16].Character's skeleton and Kinect skeleton with amplified arm motion.

Chop the wood
The movement to be performed in this exercise is an up and down movement of the right arm.The user has to keep the arm up during a certain time to "charge" the axe.Charging is visualized with a silver ring around the axe as shown in Fig. 7 on the left.When energy is high enough, a flash appears, and the user can move the arm down to chop the wood (Fig. 7, right image).The focus of the exercise is set on endurance, precision and speed are not necessary.The time to keep the arm up is set to avoid that patients simply let the arm fall down.In the current version, the number of trunks to chop and the time to finish it can be adjusted.In future versions, the duration to hold the arm up can be easily added.

Dive and eat
The diving exercise focuses only on the movement of the trunk, in forward, backward and sideways direction.This is a very important exercise for wheelchair users, as they have to strengthen their back and pelvic muscles.In this exercise, the pollywog is diving through a lake and the user controls its direction by inclining in four directions.The goal is to capture the pieces of plankton floating in the water (Fig. 8, right image).The adjustable parameters are the number of planktons and the time to find them.Figs. 8  and 9 show some views of the technical implementation of this exercise.The upper image of Fig. 9 shows the "naked" lake model as a sculptured grid with a sandy texture.The lower image shows a bird's eye view of the lake, filled with water and in between a deep forest.This is a part of the global environment, by not used in the currently implemented game-flow as it needs too much computing power.The left image of Fig. 9 shows Phiby as a pollywog with the avatar-grid that is used to detect the collisions with the plankton (right image), the ground, water surface and other objects in the lake.

Row the boat
In this scene, the character is sitting in a rowing boat and has to cross a river.Here, the adjustable parameters are the distance to the shore and the time to reach it.To push the boat, both arms have to be moved back and forth, without needing an exactly symmetrical movement.Currently, the speed of the boat depends on the speed of movements, which motivates the user move quicker to finish the exercise earlier.Possible enhancements of difficulty are obstacles or wild animals that could be added in the water to be avoided or escaped, or currents that augment the difficulty to advance in the water.Fig. 10 shows a detail of the model as viewed in Blender.

Climb the tree
In the fourth type of exercise, "Phiby" has to climb up a tree, which is adjustable in height.Fig. 11 shows the model of an exaggeratedly high tree from bird's eye view.In the game play, the purpose of climbing the tree is to overcome a wall to reach a higher part of the valley.
The therapist can adjust the height of the tree, which implicitly determines the number of arm movements to be made, and the time to reach the top.The arm movements have to be alternated, a small blue point indicates which hand the user needs to raise in each moment.When a movement is successful, the character climbs a step up (animated movement).This movement is universal; it could be used in future games in many other scenes, i.e. to climb up a steep face or to get out of a hole.The Blexer system -Adaptive full play therapeutic exergames with web-based supervision for people with motor dysfunctionalities

User roles
The "Blexer-med" web environment is a tool that uses exclusively the clinicians (doctor or therapist) for configuration and supervision of the exercises of their patients.In some other approaches found in literature, the connected web platform allows also the user e.g. to choose a game or to access the configuration.We consciously don't include this, because we want to create a feeling in the player of not being supervised and not explicitly doing exercises but concentrate on the game itself.For technical reasons, apart from clinicians, the platform gives access to two other types of users: Super-Administrator and Centre-Administrator. Depending on their role, users have the following capacities:  Observe and comment the data of other patients of the same centre.

Games
The requirement for the web environment is to allow the inclusion of any type of game, as long as it contains at least one physical exercise that is configurable by at least one parameter.The genres of the games could be of different kind, e.g.puzzle games (the user's movements can be used to move the tokens), races (the user moves the car, horse or whatever with their body) or adventure games as the former described one.This type of game includes certainly the most possibilities to include many different movements.
To be generic, a hierarchical structure is needed, and has been designed as follows: a root (= game), the depending exercises and a generic number of adjustable parameters: In case of "Phiby's Adventure", each exercise equals to a task to perform, e.g.climbing.The parameters can be adjusted according to the difficulty level of the exercise, e.g. in case of climbing, the height of the tree and/or the time to perform it.
To allow the configuration of any type of game to any type of user, this structure has to be totally generic and extensible, such that it does not depend on the type or 9 number of parameters handled in each exercise.In this way, the same game could be configured differently for any player.

Layered Architecture
As stated at the beginning, Fig. 1 shows the architecture of the currently implemented system environment: the patient's PC contains the exergame, created in Blender and a Middleware named "Chiro" that is in charge to transmit the data obtained from different sensors which is used as input to control the games.
With the aim of avoiding from the beginning the possible coupling between the different parts that compose the "Blexer-med" web environment, the web platform is structured into three layers: (i) A data layer using MySQL server as an open source database manager.This layer stores all data belonging to the clinicians, administrators, centre, patients, and game settings, etc.This layer provides information to the business layer in case of requests.(ii) A business layer implemented in Java using a RESTful web service (Representational State Transfer).The web service is accessed with help of the API JAX-RS (Java API for RESTful Web Services).This layer processes the user requests and accesses to the database.(iii) A presentation layer which is the heart of the distributed system that manages three types of interactions based on the client/server model.The aim of this layer is to maintain the system independent and easily adaptable to different platforms.The presentation layer shows the information to the user (clinician) and captures the events triggered by them.
As Fig. 1 shows, these are the protocols used in the different interactions: 1. User  Web interaction with HTTP (Hypertext Transfer Protocol) to access the platform 2. Middleware  Web interaction with HTTP to download game configuration and upload user results 3. Database  Web interaction with JDBC (Java Database Connectivity) to obtain the data to transmit to middleware or user.

Database
The database is a relational database and contains identification tables for administrators, centres, clinicians and patients on one hand, and game dependent tables for comments, game description, game setting, exercises, and session results.Two types of dependencies are used:  Identifying (the "son's" existence depends on the "father's" existence), e.g. if a centre is deleted, also the administrator, clinicians and patients are deleted  Not identifying and independent (a "son" would not be deleted in case the "father" was), e.g.Session Results are not deleted if a game is deleted.This relation is needed to save performance data of the patients as long as they are registered on the platform, as it could be still of interest for the therapist.

Web representation
Regarding the presentation layer, Fig. 12 shows the screen containing the web form created for the Super-Administrator to define a new game.After creation, a further form permits the definition of the individual exercises and the inherent adjustable parameters as shown for "Phiby's Adventures" in Fig. 13.The web appearance for clinicians is different, they don't have access to the configuration of the game itself, they only can adjust the parameters of each exercise as shown in Fig. 14.The screen permits the overview of all formerly defined configurations and offers the possibility to select one of them or to add a new one.To check the results after play, the clinician has the possibility to visualize the sequence of scores on the screen ordered by date and to save this data to an Excel file (see Fig. 15).The Blexer system -Adaptive full play therapeutic exergames with web-based supervision for people with motor dysfunctionalities Fig. 13.Super-Administrator view of the exercises defined for a game.Example for the game Phiby's Adventures which contains four exercises (Dive, Chop, Row and Climb).On the left, the tabs "Centres" and "Admin" give access to administrate health centres and their staff."Games" gives access to administrate different games.Example for results obtained in different sessions performing the "Dive and eat" exercise."Time limit" and "Time" in minutes.

Data exchange for game configuration and observation of results
The configuration data set up by the clinician in the web environment, as well as the results obtained from the play, are stored in text files formatted in JSON (Java Script Object Notation) format to facilitate the exchange.As illustrated in Fig. 3, the middleware "Chiro" sends a HTTP † All names and personal data is invented and any possible relation to a real case is neither intended nor known.The performance data is also not real.
GET request to the web service to download the configuration file, at the moment the user logs in.
If the user authentication was successful, the web service creates a JSON file containing the parameters marked by the therapist as "in use" (see also example in Fig. 16).The file contains a recursive structure with map for each game and in it a map for each exercise.A map is formed by a set of items, each consisting in the structure "key-value".The key is an array of three strings: [id_exercise, code, title]; the value is obtained from the object created for the exercise.The file is then downloaded by "Chiro" and saved to the user's hard disc.Finally, the game itself deserializes the JSON code and applies the values established for the different parameters in each exercise to the game flow.
For the interchange of the results obtained during the game play (scores, times etc.), the game creates a text file, also in JSON format, containing those values in form of an array.When the patient quits the game and closes "Chiro", "Chiro" sends one result at each timer to the web platform, awaiting the confirmation of a correct de-serialization.In case of success, the result is deleted from the file and the next one will be sent.In this way, no results are lost due to bad internet connections.When a connection fails, the failed data will be re-sent the next time the user starts "Chiro".

Example Use case
In the following, we present a use case † to illustrate the workflow and objective of usage of our system: "Pepe Sanz" suffers a progressive muscular dystrophy and is using a wheelchair for 5 years.As a small boy, he could walk and play outside with his friends, now he is mostly alone and sitting in front of his computer.Unfortunately, the seated position is provoking a quicker degeneration of his muscle strength and a bad posture.His physiotherapist is visiting him twice a week and recommends daily arm and trunk movements to keep fit, but he is not motivated to do them, as they are very arduous and tiring.As he is a passionate gamer, he tried out the Xbox with Kinect and some sports and adventure games.But soon he got frustrated, as it was impossible for him to 11 reach the same scores as his friends.One day, Maria, his physiotherapist, came up with "Phiby's Adventure", connected it to his Kinect and calibrated the embedded movement amplifier to Pepe's motion range.Through the web, she adjusted the parameters of the exercises as visualized in Fig. 13 for "Dive and eat" (described in section 4.3.2,screen shot in Fig. 6).Maria observed on the results screen (Fig. 14), that the initial setting of 10 pieces of plankton was too much, Pepe only got 5 and gave up after 20 minutes as it was the first time he played.Nevertheless, Maria augmented to 25 pieces and Pepe got 20, needing the maximum amount of time.As this was evidently too much effort, Maria set up only 3 pieces to get in 25 minutes.The first time, Pepe got them in 13 minutes, the next time, on the same day, he needed 25 minutes, because he got tired from the former play, where he also realized other exercises of the game.In short time he got engaged, because his therapist found quickly the right values for all exercises, and he played more each day and progressed such that his back muscles augmented in strength.
This story is not real, and the values have been obtained by the authors during functionality tests, but we believe that they are useful to show how the tool could be used.Currently, real test with a large group of users are running and will be published at the end of 2018.

Conclusions and Future Work
In this work, we presented the therapeutic gaming environment "Blexer" (Blender Exergames) consisting in the platform "Blexer-med" and currently one prototype game of adventure type.The system aims at fulfilling two purposes: a) Assist doctors and physiotherapists in the usage of exergames as an additional instrument for their therapies.b) Provide people with motor dysfunctionalities with the possibility to play exergames that adapt to their individual needs, as opposite to commercially available games of sports genre.The platform can be connected to customized games that incorporate different configurable exercises based on movements captured by the Kinect camera.Those games are not simple translations of real exercises to a virtual environment but incorporate advanced game mechanics that enhance the user's immersive feeling and motivation.Via the web-based platform "Blexer-med", the therapist can adjust the difficulty of the exercises in relation to the patient's needs and preferences, with the aim to maximize the user's motivation to perform the exercises without being aware.
Currently, the first prototype of a full play adventure game, "Phiby's Adventure", which contains four different types of exercises repeated in the order chosen by the patient, is tested together with the platform on a number of volunteers suffering from different neurological rare diseases.Results will be published at the end of the year.
In our ongoing work, we are porting the system to the Unity 3D game engine and integrating Xbox One Kinect v2 body and face data.The middleware will be enhanced with other sensors as heart frequency measure and oximeter to capture information about the user's physical state.Together with an emotion detection process, the possibilities to realize a Dynamic Difficulty Adjustment (DDA), i.e. to adapt the pace and course of the game intelligently to the user's performance and mood, will be studied to achieve a maximized motivation.Also, the possibility to add a multiplayer mode will be considered, as this would potentiate a further core drive as a motivational factor: CD 5 (Social Influence & Relatedness).
For the future, it is planned to automatize the adaptation of the game flow to the user's performance and mood in real time.Therefore, the game would observe the user and adjust the parameters within the thresholds defined by the therapist, with the aim to keep the patient's motivation at a maximum level.More advanced parameters regarding the exercises will be taken into account and decisions will be reported to the therapist via the platform.
Furthermore, a face recognition will be implemented to check if the right person is playing, a quality check of the movements and a more versatile configuration will be added, and the processing of additional sensor data will be integrated to enhance the possibilities to check the user's performance.All enhancement will then be tested with different types of user adaptive games.
2), giving also the name of the game "Phiby's Adventure".It has been modelled in different life stages (pollywog, toddler and infant), with the aim to represent the gaining of strength and skills due to the exercises (CD 2 -Development & accomplishment, CD 4 -Ownership & Possession).Nevertheless, in the game prototype presented here, it still does not appear in all forms.EAI Endorsed Transactions on Serious Games 12 2017 -09 2018 | Volume 5 | Issue 16 | e2

Fig. 7 :
Fig. 7: Details of "Chop the wood".Left: the axe is charging, right: it is ready to use.

Fig. 10 :
Fig. 10: Phiby's model in the boat showing the avatar (cylinder grid) to check collisions, the camaras for 1 st and 3 rd person views (black pyramidal grids) and the "rope" tool (white objects) used to transmit the rowing movement to the rudders.

Fig. 11 :
Fig. 11: Tree model showing a different configuration of the height.
(i) Super-Administrator (super-user with several functions):  Create new game structures including: name, description, exercises, configurable parameters, etc.Furthermore, he/she is in close contact to the game developer for carrying out new configurations in the web environment based on the new game characteristics. Create Centres: For new patients and professionals to access to "Blexer-med". Register and unregister Centre-Administrators, Clinicians and Patients.(ii) Centre-Administrator  Register and unregister Clinicians and Patients.(iii) Clinician (therapist or doctor)  Register and unregister their patients. Configure the gaming parameters of their patients.

Fig. 12 .
Fig. 12.View of the form to add new games to the platform.The first one is already existing.

Fig. 14 .
Fig. 14.Example for different configurations made over time for one exercise

Fig. 16 .
Fig. 16.Exchange of configuration information and results between the game and the web