Unreal Engine Virtual Reality Quick Start Guide

By Jessica Plowman
    Advance your knowledge in tech with a Packt subscription

  • Instant online access to over 7,500+ books and videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies

About this book

With the ability to put players directly in the game, virtual reality gives users the chance to experience digital worlds directly. Nevertheless, many designers are unsure where to start when working with this amazing technology.

With this book, you will learn user experience design processes and create immersive gameplay experiences designed for entertainment and player comfort. Using the power of Unreal Engine 4’s Blueprint visual scripting language, you will build player interaction and locomotion systems from scratch and use these flexible systems to create a sample game, as well as develop functional 2D and 3D user interfaces for players to interact with. And also learn the best practices for creating game art for virtual reality. Finally, you will learn how to test your application with your target audience and finalize your game for distribution.

By the end of this book, you will have the knowledge to be able to make the leap from traditional game development to creating immersive virtual reality experiences using Unreal Engine 4.

Publication date:
February 2019
Publisher
Packt
Pages
178
ISBN
9781789617405

 

Chapter 1. Introducing VR Technology in Unreal Engine 4

Virtual Reality (VR). These words call to mind images of movies from the 1980s and 1990s, such as characters such as The Lawnmower Man, people strapped into equipment that covers their entire bodies, and computers that take up entire rooms, as well as digital vistas that stretch forever and basic geometric shapes that were meant to simulate the real world. The term VR came about in the 1980s to refer to the systems of gloves and headgear that are used to interact with these computer-generated worlds. Since then, advances in electronics and digital displays have allowed for the creation of smaller, more powerful devices. In 2010, Palmer Lucky's discovery that mobile phone display technology had reached a high enough resolution to be used in VR led to the creation of the first Oculus Rift headset. This event would kick-off the technology arms race that has since given us the Oculus Rift, the Samsung Gear VR, the HTC Vive, and the new Windows Mixed Reality headsets. With the prices coming down every year, VR has found its way into the hands of 171 million users around the world.

For many of you, this book represents the first steps down the path to creating your very own VR title. You may have recently grown interested in getting started with the technology, or you might already have a complete design, and you are ready to begin developing. In either case, this book will lead you through the process of choosing your target hardware and audience, the unique design, locomotion, and gameplay concepts specific to VR, creating art for your virtual world, and finally the process of testing and prepping your game for distribution. Through the creation of our sample game, Server 17, we will discuss some of the problems VR developers face, such as optimization and how to help players deal with VR sickness. 

Note

This book assumes that readers have a working knowledge of Unreal Engine 4 and access to VR equipment. If you are just starting out with Unreal Engine 4, I recommend checking out my other title, 3D Game Design with Unreal Engine 4 and Blender, or any of the other great game development titles from Packt Publishing before coming back to this one.

In this chapter, we will cover the following topics:

  • Why use Unreal Engine 4 for VR?
  • What types of VR technology are available to developers?
  • Pros and cons of popular VR headsets
  • Limitations of VR
  • Introducing our sample project—Server 17
 

Why use Unreal Engine 4 for VR?


VR represents the next great frontier for game developers. Just like mobile technology allowed for developers to reach new markets and move video games into the mainstream, VR gaming will also be able to tap into new markets and appeal to new fans who are looking for a more active style of gaming. To accommodate this, game engine developers have been quickly working to add new features and refine existing ones to entice developers to choose their platform for their next big title:

Robo Recall was one of the first standout tiles that was built for VR using Unreal Engine 4. Image courtesy of Epic Games

Beginning in 2014, Epic Games began laying the groundwork for full VR support within Unreal. This led to the development of their first VR title, Robo Recall. In this game, players were able to shoot and smash their way through a city overrun by murderous machines. The game utilized a teleportation system for locomotion and some pretty solid controls for its gun-based gameplay. The game began development in 2016 and was released for Oculus Rift in 2017. It took full advantage of the most recent build of Unreal at the time to show off the latest rendering techniques and optimizations for VR.

Since then, Epic Games has continued to update and develop Unreal Engine 4 to provide game developers with the best tools available for their projects. Unreal Engine versions 4.17, 4.18, and 4.19 included many optimizations and performance updates geared specifically toward VR headsets and VR developers, with the goal of being able to improve performance and framerates, two of the most crucial elements to monitor in VR game development.

Beyond a commitment to bringing developers the best tools for their VR games, Epic Games provides developers with many other reasons to choose Unreal Engine for their games:

  • Unreal Engine is free to begin using, with only a 5% royalty after the first $3,000 per game per quarter. These terms allow smaller teams of developers to dive right into projects without worrying about how to pay for their tools.
  • Unreal provides support for most VR hardware, including the Samsung Gear VR, the Oculus Rift + Touch, the HTC Vive, and more.
  • The Blueprint Visual Scripting language allows non-coders to develop game features and prototypes without the need for a programmer.
  • Unreal Engine is capable of high-end materials and shaders, thus providing your players with incredibly immersive experiences.

Note

We will be using the latest version of the Unreal Engine for our sample project. At the time of writing this book, this version is 4.20.2. During the course of your game's development, new versions of the engine may become available. It is up to you whether to update your project to the latest version. Make this decision by looking at the release notes provided with each new version and see whether the new features will benefit your game.

 

What types of VR Technology are available to developers?


Knowing that Unreal Engine 4 works with the vast majority of VR technology, our next step is to choose the type of VR headset we would like to use. There are many factors that can contribute to this decision. The first is knowing who the target audience for our experience will be. Start by researching previous games that are similar to our design. By doing so, we can find out what segment of gamers will purchase our style of game and see whether we can interview a few players who fit this demographic. With this information, we can make informed design decisions as we go through the process of development, which will result in a game that really appeals to its player base.

Note

Understanding the demographics as well as the likes and dislikes of your player base is an essential part of designing a commercially successful video game. It is also the first step in the Human-Centered Design process, a creative approach to problem solving that always keeps the user's needs and wants central to design decisions. Have a look at https://www.ideo.com/ and dschool.stanford.edu for more information.

The next factor we need to be aware of is what type of experience our design is most suited for. VR experiences fall into a few distinct categories:

  • Room-scale VR
  • Seated VR
  • Mobile VR

Room-scale VR

The first is room-scale experiences.

These are active experiences that require the player to move, jump, and perform actions inside a predetermined area covered by sensors. An example of the room scale pay space covered by the lighthouse sensors that come with HTC Vive is as follows:

 Room-scale VR 

Seated VR

For experiences that may not require that particular level of activity, there are seated VR experiences. An example of the space needed for a seated-or standing-only VR experience is as follows:

Seated VR experience

Seated experiences are built around the idea that the player remains stationary and that only the headset's orientation data is needed.

Mobile VR

Finally, there are mobile experiences. These experiences are formatted specifically for mobile devices, such as the Samsung Gear VR and the Oculus Go. The original version can be found on the following link: https://commons.wikimedia.org/wiki/File:Samsung_Gear_VR_Experience_(16241072054).jpg.

Mobile experience  

Mobile experiences are designed to take advantage of the accelerator and gyroscope found in smartphones to provide an immersive experience and to control gameplay. For our game, we will likely have the player stand in a small area with their tools for the task close at hand, though some movement may be required. With this in mind, we will design Server 17 to be a room-scale experience.

 

Pros and cons of popular VR headsets


Now that we know who our players are and what type of experience we want them to have, we can make the decision regarding which VR headset we would like to use to design our experience. Each type of VR headset brings different strengths and weaknesses to our project, along with specific requirements for the computer that will be running it. Let's take a look at some of the most popular VR headsets available today:

  • HTC Vive
  • Oculus Rift + Touch
  • Windows Mixed Reality headsets
  • Samsung Gear VR

HTC Vive

Released in April 2016, the HTC Vive system consists of the following:

  • VR headset
  • 2 x Vive motion controller
  • 2 x infrared sensors, known as lighthouses

Great for room-scale experiences due to its 16ft x 16ft maximum size play area, the Vive is one of the two most popular VR systems available today, accounting for 45% of all SteamVR players in February 2018. Capable of a resolution of 2,160 x 1,200 (1,080 x 1,200 per eye), this is the headset of choice for many developers. The motion controllers can be tracked to the millimeter, and each offers nine different buttons that can be mapped inside Unreal Engine 4, which provides developers with a significant number of input options. Audio is provided by the player plugging in their own headphones, though a separate Deluxe Audio Strap may be purchased to provide a more comfortable distribution of weight and integrated headphones.

Minimum hardware requirements

  • Intel Core i5-4590/AMD FX 8350 equivalent or greater
  • Nvidia GeForce GTX 970/AMD Radeon R9 290 equivalent or greater
  • 4 GB of RAM
  • HDMI 1.4, DisplayPort 1.2 or newer
  • 1x USB 2.0 or newer
  • Windows 7 SP1, Winodws 8.1 or later, Windows 10

It is worth noting that while the HTC Vive is compatible with Unreal Engine 4, SteamVR is required to be running during use. With its excellent tracking, solid resolution, and flexible motion controllers, the HTC Vive is an excellent option for room-scale and seated VR experiences.

Oculus Rift + Touch

The original Oculus Rift headset was released in March 2016 by Oculus VR, after a successful Kickstarter campaign. Due to its status as a crowdfunded project, the Oculus Rift has the interesting distinction of having had its development heavily publicized. The company released two different development kits (DK1 and DK2) to its backers during development, before releasing the first commercial version. The current version of the headset includes the following:

  • Oculus Rift headset
  • 2 x desktop-based infrared sensors
  • 2 x Oculus Touch controllers

These controllers have six different button inputs that are tracked by Unreal, but their real claim to fame is the fact that these controllers are capable of finger tracking and hand gestures. The Rift has a resolution of 2,160 x 1,200 (1,080 x 1,200 per eye), exactly the same as the HTC Vive.

Minimum hardware requirements

  • Intel i3-6100/AMD Ryzen 3 1200, FX4350 or greater
  • Nvidia GTX 960/AMD Radeon RX 470 or greater
  • 8 GB+ of RAM
  • Compatible HDMI 1.3
  • 1 x USB 3.0 port and 2x USB 2.0 ports
  • Windows 10

Similar to the HTC Vive, the Oculus Rift + Touch requires its own application running in the background to be able to operate. Though the Rift comes with two sensors, its recommended room scale play area is 5ft x 5ft. Though much smaller than the Vive but with the Rift's decreased hardware requirements, it is still an excellent option for seated and room-scale experiences.

Windows Mixed Reality headset

With an impressive resolution of 2,880 x 1,440 (1,440 x 1,440 per eye), the latest crop of Windows Mixed Reality headsets currently being manufactured by Acer, Lenovo, HP, and others, have the potential to really shake up the VR landscape. These headsets have integrated motion tracking to decrease setup time and potentially increase the room-scale play space available to a gamer. Their lower price compared to Vive and Oculus is also an attractive feature. However, even now, they are a new and unproven technology. The integrated motion tracking may seem like a time-saving feature, but this requires that the player is looking at whatever they want to interact with to get a smooth interaction. For developers attempting to develop the next big VR blockbuster, this is an issue that cannot be overlooked, since player experience is everything. In the end, Windows Mixed Reality hardware brings much-needed variety to the VR hardware market, but it may be too new to choose as a platform for development just yet.

Minimum hardware requirements

  • Intel Core i5-7200U or greater
  • Intel HD Graphics 620 or greater/DX12 capable GPU
  • HDMI 1.4 or DisplayPort 1.2
  • 1 x USB 3.0 Type-A or Type-C
  • Windows 10 Fall Creators Update

Samsung Gear VR

The Gear VR represents the fusion of smartphone and VR technology in a sleek little package. The most recent version of this device allows the user to snap a Samsung Gear phone into a sleek frame and enjoy a variety of VR titles built specifically for the device. Controls are handled by inputs on the side of the headset, as well as by a handheld motion controller, reminiscent of those that ship with the Vive. This gives the player a variety of comfortable input options and precision controller motions. So, what does this mean for developers? The mobile CPU and 4 GB of RAM limit the ability of this device to run high-end content, but the Gear VR sports an impressive resolution of 2,560 x 1,440 (2,960 x 1,440 with Samsung Gear S8 and S8 Plus phones). The Gear VR also represents an underserved market. Though its hardware may be small, Unreal Engine 4 has supported development for the Samsung Gear VR since version 4.7, and this device is by far one of the best available for developing mobile experiences. For the savvy developer looking to build small applications, this may be a great opportunity.

 

Limitations of VR


Though VR is capable of delivering immersive, visceral, digital experiences to players, it is important to note that it is not without its limitations. Beyond all the RAM, processing power, sensors, cords, and controllers that VR demands, this technology has shown us some of our own limitations—the most well-known of these being VR sickness or the disconnect between what our vision is showing us and what the rest of our senses are perceiving. Most commonly felt during movement within a VR game, VR sickness, or simulation sickness, may cause any of the following:

  • Nausea
  • Dizziness
  • Disorientation
  • Sweating
  • Various other ailments

All of these things are things we don't wish to be a part of any player's experience. These can be caused by features within games that we sometimes take for granted in a non-virtual environment, such as taking control away from the player to show them a cutscene, using camera bob, camera shake, or overriding the  player's field of view. Issues can also can arise from the framerate dropping too low. For this reason, we as developers must be constantly aware of our game's performance on our chosen platform. In the following screenshot, we have the recommended framerates for several of the VR headsets that Unreal Engine 4 supports:

Unreal Engine 4's VR recommended framerates, courtesy of Epic Games

Choosing a method of locomotion and turning that provides the player with a constant and steady feeling of acceleration, and is just one way to do this. Some established methods of locomotion that have arisen from development in VR techniques include cockpit-based, natural, artificial, physical, and teleportation. We will learn more about these methods of locomotion and how they might suit our game in Chapter 2, Locomotion, Design, and Starting Our Project. Other methods of controlling VR sickness include avoiding cinematic camera effects that alter the player's vision, such as motion blur and using dimmer lighting. Bright colors and blurring effects will cause players nausea as a result of eye strain. Finally, it is also worth noting that medical science has still not thoroughly studied the effects of the prolonged use of VR, as well as the issues that might arise from children regularly using the device. As designers, player experience should always be at the front of our minds, and keeping our players from being physically uncomfortable is one of the most important ways we can keep them coming back to our game.

 

Introducing our sample project – Server 17


To help frame our exploration of VR development with Unreal Engine 4, we will develop a game I like to call Server 17. Designed as a room-scale experience geared toward gamers who enjoy VR and skill-based games, Server 17 puts players in the shoes of a cyberpunk hacker in a dystopian future of corrupt governments and mega corporations. The player will have to unlock the secrets of a corporate server, which will be represented in game as a puzzle box. They will have access to a variety of tools and programs that will allow them to succeed before network security can catch them in the act and bring them down.

Note

For this project, I have chosen to use Unreal Engine 4 with the HTC Vive. The Vive gives our players a nice, large room-space experience with excellent tracking of both the headset and the hand controllers. It also utilizes less USB ports on the computer. This is a great feature, since I am developing on a high-end laptop with limited ports. Though it does not have the finger tracking you may find with the Oculus Rift + Touch, it is an excellent piece of hardware that will meet the needs of this project.

 

Summary


As we take our first steps down the road to becoming VR developers, we took a look at the decisions that we will have to make before getting started with developing our first VR title. We  also took a look at several compelling reasons to choose Unreal Engine 4, such as continual support for VR, free access, Blueprint Visual Scripting, and powerful shader tools. We then discussed the different types of VR experiences that currently exist and which type of hardware might suit itself best to each one. Finally, we discussed VR sickness and how this debilitating condition can best be avoided.

As we move onto Chapter 2, Locomotion, Design, and Starting Our Project, we will make some decisions about how best to design our sample game, Server 17, and we will create the necessary setup files to start moving forward with development. To make sure we all understand how each of the blueprint files interact, I will be creating as much of the content as I can from scratch, only using templates and premade files when needed. Welcome to the adventure—let's move forward!

About the Author

  • Jessica Plowman

    Jessica Plowman is a game designer and educator who currently resides in the United States. At an early age, she discovered her love for video games and the joy they bring to others. She began teaching students about game development in 2005 and enjoys supporting the dreams of the next generation of developers. She has worked with Unreal technology for over 10 years, and currently teaches students game technology and game design in Sarasota, Florida. When not teaching, she consults on different topics related to Unreal technology and continues to further her education by researching best practices related to both teaching and game development.

    Browse publications by this author
Book Title
Unlock this book and the full library for only $5/m
Access now