Development of a Virtual Pet Simulator for Pain and Stress Distraction for Pediatric Patients using Intelligent Techniques

Pediatric medical procedures are often stressful and painful for children, so they can resist and make the work of doctors and nurses a little more complicated. This research aims to develop a virtual pet simulator to distract pediatric patients from pain and stress using smart techniques. The methodology used is SUM. The primary data for the development of the simulator were gravity, the player's position, the speed, and the mass for the calculation of the predictive physics in the toy to interact with the pet. As part of the intelligent techniques, the Astar algorithm was used for the pet to follow the user and the flocking algorithm to have a natural behavior of a group of animals and thus have a higher immersion level. Trials were conducted with pediatric patients where those who made use of the virtual pet simulator during the medical procedure felt less pain and stress than those who did not try the simulator. Therefore, it is highly recommended to use alternatives such as the one developed to reduce pain and stress in pediatric patients. Keywords—Virtual pet; pediatric patients; pain; stress; smart techniques; A-star algorithm; flocking algorithm


I. INTRODUCTION
Pain is an emotional and unpleasant experience that the pediatrician often encounters in his daily activities with his patients. To treat pain and anxiety in the best way is to avoid them. Therefore, it is essential to try to avoid anxiety and stress that causes painful sensations [1].
Child distraction appears to be the most widely used behavior management technique during medical procedures [2]. Pet therapy can also be used to distract pediatric patients in stressful or painful situations. Studies show that children who interact with therapy pets, typically dogs, show increased coping skills and reduced anxiety levels. [3].
A recent technological advance that can be an attractive distraction is virtual reality [4], which uses virtual environments. Virtual reality immersion systems are also known to allow the user to interact with the computerized environment they are viewing and the feasibility of using these computerized environments to reduce anxiety and pain associated with an invasive medical procedure in children with Cancer [4].
In a virtual environment, different types of things or virtual objects can be included; one type of these are pets. Virtual pets are common in the domain of children's games, where children play with the virtual pet and often interact with it via a button or touch interface [5].
In Peru, virtual environments and therapies with pets are scarce concerning the distraction of pain and stress of pediatric patients during stressful or painful medical procedures. It is known that a virtual environment can be of different types or modalities, one of them being those that include virtual pets. So, will a virtual pet simulator be able to distract pediatric patients from pain and/or stress during medical procedures using a virtual environment?
This study seeks to help pediatric patients who need a distraction from both the pain and/or stress that they suffer during medical procedures. Consequently, the goal is to develop a virtual pet simulator to distract pediatric patients from pain and stress during medical procedures using a virtual environment and smart techniques, as these can help improve the pediatric patient experience and assist them. To avoid trauma from high pain medical procedures and even avoid scarring pediatric patients during simple medical procedures.
To do this, the SUM methodology for video games was used to develop quality games in defined times and costs. The methodology goes through five phases: Concept development phase, planning phase, development phase, beta phase, and closing phase. Tools like Unity and Blender were also used. Besides, intelligent techniques such as the A-star algorithm were applied so that the pet can follow the user and the flocking algorithm to have a natural behavior of secondary fauna, and thus the level of immersion is better.
The article has more sections which talk about the following: Section II talks about the related works that provided information for the development of the virtual pet simulator. Section III contains the materials and methods developed for the development of the virtual pet simulator. Then in Section IV, we have the results obtained when using the developed simulator. In Section V we have the conclusions obtained after analyzing the individual results, and finally, we have in Section VI the future works to be developed.

A. Pain Treatment
The best treatment of pain and anxiety will be to avoid them by promoting prevention, anticipating the pain produced by diseases or procedures. It is also essential to a void anxiety and stress caused by the painful sensation [1]. To do this, you have to know how to value pain. In pediatric patients, it is complex to assess pain since they have a limitation or impediment to express, transmit or specify their pain (location, intensity, characteristics), and it is even more so while the age of the pediatric patient is younger [6].
To assess pain, it is useful in the emergency department to consider the child's process, changes in physiological parameters (increased heart rate and respiratory rate, cold skin, increased sweating, vasoconstriction of the skin), and the scales pain assessment. Different scales try to objectify the intensity of pain according to the age of the child. For those over three years of age, subjective scales are used. Ages 3-6 years old: color scales or facial drawings. Ages 6-12: numerical, visual analog, or color scales [1].
There are types of pain which we will mention below:  According to the intensity of the pain: There is mild pain, which usually will suffice an analgesic drug administered orally, and moderate pain that may be necessary drug combinations and use, in addition to an analgesic, an anti-inflammatory, or a minor opioid [1].
 According to the pain duration: There is acute pain, which is pain directly related to a temporary injury and usually lasts for a short period (<6weeks). Also, chronic pain persists for a period longer than six weeks, often for months or years [7].
 Pain from therapeutic, diagnostic procedures: Currently, multiple procedures require pseudoanalgesia techniques. It is necessary to assess in these cases the degree of pain and anxiety that is going to be induced, to anticipate it [1].
Just as there are types of pain, there are also forms of pain measurement such as scales, which are presented below [8]: Like pain, stress can also be measured using scales. Among the main ones are:  Visual analog scale (VAS): VAS is also used to measure anxiety and consists of a horizontal line of 10 cm with a connection of two points to each other, where 0 is equivalent to "without worry or anxiety" and 10 indicates "the worst worry or anxiety" with opposite facial expressions joined along the same line. The child is asked to mark the point that best represents the anxiety he feels [9].
 The facial image scale (FIS): It was developed to assess dental anxiety status in children. It consists of 5 faces ranging from very happy to very unhappy, which children can easily recognize [10].

B. Non-Pharmacological Treatments
It has been shown that the reduction of pain and distress can be alleviated and that some simple, non-pharmacological techniques can alleviate the fear they cause. For example, ice or vibration therapy can also help distract patients during painful procedures. Pediatric pain relief devices in the shape of animals or insects are visually appealing to children for sale. Placed on your skin, they provide a cooling or vibrating effect that helps numb the injection pain. Pet therapy can also be used to distract pediatric patients in stressful or painful situations [3].
Sampson and Renee [3] mention some examples of distraction techniques for pediatric patients according to their age such as the calming effect of wrapping to which babies react well, soap bubbles or hide-a-face play that works well for young children, cartoons for preschool children, audio visual distractions for older children or teenagers, or also doing use of pet therapy for distract pediatric patients from stressful or painful situations.

C. Pet Therapies
Animal-assisted therapy, also known as "pet therapy," is the general term that refers to both animal-assisted activities and animal-assisted therapies [11]. The dog is ideal because he is more dependent on the human being and comes to learn and obey [12]. Studies show that children who interact with therapy pets, usually dogs, show increased coping skills and reduced anxiety levels [3]. Besides, Guha [13] mentions that the calming effects of animals are especially valuable with children.
In order to be able to carry out the therapies with pets, Sampson and Renee [3] mention that the policies and procedures of the hospital that uses this type of therapy must be followed, in addition to the approval of the parents because any type of contraindication must be ruled out such as allergies or the possibility of bacterial contamination

D. Virtual Reality for Pain in Medical Procedures
Virtual reality is useful in providing relief from acute and procedural pain and can help provide a corrective psychological and physiological environment to facilitate rehabilitation for pediatric patients suffering from chronic pain. Furthermore, virtual reality therapies that incorporate body movement tracking allow for greater interactivity [7]. www.ijacsa.thesai.org A large body of evidence supports the efficacy of immersive virtual reality in reducing pain, anxiety and stress among pediatric patients undergoing burn care or cancer treatments, as it provides a means of human / human-computer interaction, in which a human becomes an active participant in a virtual environment created through a head-mounted display. Besides, by using virtual reality, the user actively participates in a virtual environment since real time changes with the user's movements [14].

E. Virtual Pets
According to Lin, Faas and Brady [15] a virtual pet is a type of agent that can be realistic or also abstract that is found in video games or virtual reality environments, they also highlight that people can have virtual pets in addition to or instead of a real pet for company, amusement or for simple distraction.
Virtual pets are common in the domain of popular children's games, where children play with the virtual pet and often nurture it through a button or touch interface, although more advanced interfaces feature gesture and speech interaction such as the game Kinectimals (Microsoft Xbox 360) or EyePet (Sony Playstation 3) [5].
Studies have shown that using and interacting with virtual pets to prevent the treatment of different diseases works quite well with children [5]. The Mixed Reality Virtual Pets system to reduce childhood obesity developed by Johnsen et al. [5] turned out to be very reliable, and the study was a resounding success despite having minimal game content, compared to much more elaborate entertainment games, the virtual pet managed to motivate the treatment group of children who exercised significantly more than his peers in the control group.
All these reviews of the related works have served to establish the basis for the virtual pet simulator's development proposal for pediatric patients.

III. MATERIALS AND METHODS
The SUM methodology has been chosen for its advantages in developing video games, which is divided into phases and goes hand in hand with a risk management document. To better understand the scope of this project using the SUM methodology, the following diagram was followed, which can be seen in Fig. 1. The diagram has 5 phases, which we will talk about and explain what was developed in each of them to achieve the final product, i.e. the virtual pet simulator. All phases are accompanied by risk management.

A. Phase 1: Concept
In this phase, the project concept's development was carried out; in other words, the vision, genre, classification, characteristics, history, and setting of the simulator. This game's vision is to provide a virtual pet that provides entertainment to pediatric patients, and its genre is a simulation.
Then the classification was continued: type E (Everyone), that is, for everyone since it is a simulator for children. The gameplay of this simulator is as follows: When the user starts the game, a virtual pet will be presented in the first instance; To be exact a dog, the user will be able to interact with it in almost the same way as with a real one, that is, they will be able to: feed it, pet it and play with it.
What features does the simulator have? The simulator has the following:  Be attractive in the eyes of children.
 Be a visual and auditory distractor.
 Be interactive by using the pet.
The pet was chosen to be a dog because children have a better interaction with them, as already mentioned in Section II of the article. Once the simulator's characteristics were established, the story of the game or simulator was developed, which is simple. It is a parallel world away from the anguish where the user can have fun with a lovely pet, distracting him from his fears.
Finally, the simulator setting was designed, which has a semi-forest, since it has a good number of trees but not too many to block the sunlight or generate too many shadows that could scare the user (pediatric patient). Flowers, grass, and stones were also placed to give a more rustic atmosphere. Finally, some villages were also located to avoid a feeling of being asked or of loneliness.

B. Phase 2: Planning
In this section, the development team members' roles for the rest of the project were defined. The number of iterations performed was also determined, and the milestones that had to be met were specified. In the same way, the objectives to be achieved to complete the project were defined. Finally, the characteristics of the video game were specified. It was determined that the project would have three milestones which were developed in 17 weeks; therefore, a schedule was also developed. To better manage the project, the Trello tool was used to update the objectives or tasks that were concluded. As mentioned above, in this section, the objectives of the project were defined, which are:  Generate a relaxed setting with a semi-forest environment.
 Generate a wide area for a good movement.
 Generate or obtain the model of a virtual dog.
 Generate functionalities with which you can interact with the virtual dog.
 Find and play calm and entertaining music for children.
 Insert sounds of interaction.

C. Phase 3: Elaboration
For the development of this project, it was divided into three stages. Stage 1 was the simulator analysis. For stage 2, the corresponding design was carried out, and finally, it culminates in stage 3, where the entire simulator implementation was carried out.
In the analysis stage, functional and non-functional requirements were defined. Below are some of the functionalities that were defined for the development of the project:  The system will have the display function by using the first-person camera since the child must be able to see the pet because it is the main point of distraction.
 The system will have the interaction function when the child uses a controller to pet the pet.
 The system will have the functionality of displacement, which will be given through a command.
 The system will have the object manipulation functionality that will allow the child to interact with objects within reach in the area, such as balls, branches, or others to play with the pet.
 The system will have multimedia functionality since it will require sound or music to relax and distract the child more efficiently.
In the design stage, the project's sketches or mockups were made, which can be seen in the following figures. In Fig. 2, the game start tab is shown, which has the game title plus a button to start the game. Fig. 3 shows how the virtual dog is fed. In Fig. 4, it is shown that the user can take objects and throw them for the virtual dog to bring them back. In Fig. 5, it is shown that it is possible to interact with the virtual pet, that is, to caress it.
In this stage, the acquisition and/or creation of the necessary assets for the simulator implementation was also carried out. The asset of a 3D dog, quite friendly and attractive for children, was acquired from the Unity Asset Store as seen in Fig. 6, and the creation of assets of a toy bone was carried out as seen in Fig. 7 and a plate of food as seen in Fig. 8 using the Blender tool. It can be seen that the different models' figures are quite simple and with basic colors because children like simple shapes and attractive colors, so they were modeled based on said analysis.       In the implementation stage, the development of the scenario and different scripts in Unity was done. For the creation of the virtual terrain, the Gaia 2.0 tool was used; it helped speed up the development process a bit and generate a good quality scenario. The simulator scenario with that tool is presented below in Fig. 9. A forest was created in order to create a natural and relaxing environment because medical centers have unattractive rooms for children, even the fact of seeing a hospital, already begins to scare them, so the end of the virtual scenario of a forest, is to change the environment together with the background music, and thus generate tranquility. For the creation of scripts, the C # programming language was used since this language uses Unity. The launch script was developed, which allows the user to take a specific object from the stage and throw it; for this, gravity and the masses of the objects were taken into account to give them weight. The launch is based on the parabolic movement, and the prediction of the trajectory consists of the following elements: starting position in three dimensions based on time ( ̅ ); shooting position in three dimensions ( ̅ ); output speed ( ); direction the toy was fired ( ̅); the length of time since the toy was released ( ); and gravity ( ̅ ) which in this case has a value of 9.81 m/s. The corresponding formula can be seen in (1) with the active components.
In Fig. 10, you can see a cube, representing the toy (first part of development, the toy had not been modelled yet), being thrown openly on the stage; it is necessary to emphasize that the player can pick up this object, the longer he holds it, he will throw it; differently, it also depends on the mass of the rigid body component.
The launch script was made following the suggestion in Tuto_DrawTrajectory [17], where you can see the initial position of the toy with the applied force, through a loop "for" begins to go through and updates the points where the toy will go. Gravity is also applied based on the Unity game engine's physics component along with its time, as can be seen in Fig. 11.  For the smart part, the Pathfinding A-star algorithm was used, which is probably the most popular path search algorithm in artificial intelligence games [18]. The A-star algorithm was imported as a library to the virtual pet simulator in Unity. It is a generic search algorithm that can be used to find solutions for many problems, including route search. For route finding, the A-star algorithm repeatedly examines the most promising unexplored location it has seen. When a location is scanned, the algorithm terminates if that location is the target; otherwise, it takes note of all the neighbors at that location for further exploration.
The Pathfinding A star algorithm also made the virtual pet follow the bone toy, as shown in Fig. 12. The Pathfinding Astar library was implemented throughout the scenario; each node's size is one, since the problem was recognizing the terrain, specifically the houses, furthermore, it can be seen that the blue color is the space where the pet can move; near buildings there is no such color because it should not make sense for the pet to walk between the walls. The green line represents the shortest path of the grid drawn by the algorithm. The terrain is quite large because it has been created with Gaia 2.0, so the library's recognition dimensions had to be enlarged quite a bit and wait for it to recognize all the structures for the tour, which is shown in Fig. 13.
The Flocking algorithm was also used, to generate a more natural environment and with more significant nature, such as birds flying over a clear sky or a few butterflies flitting through the field, as can be seen in Fig. 14. The Flock and FlockUnit scripts were used for this algorithm. FlockUnit is in charge of giving individual flock behavior to a prefab assigned to it by the script; that is, it controls the cohesion, separation, and alignment components of a single prefab, and in case it has neighbors, that is, copies, it relates them to each other.   The Flock script is in charge of performing the flocking behavior of several copy objects that are asked to generate according to the type of prefab assigned using the relationship between neighbors of the FlockUnit script; that is, if it is assigned a bird prefab and it is instructed to generate 100 copies, then the Flock script will generate 100 bird copy prefabs, each of which will contain a behaviour given by the FlockUnit script that was assigned to the original prefab, and thus all the copies interact with each other as one giving the desired flock effect.
A life bar was also added using the Canvas tool, a tool already included within Unity. The life or energy bar represents the energy that the virtual pet has to be able to play with the user. If the life bar reaches the minimum, that is to say 0, and if the toy is out of reach, then the pet will lie down and rest until it is fed.

D. Phase 4: Beta
In the first version, it was obtained that the virtual pet pursues an object using the Pathfinding A star algorithm, the object that the virtual pet follows can be taken by the user and thrown. It was also possible to obtain a vast and natural scenery using the Gaia 2.0 tool since secondary nature such as flowers and trees were added. The flocking algorithm was also used to give it a more natural and immersive touch with secondary fauna such as birds in the sky and butterflies.
Two additional levels were generated for the better entertainment of pediatric patients if the user wishes to experience another type of entertainment. Level 2 is about collecting bones and achieving 100 points. The main level pet, which must be cared for and fed at this level, is manipulated by the user. The land is also in a natural style, including grass, stones, and trees. Different triggers were used to collect objects. Once the score is obtained, the level ends.
Finally, level 3 is focused on collecting clues to find the pet. The clues are three, which are a plate of food, a bone, and footprints. These clues are hidden on stage. This level's scenario is different from the main level and level 2 since it is a small city. Once the clues are found, the pet will appear, meeting with its owner (user).

E. Phase 5: Closing
In this phase, the problems, successes, solutions, achievement of objectives, and general feedback of the entire process of creating the video game were evaluated. To evaluate the aforementioned, verification tests were carried out to be more specific, unit tests. www.ijacsa.thesai.org Project verification tests were developed while adding a component to an item. The algorithms were evaluated according to their behavior based on the pet and the player. The respective unit tests were carried out on the entire project, but the most important or high-impact sections were: trajectory prediction, object tracking, petting the dog, and the flocking algorithm. Below you can see in Table I the white box tests performed to the trajectory prediction test section.
The project was also tested on two different computers. The first uses an AMD graphics card with a 6th generation Intel core i5 processor, while the other computer uses a GTX 1660 TI video card with an 8th generation Intel core i7 processor.
Metrics were carried out to know how much quality there is in the development of the project. The ISO \ IEC 9126 standard was used. From this standard, the characteristics of functionality, reliability, and usability were applied. For what are metrics, tables were made using the patterns required by the standard, that is, the tables contain the fields of name, purpose, application method, formula or measure, interpretation of the measured value, type of scale, type of measurement, source of measurement and audience.
For the functionality metrics, tests were carried out based on the requirements detected in the simulator development analysis stage. Table II shows the functionality metrics of one of the requirements.
In Table II, the interpretation of the measured value is 1, and for the functionality metrics, if said value is one or very close to it, it means that this requirement meets the functionality metrics. Similarly, the reliability and usability metrics were carried out, which can be verified in Table III, one of the reliability metrics of the trajectory prediction functionality, and Table IV, the usability metric of the interaction recognition functionality.   It can be seen that Table II, Table III, and Table IV are close to or have one as an interpretation of the measured value. The functionalities or implementations complied with the metrics of ISO \ IEC 9126 [19]; therefore, there is quality in the virtual pet simulator developed. www.ijacsa.thesai.org Once the verification tests had been concluded and the simulator's quality had been verified, the validation tests were carried out. For these tests, a small medical center (medical post) was attended. A small number of 10 pediatric patients were evaluated, which we detail later, who have been prescribed an invasive medical procedure (injectable or serum). 4 children were taken as a control group. Six as a test group, it is known that most children feel pain and stress due to injectable, so four children were chosen as a control group since three were very few and what was wanted was to have an experimental group of as many of the small sample as possible to demonstrate the effectiveness of the pet simulator. Having a small sample is for reasons of the covid-19 of the year 2020 since this study was carried out during that year, in addition, the medical field in our country is collapsing, for which there is not much medical attention in external clinics and an enter to emergency admission is very risky for our health.
To verify the pet simulator's effectiveness, methods and scales were used to measure pain and stress in patients, which are: The Facial Image Scale (FIS) for measuring stress and the Visual Analog Scale (VAS) for both pain and stress.
Vital signs (heart rate, respiratory rate) of pediatric patients were also evaluated to have more objective results. These signs were noted and measured before and after the medical procedure for all pediatric patients. In this way, it was observed how much the heart rate and/or respiratory rate varied. Heart rate was measured by counting the pulses in the radial artery for 1 minute. Taking the vital signs of pediatric patients, the effectiveness of the virtual pet simulator could be verified.
The measurement scales were given to the pediatric patients through sheets to mark or indicate the way they felt during the medical procedure, both those who used the simulator or not. Below it can see in Fig.15 and Fig.16 the scales in the EVA, FIS figures, which were explained in Section II.
The tests were carried out in the medical center for six days, in which the informed consent of the head and the parents' respective permission with four boys and six girls were requested. Two of them are eight years old, one nine years old and the other ten years old. In the girls, four were five years old, one was four years old, and one was nine years old.
Each of the children attended the medical center and was diagnosed to receive invasive medical procedures. In the first four days, five pediatric patients were diagnosed with invasive medical procedures, of which the first four were taken as a control group, and from the 5th pediatric patient, they were taken as an experimental group.
The first four pediatric patients were three girls (two 5 years old and one 4 years old) and one boy (8 years old), who, as mentioned above, were selected as a control group; therefore, they did not use the simulator during the invasive medical procedures. The control group was evaluated for vital signs (pulse, respiratory rate) before and after the medical procedure, and they were given the respective pain and stress measurement scales (VAS, FIS).
The experimental group consisted of 6 pediatric patients, three girls (two 5-year-olds and one 9-year-old) and three 8, 9, and 10-year-old boys. This group did use the simulator during the invasive medical procedure by putting on virtual reality glasses type Vr Box 2nd Generation. Before performing the invasive medical procedure, when the pediatric patient had accelerated vital signs due to stress, they were given a simulator and expected to interact with the pet. Once the pediatric patient was distracted, the injectable was applied. Finally, once the invasive medical procedure was completed, the use of the simulator was withdrawn.
As was done in the control group, the pediatric patients in the experimental group were assessed for vital signs (heart rate, respiratory rate) both before and after medical procedures. Finally, after carrying out invasive medical procedures, the experimental group was given the respective pain and stress measurement scales (VAS, FIS).

A. Verification Test Results
After running the virtual pet simulator, it was observed that the algorithms work correctly; the trajectory prediction algorithm works at 89% since sometimes the object collided with the roof of a house and got stuck there, the pet followed it but could not climb and reach it, the toy must be set to recognize whether it has a considerable difference from the vertical coordinate of the pet, and make the toy fall.
In the movement algorithms, as for the pathfinding. A star algorithm, it was observed that the pet follows the character by 90% because there is a lake in the simulator, and if the user enters said lake, the pet should stop at wait for it, however, it follows it under the water, it can also modify the animation, in such a way if it detects that it is going to enter a water area, the pet maintains its vertical coordinate and proceeds to swim while following the player.
As for the flocking algorithm, the birds and butterflies were correctly added, these objects rise to the sky, and the simulator's immersion increases. As for its function the algorithm is at 100% because in the sky there, are no collisions with rocks or mountains, except for the same copy objects (neighbors); that is, the flocking algorithm works correctly.

B. Validation Test Results
First, the results obtained in the control group are presented. Pediatric patients' vital signs were measured before and after the medical procedure, as explained above. In Table V, you can see the vital signs of pediatric patients in the control group before and after performing the medical procedure.
Typical heart rate values in pediatric patients are detailed in Table VI [20].
The typical respiratory rate values in pediatric patients are detailed in Table VII [21].
After the medical procedure, it can be seen that in Table V that pediatric patients came to present an increase in both heart and respiratory rates. These results demonstrate that pediatric patients in the control group experienced both pain and stress while undergoing the invasive medical procedure. Pediatric patients were also given files or surveys containing the aforementioned scales.
For the VAS scale, pediatric patients marked values from 6 to 9, which means that pediatric patients felt pain intensely and moderate. For the FIS Scale, pediatric patients indicated faces from number 3 to 5, which means that all pediatric patients had moderate to even severe anxiety. Now the results obtained in the experimental group are presented. The pediatric patients' vital signs in the experimental group were also measured before and after the medical procedure. In Table VIII, you can see the pediatric patients' vital signs in the experimental group before and after performing the medical procedure.
After the invasive medical procedure, Table VIII shows that the heart rate values and the respiratory rate decrease, compared to the values measured before applying the developed virtual reality environment. Therefore, the results showed that pediatric patients could distract themselves from the pain and stress of the situation surrounding them, which was the realization of the invasive medical procedure, giving more attention to the virtual pet simulator. It was found that the application of the virtual pet simulator allows distracting pediatric patients from pain and stress, according to the results obtained in the tests carried out. The tests showed that the pulse and respiratory rate levels of 60% of the total pediatric patients decreased since six pediatric patients made use of the pet simulator and all six managed to be distracted, that is to say, 100% of pediatric patients in the experimental group, they managed to distract themselves from pain and stress.
All the pulsations of pediatric patients before the medical procedure exceeded 100 beats per minute; also, all pediatric patients' respiratory rate exceeded 26 breaths per minute. However, after using the pet simulator, those of the experimental group, both their pulsation levels and their respiratory rates, decreased considerably.
It was also found that using the pet simulator would improve care during medical procedures for pediatric patients. Therefore, the virtual pet simulator developed allows the distraction of pain and stress for pediatric patients in a virtual environment; for this, the product was developed with the SUM methodology. The operation of the game has excellent playability since all the algorithms work as expected. Besides, thanks to intelligent techniques such as the Pathfinding A star algorithm, which allowed a better interaction between the pet and the user (pediatric patient), and the Flocking algorithm, which allowed a more natural environment, a better immersive environment was obtained. Finally, the simulator passed the metrics of ISO \ IEC 9126; therefore, the virtual pet simulator developed has quality.

VI. DISCUSSIONS
As we can see, the heart rate, respiratory rate and anxiety in patients decrease. This is useful in pediatric patients, since post-traumatic stress can be avoided after a medical intervention that is very traumatic for the child, this has been the main motivation for this work. There are pathologies in which an increased heart rate can lead to a series of complications as in the case of congenital heart disease [22]; in addition, there are more complicated diseases such as the case of autistic children that are also affected by these variations [23]. This simulator can solve these complications by reducing heart frequency, respiratory frequency, and state of anxiety when these people are undergoing medical intervention.
We can observe in the work of Buldur and Candan [24] that they developed a software similar to ours in the field of virtual reality, however they work with other biological parameters while in ours, we add a new parameter, where we can observe a considerable decrease in respiratory rate.
Although modern systems use different technologies, in our environment the use of virtual reality is just emerging and in the different medical centers they are not yet used, they perform different traditional treatments. Therefore, the proposed simulator would help to encourage the use of modern technology in our health environments and thus obtain better results in the treatment.

VII. FUTURE WORK
The simulator is still in version 1.0. It can be improved since more details can be added, such as that the pet can receive orders such as sit or play dead. It is also intended to make an improvement to level 3 by placing the clues randomly since the present hidden clues are static so that if the child plays the level several times, he will be able to memorize the objects' location.
It is planned to test the virtual pet simulator with a larger sample when the COVID-19 situation improves to have better results and check its effectiveness. It is also planned to test the simulator with other medical procedures because it was only tested with invasive medical procedures.
Finally, it has been thought to generate more levels to the simulator; that is, it will not be oriented only for children, but also for different types of people, creating levels of distraction and stress for different ages since not only children suffer pain and stress during medical procedures, also young adults and older adults.