Virtual Reality for Developers: Cardboard, Gear VR, Rift, and Vive

Casey Borders

July 22nd, 2016

Right now is a very exciting time in the virtual reality space! We’ve already seen what mobile VR platforms have to offer with Google Cardboard and Samsung Gear VR. Now we’re close to a full commercial release of the two biggest desktop VR contenders. Oculus started taking pre-orders in January for their Rift and plan to start shipping bythe end of March. HTC opened pre-orders on March 1st for their Vive, which will ship in April.

Both platforms are working to make it as easy as possible for developers to build games for their platform. Oculus have offered Unity integration since the beginning with its first development kit (DK1), but have stopped supporting OSX after their acquisition by Facebook, leaving the Mac runtime at version V0.5.0.1-beta. The Windows runtime is up to version v0.8.0.0-beta. You can download both of these as well as a bunch of other tools from their developer download site. HTC has teamed up with Valve, who is writing all of the software for the Vive. It was announced at the Vision AR/VR Summit in February that they would have official Unity integration coming soon.

Adding basic VR support to your game is amazingly easy with the Oculus Unity package. From the developer download page, look under the Engine Integration heading and download the “Oculus Utilities for Unity 5” bundle. Importing that into your Unity project will bring in everything you need to integrate VR into your game as well as some sample scenes that you can use for reference while you're getting started. Looking under OVR> Prefabs, you'll find an OVRCameraRig prefab that works as a drop-in replacement for the standard Unity camera. This prefab handles retrieving of the sensor data from the head-mounted display (HMD) and rendering the stereoscopic output. This lets you go from downloading the Unity package to viewing your game in Oculus Rift in just a few minutes!

Virtual Reality Games

Virtual reality opens up a whole new level of immersion in games. It can make the player truly feel like they are in another world. It also brings with it some unique obstacles that you'll need to consider when working on a VR game. The first and most obvious thing to consider is that the player’s vision is going to be completely blocked by the head-mounted display. This means that you can't ask the player to type anything and it's going to be extremely difficult and frustrating for them to use a large number of key bindings. Game controllers are a great way to get around this since they have a limited number of buttons and are very tactile. If you are going to target PCs then supporting a mouse and keyboard is a must; just try to keep the inputs to a reasonable number.

The User Interface

The second issue is the user interface. Screen space UI is jarring in VR and can really damage a player’s sense of immersion. Also, if it blocks out a large portion of the player’s field of view, it can cause them to become nauseous since it will remain static as they move their head around. A better way to handle this would be to build the UI into your world. If you want to show the user how much ammo they have left, build a display into the gun. If your game requires users to follow a set path, try putting up signs along the way or paint the directions on the road. If you really need to keep some kind of information visible all the time, try to make that fit with the theme of your world. For example, maybe your player has a helmet that projects an HUD like Tony Stark's Ironman suit.

Player Movement

The last big thing to keep in mind when making VR-friendly games is player movement. The current hardware offerings allow two levels of player movement. Google Cardboard, Samsung Gear VR and Oculus Rift allow for mostly stationary interaction. The head-mounted display will give you its yaw, pitch and roll, but the player will remain mostly still. The Rift DK2 and consumer version allow for some range of motion as long as the head-mounted display stays within the field of view of its IR camera. This allows players to lean in and get a closer look at things, but not much else. To allow the player to explore your game world, you'll still need to implement the same type of movement controls that you would for a regular non-VR game.

The HTC Vive is full room-scale VR, which means that the player has a volume within which they have complete freedom to move around. The position and orientation of the head-mounted display and the controllers will be given to you, so you can see where the player is and what they are trying to interact with. This comes with its own interesting problems since the game world can be larger than the player’s play space. And each person is going to have different amounts of room that they can dedicate to VR, so the volumes are going to be different for each player.

Above everything else though, virtual reality is just a whole lot of fun! For developers, it offers a lot of new and interesting challenges, and for players, it allows you to explore worlds like you never could before. And with VR setups ranging from a few dollars of cardboard to an entire room-scale rig, there's something out there to satisfy just about anybody!

About the author

Casey Borders is an avid gamer and VR fan with over 10 years of experience with graphics development. He was worked on everything from military simulation to educational VR / AR experiences to game development. More recently, he has focused on mobile development.

comments powered by Disqus