Featured Blog | Conjuring a Gesture Spellcasting System for VR

What should Touch Would you like to be a wizard?

This is what I had to figure out when I started prototyping. IRON SHOTmy VR co-op action roguelite. Adding magic was a frequent request from players of the IRONSTRIKE prequel, Iron lightsso I knew from the beginning that I wanted to include some kind of spellcasting system. But it couldn't just be a matter of selecting spells from a glorified menu. I wanted to go beyond radial menus or one-step gestures and design something that really took advantage of VR.

The most important thing was that I wanted something that rewarded me. ability.

We can trace my inspiration pretty easily. You see, I’m a nerd. And I read a LOT of cheap fantasy books as a kid. What made the spellcasters in these books so awesome wasn’t (just) that they could throw fireballs around. It was that they were skilled practitioners of the arcane arts, manipulating complex energies by practicing intricate gestures and memorizing mystical incantations. (They were also nerds!)

So, I decided that I wanted a magic system that:

  • Take full advantage of VR motion controls

  • It is conceptually simple and feasible for absolute beginners to use in a fight.

  • Rewards experienced players who hone their skills

  • It can also be used when jumping, turning and moving quickly.

  • It makes you feel like a fantastic pulp fantasy spell caster

I started out trying two very different approaches. Spoiler alert: both were doomed to failure.

Failed Approach #1: Tracing Runes

I started from a simple idea: to draw a line in the air.

Model1.png

(I couldn't save my old prototypes, so here's a mockup.)

This has some cool features. You can make the lines twist into all sorts of shapes, from very simple (like drawing an X) to extremely complex (intricate runes). You can turn the lines into cool 3D shapes. You could have two lines, one for each hand!

Even better: What if we only showed the player the *next portion* of the line they had to draw, instead of showing the entire complex path? That way, experienced players who have the entire spell memorized can quickly cast it, while beginners can continue to draw it little by little until they have it memorized!

Frankly, I really liked this idea. I had a vision of players waving their hands in intricate, convoluted gestures, but doing it so fast you could barely see the structure, building up magical energy, and then shooting it at their enemies.

Awesome! But it broke during playtest.

The problem came from combining lightning-fast hand movements with precise line dimensions. Whenever we tried to cast a spell quickly, we would repeatedly end up “missing” the line by a fraction of an inch, forcing us to go back and retrace the missed section, only to miss the line again a second later. This was incredibly frustrating, and the frustration didn't seem to improve with experience. Sure, on some level this was probably a “skill issue,” but it was still a problem if you felt it. This bad in practice.

At first I thought we could solve this problem by slightly modifying the implementation. We tried MANY variations. For example, what if we removed all sharp corners from the spelling line? Or dynamically reduced the required precision during tracking? Or modified the tracking detection algorithm in a dozen different ways?

A couple of times we managed to make fast-casting spells viable! But that meant making the system so forgiving that the best strategy was to wave your hands wildly. Kind of the opposite of the “elite wizard” vibe we were aiming for.

Failed Approach #2: Direction Sequences

Okay, forget about the whole line drawing and complex shapes thing. What if the whole spell was just a series of directional swiping motions? Move your wand up, then down, then diagonally, then UUDDLRLR and *poof* you have a fireball!

Mockup2.png

It doesn't get much simpler than that! And it still had the potential to reward memorization and skillful execution. But it did have a few problems. For one thing, you can cast any spell by drawing tight, rapid circles (i.e., hitting every direction) as fast as possible. (This can be mitigated in a variety of ways, but then it starts to get complicated again.) For another, this system doesn't use space in a meaningful way. It feels more like entering code than casting a spell. It doesn't make me feel like a wizard.

You could make this work, but I wasn't too keen on the idea. Luckily, though, this inspired the mechanic that actually worked:

Summary: Crossing the line

It turns out that if you combine the two approaches above, they come together to form the perfect mechanics! Sort of!

We needed a mechanic that was more rigid than simply sliding in a certain direction, but more forgiving than hitting a certain point on a path. So why not combine the two ideas: having the player slide in a certain direction? near a certain point?

Well, this seems easy to implement! Define a spell as a series of line segments and require the player’s movement to intersect each of those line segments in the correct direction. We can define an “intersection” in 2D (by projecting both the line segments and the player’s hand motion vector onto a 2D plane) or in 3D (by giving the player a long wand/ray extending from their hand and detecting when it hits the line segment).

And… it works!

It's easy to explain and teach to new players:

It can be easily expanded to accommodate many complex gestures:

And with practice, you can cast complex spells quickly and smoothly:

I can change the length of the line segments to control the precision of the movements at each point, but mindlessly waving my hands will not cast these spells effectively.

This system encourages players to memorize spells and practice the physical skill of casting them quickly. Here's a video just recorded by an IRONSTRIKE player to show off his magical prowess in combat:

This spellcasting system has been very successful so far. Casters make up about a quarter of the players in any given IRONSTRIKE series, usually playing the role of support or artillery. And there's plenty of room to expand the system with more spells, as it's easy to create new spells of any complexity.

When I think back on this system, it’s interesting how the key elements (requiring a certain directional scrolling/positioning in front of the player) are similar to one of VR’s biggest hits, Beat Saber. It’s not intentional, but that kind of convergent evolution suggests to me that these could be useful ingredients for other game mechanics. I’d be interested to see other systems that use a similar approach in the future!

@E_McNeill

Leave a Comment

url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url url