# Virtual Reality in Space Technology Education
## 3 System Coding Components
### Modules  
The game system consists of different modules. Figure 9 shows the relationship between those modules. Figure 9: Layers and scenario modules. Layers module: This game has two main layers separated from each other; the first layer is the control center, and the second layer is the space. The purpose of the two layers is to separate the cameras' outputs in the space rather than the cameras' outputs in the control center. Elements of space are satellites, rocks, geomagnetic fields, portals, explosions and fire effects. So, the cameras in the control center layer could not see those elements and vice versa in the space layer. The control center screens display all game characters and cameras' views of the whole game accurately and realistically. Scenarios module: The control center contains three rooms, each with a scenario. The scenario is a mix of different components and events that will take place in a particular sequence to allow the player impact the game and enable the level to be progressive. Therefore, we created a template that helps us to handle the scenarios and the events perfectly in the sequence we want. The template is a script that contains several variables, functions, a start function and an update function. Cameras Module: There are many cameras on the scene. Each camera records a specific view and has a particular GUI. Each camera's output is exported as a render texture, and the render texture is used in a material connected to a specific screen in the room. There are three types: the first type is the cameras that do not have a GUI. They return a view, and they are used in the cameras that are in the control center. The second type is the cameras that have a static GUI, which is a GUI that is not attached to a script, so it just has some text with some colors, and it is used in the terminal camera. The third type has a GUI attached to the script to make it updatable, such as the screen that displays the speed, temperature and ping of the satellite and the screen that displays the satellite status. Satellite module: The satellite has a system for movement, health, data, damage, and destruction. This system manages the satellite's behavior and allows the player to control it easily. Two main functions operate the motion of the satellite. The first function gets the distance between the rotation hand's center in the control center and its new position, then converts this distance with a threshold to a rotation used to rotate the satellite. The second function is a Boolean function that determines if a button is pressed or not to add force in the same direction as the satellite. It will not work if the satellite is destroyed. The satellite's health starts at 100% when the level is started but decreases by 10% if space rocks are hit. Therefore, the satellite's health is a major variable in detecting the satellite's current temperature and knowing whether the satellite controls should work correctly. Data of the satellite are represented as its health, temperature, velocity, ping, position, and rotation. Damaging the satellite will start a fire effect and decreases its health. When the health reaches 0, the satellite will be destroyed, and its parts will be devastated in space by instantiating new parts instead of the old ones. This is because they have independent, rigid bodies that will take the explosive force of the destruction and fly in different directions. Player module: The player as a VR object has five main parts (VR headset, VR controllers, head collider, hands collider and body collider). The player can visualize the 3D virtual world using the VR headset. VR controllers are used to teleporting from one position to another and can pause the game with it. The head collider prevents the player's head from moving through walls. Hand colliders allow the player to interact with intractable objects like a rotational arm or force button to control the satellite's movement. Finally, the body collider is used to open the control center doors when the player is in their range.