Wednesday, April 30, 2014

Get Better Soon, dev diary #4: conceptualizing input in virtual reality.

This is a development diary series for "Get Better Soon", an NEA-funded gay club VR simulator game I'm making for Different Games. You can check out previous dev diaries here.

Virtual reality is weird and terrible for a lot of reasons: "simulator sickness" is the frequent sensation of nausea that attacks many players, simply from trying to exist inside virtual reality. (There are lot of complex reasons why that happens.) There's something fascinating about that -- a reality where existence makes you want to throw-up. A lot of that bizarre beauty is going to get smoothed-over and destroyed as the technology improves, which is unfortunate.

One of the more upsetting developments in VR progress is the specific user flow and use-cases that the two biggest VR influencers (Valve and Oculus) are prescribing for VR games. They imagine every VR user is going to be seated in front of their computer, with a positional tracking camera on a desk in front of them. The idea is to seat the player so they always know which way is "forward" by their dead reckoning, which simplifies how head tracking will combine with controller or mouse input. That way, it matters less whether you're blindfolded with a screen strapped to your face.

I think this is kind of a conceptually lazy way of solving the "input" problem.

With Get Better Soon, as well as my other VR experiments, I'm seeking to use only the VR headset as the sole player input -- and through the *power of design* (!!!) hopefully I can make that control scheme make sense.

So let me walk you through my thought process for designing the input scheme for this project:

First, the player is presumably a human, in a world populated by other humans. The mindless instinct might be to control this human character using WASD keys and mouse-look, or with two analog sticks, like any other first person game... but why would I need to strafe or stumble backwards in this world or narrative situation? My player character wouldn't do that, so I won't let the player do that either.

Next, the setting: you're in a club filled with dudes in various states of undress.

(Currently, dudes attempt to cluster at "dude nodes" and face each other to give the appearance of social groups / socialization. There's still a lot more to do here. The social simulation will probably get another post later.)

In games, "looking" is usually a "free" action without consequence.

Given the freedom, you'd ideally want to look in all directions all the time to retain perfect information about everything happening around you.

If you did that on the street, people would stare at you or walk on the other side of the street. There are acceptable ways of looking at things and there are unacceptable (and creepy or weird) ways of looking at things. How do I communicate the consequence of looking?

In this game, you move around the space by looking at butts.

In 3D games, to know what you're looking at (or to know what you shot a laser gun at, or to know what your mouse clicked on, etc.) we use a thing called raycasts. A raycast is a common game engine function that shoots an imaginary bullet from a certain position toward a certain direction, and if it hits something then it tells us what it hit.

So to know what you're looking at, I shoot a raycast from the player's position in the world, toward the direction of their camera facing... and if that raycast happens to collide with an invisible hitbox on a dude's butt, then I apply a force to propel the player forward.

If you need to get somewhere, just look for a butt that'll get you there.

I think this is an example of trying to solve the "input" problem through design. In any other game, it probably wouldn't make sense to make movement depend solely on dude butts. But by carefully considering the context, you can make hardware limitations irrelevant. Playing with a controller or mouse would now dilute the experience instead of enhancing it.

(Note: I ended up disabling the crotch hitbox, it made the game too easy.)

An elegant side-effect of this mechanic is that when dudes turn around and face you, you end up looking away because now they are "useless" to you because you cannot look at their butt.

It simulates the back-and-forth dynamics of eye-flirting with someone at a club:

"Did he look at me? Oh, he's looking at me right now, I better look away so he doesn't know I've been looking at him this whole time... is he looking at me now? Wait, now I have to look at him to know whether he's looking at me... oh okay he's not looking at me anymore so I can finally -- oh my god he saw me looking at him!!!! oh my god he's walking over oh my god oh my god how's my hair, quick act natural, act cool, c'mon..."

You stare at each other. Longingly. No words are necessary.

And then? And then you dance.

... What? You think people don't actually dance like that?

Umm, okay, maybe the procedural dance system still needs a little work. Hmm.

(Character art by the talented Kris Hammes.)