This instructable is about creating a VR game in Unreal Enige 4 to recreate what life will look like on Mars..
The Mars VR Experience we created is a single player VR simulator experience. Land on Earth’s sister planet, walk the surface of Mars in your living room and collect resources to survive the harsh environment. Explore the landscape and travel into the future to get a glimpse of what the red planet will look like when humans have colonized it.
The goal of this project was to create a realistic simulation of what it would feel like to live on Mars and what type of work would need to be done in order to colonize the planet.
Nowadays, creating an environment to simulate martian life is very difficult, time consuming and resource heavy due to the fact that everything must be built in the real world. However, with VR, many of the activities that will be done on the planet can exist in a virtual world that is not only cheaper , but more accessible to people who will want to go to Mars or see what it would look like there without needing to travel to expensive facilities and train like astronauts.
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Tools, Getting Started
The programs that were installed and used for this project were:
- Autodesk Maya 2014
- Unreal Engine 4
The first step in the making of a game is creating the assets that will be interacted with in the VR world. Initially, a martian landscape was purchased from the Unreal Engine 4 online store for 20$ and then placed into the VR template of the program. The objects and structures found in the landscape, such as: the rocket, the greenhouses, the solar panels, the ice cubes and the rover were created in Autodesk Maya 2017. The ice cubes were textured in Photoshop and Unreal Engine 4 where a UV layer was used to allow lighting to reflect more realisticaly on certain items.
Step 2: Creating Models and Assets
Models for the Mars VR experience were created using Autodesk Maya 2017.
The full version of Maya is a paid program, but a 30 day trial can be installed for free or a 3 year trial if you are a student. Download Autodesk Maya here: https://www.autodesk.com/education/free-software/m...
To get started using Maya, countless tutorials can be found on YouTube explaining every aspect of the program. A good channel to get started with that specializes in Maya would be found here: https://www.youtube.com/user/OnlineMediaTutor/vide...
Step 3: Importing Models, Textures and Sound
The files exported from Maya to Unreal had to be moved in .fbx or .obj format to be usable in the 3D world. Once the models were saved in .fbx or .obj format they were dragged from the desktop to the contents folder in the unreal content browser.
Models were then dragged directly into the 3D world from the content menu and scaled up to size using the "R" hot-key. The "W" key was used to move the objects in the mars landscape and "E" was used to rotate items in the world. These models include: the rocket, the martian homes, martian greenhouses, connecting bridges,
Textures were downloaded from google images and saved as .png or .jpeg files. These were then dragged into the content browser the same way the 3D models were. To create an object material, the texture image, we right-clicked the image and selected "create mateiral". This creates a material that can be simply dragged onto any model.
For sound, two files were used to create an atmosphere in the game. One for ambient sounds someone would hear on the Mars surface and one sound file of ambient music placed on a loop to not only experience the game visualy and physically, but also auditively. These files were imported as .wav files through an online .mp3 to .wav converter (http://www.zamzar.com/convert/mp3-to-wav/) for Unreal to use. A folder was created in the content browser names "Music" where the .wav files were dragged. To place the music in the game world, it was simply dragged from the browser to the 3D world and placed using the "W" key to move it into place.
Step 4: Movement and Physics
To add movement we needed to create an actor based on VR blueprints. To import this actor click on "add new" in the content browser and then "add feature content pack". Once the window pops up, select virtual reality and "add to project". A new folder should appear in the contents called "VirtualRealityBP". In this folder, navigate to blueprint, where you will find two main BP classes called: BP_MotionController and BP_PickupCube. To create a player in VR simply drag the BP_MotionController into the map.
To add physics to certain imported models, drag the BP_PickupCube to the map. In the "details" on the right-side menu, in the Static Mesh tab, the cube model can be replaced with any of the imported models from Maya. This way, physics are already applied to the object no matter the model.
The blueprints for physics and movement do not need to be created as they already exist by default in the Unreal Engine. These blueprints detail the connection between the player actor and the motion controllers (See photos).
Step 5: Creating a Goal
Once everything was imported into the world the purpose of the game thad to be created. To do so, text widgets were made to float in certain areas of the map in a manner that would make the player progress in a linear manner. The first task is to pick up a satellite dish and bring it to the rover to allow for communication with earth. Once the player has reached that point, a new text prompt would tell him to collect ice and melt it into water. This way of giving tasks allows the user to never feel lost or unsure of what to do next as the text prompts appear immediately after reaching a goal.
The text widgets were made in engine and simply float above each task that must be done in the game. Initially, the task of installing the satelite dish appears just below the title screen when the player starts the game. For the task of finding ice, some markers were placed in the general area of where they could be collected because searching the entire map would be too long. The markers use can be found here:
To learn how to create these text widgets and import the markers see these videos:
Step 6: Creating a Second Level
First off, we started by duplicating our first level in the content browser. To do this, simply right-click on the level and select "duplicate". From here, we removed any assets that were not needed from our first level.
This level was designed to be a driving segment. To do this, we clicked "add new", "add feature or content pack", "Vehicle Advanced". A folder appeared called "VehicleAdvBP". From here, navigate to its blueprint folder and drag the vehicle blueprint to the game world.
Step 7: Carving Out a Path to a New Destination
Since our second level introduced a driving mechanic, a road had to be made to bring us to the area where level-3 would take place.
To create this road, navigate to "landscape" in the top left corner and select the "sculpt" tab and then use the "flatten tool". From here, you can change the brush size and brush the path onto the landscape. This will modify the mesh creating a flat surface wherever the tool is used.
Step 8: Creating a New Destination
To create a new destination, simply navigate to a new area on the Mars Landscape map and import your new models and textures (See step-2 and step-3).
This should be the end of your vehicle path in level-2.
Step 9: Changing the Music for Level-2
Since level-2 is a driving segment, we felt a new soundtrack was needed.
A new song was downloaded and converted from .mp3 to .wav file format and placed into the game world the same way it was dome for level-1 (Step-3)
Step 10: Creating a Third Level
To create a third level for VR in the content browser, duplicate level-1 once again.
From here the starting point was moved to the new area where level-2 (the driving segment) ended. New models were created in Autodesk Maya to have an interior, since our last level was a giant greenhouse.
Like for level-1, these models were imported into UE4 as .fbx or .obj files (See step-2 and step-3)
Step 11: Adding Foliage and Trees
Since the third level served more as an observation segment with no particular goal, a more lively world had to be made by adding plants and foliage that would make the dome model we created seem like a realistic and sustainable structure that could exist on mars.
The first step of getting these plants and trees into the VR world was to install a foliage pack from the UE4 marketplace. Once installed, these files needed to be added to the "content browser" of the game under "Models". From here, these models were dragged into the foliage tab in the top left corner (identified by a three leaf icon) underneath "+add foliage type". This allowed us to then select the leaf icon and spray the selected plants onto the mesh of the interior of the dome model. Some of these plants had an animation to them that made them blow in the wind, which added a realistic aspect to them.
Step 12: Creating a Functional Door
Since level-3 begins in the exterior and finishes inside the dome, a sliding door had to be created to separate the dangerous martian atmosphere from the controlled interior environment.
To make a functioning door, the first step was creating a 3D model in Maya that fit the shape of the entrance to the building and importing it into UE4 (See step-2 and step-3). From here, we followed the step by step tutorial of the following link to fabricate the blueprints and make the animation of the door sliding with sound:
This tutorial was very detailed and added a realistic aspect to switching between the exterior and interior of the game world in VR.
Step 13: Adding Lighting to the Interior
Since the last level took place inside a closed 3D model, the lighting from the sun could not penetrate inside the dome.
To solve this problem, five "spot lights" were added from the top left "Search Classes" search bar and placed into the map by dragging the icon into the world and moving them into place using the "W", "E" and "R" keys to place, scale and rotate them to obtain the desired effect.
Step 14: Conclusion
The entirety of the project was created in a timespan of 6 weeks to a point where a minimum of playability was achieved. The mechanics for movement and interacting with objects functionned as desired and the addition of music and physics created an interesting atmosphere.
Many problems were encountered throughout the project in every aspect of the game. Initially, the VR template of the Unreal Engine did not work because teleportation was not functional, preventing the character from moving in any direction. This was rezolved by creating an invisible surface on top of the martian landscape that the game needed to understand that the player is allowed to move across certain areas. The serious lack of tutorial videos for implimenting certain mechanics was also a big hurdle but was worked around by simply letting the player progress by reading the text prompts after each goal or explorig as they please. The addition of textures to models was also attempted for some of the more complex geometry but ended up being a failure due to a lack of understanding of how it worked. Instead, only the ice cubes were textured since they were the main object the player interacted with. The driving segment was also a challenge to set up, because everytime the profile was changed to driving instead of the VR template, this would change for all the levels instead of only the second. This was resolved however by digging into UE4 forums.
In the future, many aspects of the game can be improved by first adding textures to more models, giving it a more realistic look and introducing some sound effects for when items are dropped. There are many more tasks to add before the game can truly be a martian life experience and there will need to be more research done on implimenting effects and progression to the game. Now that the barebones of the project are finished with three different levels, showing three types of activities on Mars, the detail of the content can be improved upon to achieve a high quality example of what colonizing Mars will be like in the near future.