About this blog:


Tuesday, April 4, 2017

5 Essential Tips for VR Game Development

Below are tips that I've learned by building a practice project, working an internship at a VR studio, and going to conventions.

5. Frame Rate

Games run around 30 - 60 FPS. However, the camera in VR is essentially two cameras set slightly apart, both rendering the scene at the same time, so a normal scene that would run at 60 FPS, now needs about twice the processing power. Most studies show that 60 FPS is the bare minimum to prevent motion sickness. In fact, Sony Playstation VR at GDC 2016 even told developers flat out they can never EVER drop below 60 FPS or they will not publish. The golden number that everyone seems to agree on is 90 FPS for HMD’s like the HTC Vive, and 60 FPS for phone-based headsets, and if kept constant, you can avoid motion sickness, lag, and overall frustration from players.

In Unity, you can very easily get a rough estimate of your FPS by clicking on stats in the game scene, or going to Window à Profiler (Ctrl + 7), then turn vsync off by going to Edit à Project Settings à Quality. (Turning VSync off will give you a more accurate view of usage since it won’t try to sync up with your refresh rate, but remember to turn it back on before building). The profiler is especially helpful because it shows a breakdown of what is taking up the most space.

Clicking on stats in the game window can give a quick idea of FPS

Turn vsync on and off by going to Edit -> Project Settings -> Quality, then bottom of the inspector


Below you can see examples of what it is with vsync on and vsync off:

vsync on
vsync off


4. Console

This may sound obvious, but when I started this project, I naively thought I could adjust a few things here and there and make the game compatible with any VR headset. Then when I was finally able to test it, I realized each have their unique controls and feel. For example, in the Gear VR, this laser looks like it’s coming out of my crotch, but in Oculus, it looked higher. Also, because I click to shoot, I turned off the mouse look for Oculus, but then swiveled around with my head attached to the computer and right arm attached to a mouse. You can see the embarrassing results in the video below. It felt great in Gear VR because I was less tethered and could easily use the action button on the side to shoot. I know it sounds obvious NOW, but hindsight is 20/20. Really what I envisioned for this game is being played on is an HTC Vive, 2PV, but alas I was a student and only able to get what I could borrow.




3. Art

Keep your frame rate high by OPTIMIZING everything. Don’t use complicated lighting, or materials that bounce light, like a ton of specular highlight, glowing, or metallic stuff. Not saying you can’t use ANY, but do use sparingly. Also eliminate real time shadows and bake your lights wherever possible. Same with textures, and avoid using too many different ones. I spent a ton of time modeling a cute little robot to dance around in space, but ended up trashing it because of how many polygons it had (not to mention a shiny metallic material). It went up by 500+ FPS when removed, not that it mattered much since it was above 100 FPS to begin with. I didn’t have to do too much optimizing, but you can click here for Unity’s list of optimization techniques.

DJ BroBot

2. Motion Sickness

I separated this from frame rate because frame rate isn’t the only thing that causes nausea. The biggest issue stems from these little things called otoliths in our the inner ear that help us balance. Here’s how I’d describe this amazing evolutionary feat. Imagine three hula-hoops placed on a separate X Y Z axis. Each hula-hoop is filled with sand, and at one point is a sensor that detects what direction the sand passed and how fast they moved, which provides information to your brain about where you are in relation to gravity and acceleration. Also imagine that this system has been co-evolving with your eyes for billions of years, and now all of a sudden, you have this device that shows you’re moving really fast, but your inner ear thinks you’re stationary. No matter WHAT you do, this problem will always be there for some people. There are a ton of tricks, but you’ll just have to accept that nothing will help everyone. Don’t compromise certain things just for those few who will never get past that feeling. Here’s a list of ways to combat motion sickness:

A) Sit still. Don’t even give the option to walk. Games where you sit, look around, or interact with objects around you work well. Two really cool ways I’ve seen of handling this I saw at Indiecade last year – Floor plan, a puzzle game that takes place in an elevator, and Kismet, a fortune teller who also plays an interesting board game. The best way I’ve seen it done is Job Simulator, a sandboxy game where you simulate working a boring mundane job. That's why in my project, you stand in the middle and shoot.

Job Simulator

Floor Plan

B) Have something in the field of view that doesn’t move to ground the player. Think of a car, you see everything fly by you, but you don’t feel like you’re moving. This frame of reference is easy to handle for your brain. I’ve only ever seen this NOT done well once. Narcosis, although a great idea for a game, missed the most magical and addicting part of VR, looking around in 360. You can’t turn your head around because you were in a deep-sea dive suit with a helmet that doesn’t move. It felt limiting and claustrophobic. Below is an example of a ship I modeled for an underwater exploration type game. As you can see, there’s many windows so the player can look in all 360 while still seeing parts of the ship in their peripheral.





C) Move at a constant and slow rate, don’t accelerate suddenly. If the player has to move, make sure they are in control of it. ElemenTerra is a great example; you float around terraforming this planet in a very Minecraft-like way. The movement is slow and never jerky. Another one I tried, VirZoom, has a flying Pegasus game where you eat apples in the sky; the controller is actually a stationary bike. The movement was steady, but you also had a Pegasus head and wings to make you feel grounded. The only time I’ve seen this not done well was Fathoms Below, an undersea mermaid puzzle game for GearVR. In order to move forward, you had to bob your head up and down as if you were a swimming mermaid. However, I moved so slowly that I felt the need to bob my head fast and it felt like a chore, not to mention the whiplash.
Fathom's Below
ElemenTerra
Virzoom - Flying Pegasus Demo

D) If you need to move long distances, tunnel the player’s vision. I first saw examples of this a few years back playing Mare: I didn’t play it long enough to get the story, but it’s a kind of puzzle adventure game where you’re a flying crow. You look at something in the distance and get to it by having everything wormhole around you. The one time I didn’t think this technique worked well was when I played the new Psychonauts demo, Rhombus of the Ruin. The ship you’re on is so small I felt the mechanic was unnecessary. It would’ve worked just as well pointing and clicking from one spot. Before you go saying, “Well Raz has special powers that allow him to do that anyway”. I say, yeah, and one of them is telekinesis, so what’s the point of jumping into another person’s body that’s less than three feet away just to move a magazine? The best example of all time, however, is Land's End, the newest VR experience by the studio that brought us Monument Valley. It doesn't tunnel your vision, but it gives you a target to move toward so you focus on a particular spot.

Psychonauts - Rhombus of Ruin
Land's End

Mare

 
1. Gameplay


Although this list may make you nervous, all these rules and limitations can be intimidating, but some of the best art comes from adversity and working around limitations. If you’re a gamer that likes the AAA art, as realistic as possible, dipping ever so slightly into that uncanny valley, then you’re definitely not happy about #3. If you’re a gamer that loves crazy cool game mechanics inside open worlds and lots of fast paced fighting or exploration, you’re definitely not happy about #2. But I’m here to tell you, some of the most creative games I’ve ever encountered were made in VR, and that’s why I’m so excited about it. Focus on the gameplay - on being original – think of your restraints more as guidelines.