Building a VR Game for My Daughter

Featured Gaming Geek Culture Videogames

As a VR enthusiast who is also a programmer, I’ve been thinking about ways to make my own immersive content. There’s just one problem: I don’t know the first thing about graphics programming. Server-side programming and distributed systems — my normal stomping ground — have almost nothing do with meshes, polygon counts, frame rates, and other staples of graphics engineers.

But it turns out this ignorance is no longer a show-stopper. Game engines such as Unity (which dominates VR development) abstract away all the guts and grit of game development into components you assemble by dragging, dropping, and tuning with checkboxes, sliders, and text fields. Some programming is still required, but it’s a vanishingly small amount relative to the final product.

(A side note: I’ll be working at Unity starting on June 13, but the decision to learn the engine predates that and indeed inspired me to apply there. Still, I’m not unbiased at this point.)

While I have non-game VR ideas, Unity is a game engine. Making a game seemed like the quickest way to learn the basics of using it. And it didn’t take me long to think of one.

My daughter is currently obsessed with cheetahs as only a preschooler can be. Why not make a cheetah game? And why not make it in VR?

Within a couple weeks, working for a couple hours each night and having no experience with Unity, I had done just that. Starting from a rough mental design, I ended with a Google Cardboard-compatible Android app in which a cheetah chases down a herd of gazelles.

Here’s the basics of how I did it to — I hope! — inspire you to try your hand at game development as well.

I Downloaded Unity. Now What?
Once I downloaded the engine, I picked up a couple books. While Unity Virtual Reality Projects still seems promising, the other one was more about following steps than understanding concepts. Save yourself some money and use Unity’s own tutorials. Once I did the first two, I figured I was ready to tackle my design and learn as I go. Some of my colleagues here have looked into online courses, which may be a better fit for you.

Within a few days, I had a game I thought a three-year-old could handle. A standard Unity model chased giant white pills around a grass-covered field as they made minimal efforts to avoid you. Not cheetahs and antelopes, but a playable game nonetheless. Then I wanted VR.

Cardboard Inclusion
I let our daughter use the Google Cardboard headset — my Gear VR is too big and requires her to be able to focus the lenses. Adding Cardboard support to my game was laughably easy thanks to Google’s library: Drag a script onto the game’s camera, and you’re done.

Slightly trickier was figuring out how to move. This is a pervasive problem in VR even without adding a preschooler’s lack of joystick-savviness. For my simple game, I decided to have the cheetah run in whatever direction the player was looking. The Cardboard libraries give you access to the user’s gaze, and I got my mechanic working within an hour or so.

Now I had a game that I could play in the Cardboard headset. But it was still standard characters and shapes. I needed to add the animals.

Cheetahs and Gazelles
This was probably the single hardest problem I faced. Finding models wasn’t a problem — Unity’s asset store quickly yielded cheetah and gazelle models that came complete with animations. But the getting-started tutorials don’t even hint at Unity’s powerful animation system. Once I read the documentation and got my cheetah running over the course of a few days, the antelopes were easy. The animation transitions are still rough, but they’re good enough for a preschooler.

When I built the game for my phone and put it into the Cardboard headset, I literally giggled as the big cat just in front of me in VR chased down gazelles that disappeared as I touched them. I couldn’t believe I had done this.

Finishing Touches
From there, I just needed to add audio and figure out what to do when you caught all the animals. Then I was ready for a play test. I eagerly told my daughter about the surprise I had spent two weeks building and handed her the headset.

If you’re reading this site, you probably have kids. And you can probably guess how a 3.5-year-old reacted: initial excitement and then of-course-this-exists acceptance. I have some ideas to improve the playability for her. But a few minutes later she said she’d like a different cheetah-themed game and gave me some ideas about how it would work.

She now knows this is another way for imagination to express itself. I learned something new along the way that I can continue to leverage for her ideas or my own. I call that a high score.

Used Unity for anything? Let us know in the comments.

Tips On Making Games For Your Kids

  • Unity is free for personal use and can build for any platform you probably care about.
  • Don’t spend a lot of time thinking out the details in your game. Get the basic idea working and refine.
  • Use Unity standard assets until you’re sure of what you need. The asset store has tons of stuff, but the quality items, appropriately, will set you back a bit.
  • There is lots of information online. Use the manuals, the forums, and anything else to find what you need.
  • Don’t be afraid to have something crude. My adult self cringes at some of the jerky animation transitions and echo-y audio in my cheetah run game. But once the game is working, those can be refined and fixed. Making the game enjoyable first will give you time to iron out the kinks.
  • You don’t need to be a career programmer to do this. Not only do the tutorials walk you through what you need, the community has provided lots of code samples you can leverage.
  • Program in C#. Unity has a “JavaScript” option, but no modern JavaScript developer would recognize it as such. If you’ve programmed in Java, C# will seem familiar.
  • Don’t give up! Look at the Unity show reel from GDC 2016, and you will be blown away by the breadth of styles and genres the engine can produce. What you want to do is probably doable, so just keep at it.
Liked it? Take a second to support GeekDad and GeekMom on Patreon!
Become a patron at Patreon!