ZombieDefender

by Stephen Sladek in association with Kyle Meystedt, and Richard Justice

October 31, 2018
724 words, 3 min read

The crypt of the undead.

Introduction

In my CS375: Computer Graphics course at SEMO, my group worked on creating 3 projects. The overarching goal was to learn how to create a game that utilizes both Virtual Reality (VR) and Electroencephalogram (EEG). The first project was focused on developing a game for desktop VR, the second focused on adding in EEG functionality, and the third was a "bringing it all together" final project. This is the first of those three projects.

Since I was the only one with access to a VR headset (my personal Oculus Rift), I was thereby responsible for implementing all of the VR mechanics. My cohorts, Kyle Meystedt and Richard Justice, contributed the zombie spawning system and the start menu. We used Unity 2018.2 and the SteamVR plugin to make all the magic happen.

Summoning Forth the Undead

I got ahold of some assets from BitGem for creating a basic dungeon scene and went to work on setting up the arena. Just darken the skybox up a bit and add some lighting to the candles and we have a spooky dungeon to start spawning the hordes from. After that I just used Unity's Animator to set up the states for our zombie to transition between idle, attacking, walking and dying. The pathfinding was much easier than I had anticipated after discovering Unity's Navmesh system. In hardly anytime, we had an arena with a zombie that could traverse it without going out of bounds.

Our zombie is ready to go.

After the stage was ready, I set up the camera for VR while Richard got busy with the spawning system. We needed to be able to move around still, so locomotion was next on the agenda. After coding, testing and reiterating for a few days, I managed to figure out how to perform teleportation in SteamVR. Note that there are pre-existing built-in methods for teleportation with the SteamVR plugin, but they tend to only work with Vive, so I needed a more reliable solution. I also got the grabbing and throwing mechanic rigged up, so now we could actually interact with the virtual realm.

Kyle provided the start scene and some weapons for us, and I got the team's contributions all integrated into one nice solid game. We tried to implement a weapon system to allow the player to toggle through multiple weapons, but we ran short on time and settled for just chucking fireballs. To make it interesting, I set the fireball spawn limit to have up to 5 at a time. The player could grab and throw multiple fireballs at a time, or even just leave them floating in place to act as a trap for a zombie to wander into.

User Testing

The day of reckoning came, October 31st, and it was time to debut the fruit of our labor. The students loved it, and for most of our testers it was their first VR experience. This was likely the first time a group of students had done a project in virtual reality at SEMO. Our instructor even cut one her classes off early so that the other students could come and bear witness to our creation.

After a good round of user testing, we found that the spawn system was a little excessive and needed to be dialed back a bit. Students who weren't accustomed to VR would be swarmed by 20 zombies within the first minute, while VR veterans would hold out for less than 5. The background music could've been toned down as well, even though it had already been cut down to 30% of its maximum volume, users still struggled to hear their fellow students whilst immersed within the game. Nevertheless, students took their turns, all eager to give the game a try.

Conclusion

The game could have used more optimization, but that's what testing is for, and rarely do prototypes come out without their flaws. Either way, the project was an overall success. The zombies would spawn and chase after the player, attack when they got near, and die after being hit be a fireball. Audio triggered as needed, the mechanics worked as intended and everyone had a good time. Our first project was done and now it was time to forge onward to learning to work with EEG.

Continue to the second project.