Takeaways From VR
In the fall semester 2022, myself and three others created a VR sandbox spellcasting game. The premise is that you are a wizard with a pocket full of gems that you can toss around to cast spells. These spells let you fight, destroy objects, navigate around the level in interesting ways, and spawn fun props. This post will outline the lessons I learned from my VR development experience.Â
demo_steve.mp4
Perfect Throwing
Our game is about casting spells by throwing small objects. Throwing things is essentially the main mechanic of the whole experience. Historically, throwing is questionable in most VR games. Often times it will feel off, and shoddy throwing physics tends to break immersion. The problem is that underhand throws go way too far, and overhand throws don't go far enough. Here are the default throwing settings in the Unity's XR Interaction Toolkit:Perfect Throwing
By default, as the player is holding an object and about to throw it, the system will work in the following way:
- Every frame, cache the controller's velocity.
- When the player releases a button to throw, take an average velocity from the last 0.25 seconds.
- Weight this average as defined by ThrowSmoothingCurve (none by default).
- Apply this velocity to the released object.
Everything is more fun in VR
Seriously, game designers need to capitalize on this. When Connor and I were testing this game, we noticed that it was super fun to do simple things like stack boxes, throw rocks, and to play with the explosion features we provide for the player. We had to pry testers off of the headset after playing for hours on their own volition simply because there are so many things to do in this world. I don't really know why VR is so much more fun than normal gameplay, but I have a theory.Normal controllers only offer a fixed number of inputs due to a fixed number of buttons. VR controls, on the other hand, have the same buttons in addition to the position and rotation of the controllers and headset. Since VR has considerably more input that is provided to the engine, it gives the player the means of interacting far more with the game world. This means that all we have to do is give the player a modular item, like a small, simple box, and they can do any number of things with it:Everything is more fun in VR
- Stack them to make pyramids, then explode them
- Use them as a platform to reach additional parts of the map
- Use them as a shield from enemy projectiles
Spell Design
We implemented the decorator pattern, a system of quickly making our spells modifiable, potentially even at runtime. This is a good system to capitalize on the extra fun that comes out of simple VR actions. All we did was set up components for the following features:Spell Design
- Explode on impact with some force modifier f
- Spawn a GameObject on impact
- Teleport the player on impact
- Emit light
- Morph and grow into a bigger object
- And several more small interaction scripts like destructible objects, damaging enemies etc
- An explosion that shoots the player back like a rocket jump
- Make f negative to suck in surrounding objects to create an implosion
- Spawn the aforementioned multi-purpose cubes
- Spawn and grow ice crystals from surfaces to block off areas, reach new parts of the map, or build a small structure
- Spawn platforms in the sky for the player to jump across
- Create a bouncy ball of light to illuminate the darker areas of the map
The Development Team
The Development Team
Steven Annunziato - Team lead, systems & gameplay programmer
Michael Bowen - Dev ops engineer, Oculus hand tracking integration
Connor Evans - Systems design, game feel, level design
John Wright - Environment art, destructive props