Fidelum Games

The Gallery: A VR Experiment using Unity and Google Cardboard

Advertisements

VR Puzzler: The Gallery

Introduction

‘The Gallery’ is my first completed VR experience. It was completed as part of Udacity’s ‘VR Developer Nanodegree’, was developed in Unity and deployed for Google Cardboard on Android.

The experience itself is quite short, but it is a complete gameplay experience with a beginning, middle and an end.

Before I describe the game any further or go into the details of the game’s development, have a look at the gameplay/walkthrough video:

In the first portion of this video, you can see the main room. This is pretty much identical to what I had planned, except that I wanted the second painting to link to another puzzle and for the blank wall behind the player to lead to a hallway with additional puzzles (something to implement in a future title maybe?).

I’m quite happy with the second portion of the video, with the Simon puzzle and the storm. This level was actually fairly quick to set up, even though it’s much larger and has more going on in it with weather and what-have-you. Basically, I had Gaia generate a terrain (including the houses shown), and then set the stone models in place. Also, I had Enviro set up for the weather, but apparently, it doesn’t support mobile deployment, so I had to buy the mobile version, which cost me a whopping one hundred cents (yes, a dollar).

However, I did have to create a custom emission texture for the stones to create the glowing effect, and I did write the script to randomly generate a new 5-step sequence each time the level is played, which took the bulk of this level’s development time.

In the final portion of the video, after returning to the room, there are only two things which I would have liked to implement that I didn’t have a chance to do: have a final puzzle where the player had to navigate a ball through a labyrinth to be able to travel through the final door (which can be seen in my sketches below), and a jump scare after leaving the room (which also has some hints in the below notes).

Design

Like all of my projects, when I began designing ‘The Gallery’, I wanted to make sure it remained simple and doable. Also like all of my projects, as I stepped through the design process, I found the game’s concept and feature set quickly growing.

I knew if I wanted to complete the project in a reasonable amount of time, everything probably wouldn’t make it in. But I didn’t want to limit myself right from the get-go. Instead, I decided I would use an iterative process, and add to the game as time permitted.

Here are a couple of the early sketches and notes about the game. Some made it in, others had to be scrapped:

Figure 1. Room Layout, Bird’s Eye View

Figure 2. Main Wall Layout

Figure 3. Labyrinth Puzzle Plans

Figure 4. Puzzle Paintings

Figure 5. Some additional puzzle ideas

As you can see, there was a lot that didn’t make it in. Additionally, looking back now, I realize that I didn’t document much of my original plans for the game. In retrospect, the elements that make up the core of the game (the infinite hallway and the simon puzzle) were already solidified in my mind and didn’t really require any further design.

Additionally, I created the following fictional user profile to keep in mind when designing this game:

Name: Schwight Drute

Age: 37

Occupation: Paper Salesman

Quote: “Bears, Beets, Battlestar Galactica”

Description: Schwight is a bit of anerd. He’s a big fan of classic video games and sci-fi. While he has some knowledge of VR, he’s only just picked up his first Cardboard and is excited to start exploring it.

VR Experience: Minimal.

Obviously, this is a bit of a joke profile. However, it created the need to design for people with little to no VR experience, which is what I did. Bearing this in mind, I defined simple, context based controls: if a user is not looking at an interactive object, providing input initiates movement, otherwise, it triggers the object. Additionally, visual cues through the UI changing from a ring to a hand provide hints that objects should be interacted with, and directional sound provided additional hints for solving puzzles (the key in the light especially.

Story of the Process

As I mentioned, at the very beginning, I knew this would be an iterative process. I also knew that I wanted to include the infinite hallway mechanic shown in the video, so that was the very first mechanic I developed. Using Probuilder (a free tool from the Unity Asset Store), I built the following environment as a prototype, and used it to develop the infinite hallway mechanic:

Figure 6. Probuilder prototype

Once I was happy with the way the mechanic looked and behaved, I started to add polish, and wound up with the following result, which I’m quite happy with:

Figure 7. Polished hallway

The models are all free assets from the Unity Asset Store, and the wall and floor textures are public domain from textures.com. All sound effects (aside from weather effects) are public domain from freesound.org. For the second level, with the stone puzzle, most of the environment comes from the Gaia asset, and the weather effects are courtesy of Enviro.

User Testing Outcomes and Iteration

Although user testing should have occurred multiple times throughout the project, I was only able to find the time to do it once.

The testing went off without a hitch, with the tester actually providing pretty much all of the feedback I was expecting. Here were the questions and answers:

Q. What kind of feeling did you get from the environment?

A. Claustrophobic, eerie, creepy

Q. How big did you feel like you were?

A. Normal Size

Q. Are there any other recommendations you would make?

A. The input was a bit buggy.

Of these three questions,the first two yielded the exact answers I was hoping for, and didn’t prompt any rework. However, the comment about buggy input, which more specifically was about how the camera would jitter when ending/initiating movement, was a bit of a cause for concern.

After some debugging, I found that this didn’t occur on levels with lower processing demands, so I determined it was a result of the heavy real-time lighting demands of the hallway room. However, due to the nature of this particular room, baked lighting was not an option since the hallway stretches, so I decided the minor input bug was acceptable in order to have more realistic lighting.

Development and Feature Highlights

My favourite feature in this game by far is the infinite hallway illusion.

Often, while learning about VR, it’s emphasized that we, as developers, should be careful to do everything we can to make our players comfortable and to avoid VR sickness. For the most part, I agree with this philosophy. However, if something happens in our virtual experience that, in the real world would cause disorientation and a feeling of unease, the same should occur in the virtual world. That’s exactly why I made this mechanic.

The way I implemented this is actually fairly simple, and the illusion can actually be completely broken if you approach the hallway in the game from the correct angle, or look directly downward (something I would’ve corrected given more time).

Essentially, the section of the room which ‘stretches’ just has its z scale increase as long as the player is walking into an invisible collider. Additionally, an empty gameobject is placed in the position of the far wall, where the door is, and a prefab containing the door, lights and plants has its position set to the position of the empty gameObject each frame. Lastly, the tiling and offset of the floor and wall materials is shifted as the hallway stretches, in order to give a false sense of motion. This is why, no matter how long the player ‘walks’ down the hallway, when they turn around, they’re standing exactly where they started.

I do have to confess however, that I was inspired quite heavily by the infinite staircase found in Bowser’s Castle in Mario 64.

The code:

 

Conclusion

While this isn’t my very first experiment with VR, it’s the first project that I can consider to be complete. I’ve got a ton of ideas for future projects that will introduce new ideas into the realm of VR and challenge what is traditionally thought of as ‘best practice’ when developing VR. This is a fledgling technology, and I’m excited to be part of the generation that shapes its future.

Advertisements

Advertisements