TankXP VR: Drive a tank to fight aliens

8_got_em_sm

This weekend I spent 48 hours making a VR game for Ludum Dare #36 called TankXP VR. The theme for this competition was “ancient technology.”

“Oh no! An alien invasion! Time to strap on your Vive and show them who’s boss using your awesome tank. Unfortunately, your tank’s operating system seems to be a little out of date….”

Download TankXP VR for Windows & HTC Vive
*Requires at least the smallest Play Area size (Standing VR not supported)

I got the idea for this project during the week leading up to Ludum Dare. I knew that I wanted to make some kind of virtual reality game for the Vive, and I wanted to find some novel interactions that I could make players do. At first, I was playing with the idea of making players lie down on the ground, perhaps to look out an awkwardly-place window or to fix the underside of some machine. That’s when I got the idea of surrounding the player with a ton of levers, knobs, and other controls, so that they feel like they’re piloting a complicated piece of machinery. In my head, I was envisioning some kind of steampunk vehicle that had all sorts of random contraptions attached to it, like cannons, robotic arms, and telescopes. Over the course of development, the machine that I had in mind transitioned from a tank to a rover and then back to a tank.

Since I committed to this idea before the hackathon started, one issue that I ran into was the question of how I was going to make this fit the theme of “ancient technology.” The solution that I came up with was to make it look like the tank was running on Windows XP, a joke that was inspired by this news story. Unfortunately, the Windows XP consoles don’t really add anything more than that to the game.

The first set of mechanics that I implemented was the idea of using two levers to control the vehicle’s wheels.

4_drive_1

Turning basically amounts to hitting the brakes on one wheel so that the other wheel can spin the entire vehicle. Unfortunately, the levers must be exactly aligned in order to go straight, so to make things easier, the levers will try to “snap” to the positions of 0, 1, and -1 when nearby. It could still use more polish, though, because it’s still a little frustrating when you accidentally create spin when you’re trying to go forward. Perhaps the levers could snap to each other, and if that’s not enough, maybe the strength of the wheels’ acceleration could vary depending on what the player is trying to do.

4_drive_2

The initial implementation of this also made it very easy for players to start spinning frighteningly fast, thus making you feel very sick. Rather than coming up with complex logic for limiting each wheel’s speed depending on context, I found an elegant solution by simply setting the object’s maxAngularVelocity to a low number. This also had the side-effect of helping to stabilize the vehicle when climbing hills (which I unfortunately already did write some complex logic for, haha).

For the last several months I’ve been practicing making 3D art assets, and during this project I was struct by just how comfortable I’ve become with the whole 3D asset pipeline. The last time I did Ludum Dare, I spent half the weekend trying to make just one model and troubleshooting various issues that came up when importing into Unity. This time I felt like I was able to just get things done and focus on the project rather than the tools. The only issue I ran into was my realization that 3DS Max’s World Space Modifiers can’t be exported to Unity, which meant that the below tank threads animation (which I was pretty fond of) had to be replaced with a less-cool-looking scrolling texture instead:

2_tank_wheels_fail

At one point during the weekend, one of my roommates suggested that I add trees to the world so that you can have more visual reference points to really feel like you’re moving. In pursuit of solving that problem, I bought some cheap desert rock assets, but I ran out of time before I could put them in. At least I ended up with some better textures for the sand (previously I was using Unity’s Standard Asset sand texture).

Once I got levers working, it was relatively simple to get the cannon working, and before I knew it, the vehicle actually started to feel like a tank, as opposed to a weird golf cart.

5_finished_tank

With any VR project, the big worry is usually “how do I keep players from getting sick?” Moving the player avatar around the world will definitely make people sick, but I heard that vehicles are less likely to do that, given that the player has enough visual reference points to make them feel like they’re at least stationary within the vehicle. I found that it was pretty easy to feel sick when looking out the tank’s big windows because you start losing those visual reference points. This was the reason why I added those horizontal bars to all the windows, which also helped make the vehicle look even more like a tank.

The last thing that this prototype needed was to give you something to do with your tank. I thought that having moving flying targets would be great, so I put flying saucers in the sky for the player to chase and shoot at. The saucers don’t really do anything to threaten you, but it can still be pretty thrilling to have them approach you and pass overhead, as if you’re expecting them to shoot at you. I wasn’t sure if players would recognize the small floating objects in the sky as aliens, so I plastered the empty surfaces in the tank with UFO newspaper stories. By this point I was running out of time and I knew I wouldn’t be able to fill the tank with as many contraptions as I initially imagined, but the few controls that are already in the tank at least feel pretty fun on their own.

One of the things that some players found jarring (but that I really like) was the fact that the controls are so far away from each other. You kinda have to kneel on the floor in order to drive well, and you need to stand up in order to aim the cannon. This was an intentional inconvenience because I felt like it would help sell the idea that you really have to navigate this complicated machine, rather than just sitting in a chair pushing nearby buttons. To make this idea really work, though, I would need to put more controls elsewhere in the vehicle, perhaps another cannon in the rear or a radar/navigational console in the tank’s rear corner.

6_tank_controls

Overall, this idea worked out surprisingly well. If you have a Vive, download TankXP VR, and let me know what you think!

3 thoughts on “TankXP VR: Drive a tank to fight aliens

  1. How does it work with people at different heights?
    Would be cool to have multiplayer mode in one tank. Looking at your comrades while they are loading ammo would be nice and force collaboration. Maybe have a person playing gunner like bf4
    Would be awesome to have a underwater treasure hunter game too like this.
    Great job

    • When I was planning the project, I wanted to support a bunch of different perimeter sizes and heights, but I didn’t have enough time so I just made it work for my setup only (which just happened to be the minimum size requirement). I made the ceiling a little taller in the name of accommodating for tall people, but otherwise I didn’t really try to support other cases.
      Multiplayer would be so awesome. You might be able to have an even bigger tank with you controlling one half of the room. Though I really like the idea of having two players juggling several controls on the same room together.

  2. Hi Livio this is super cool. I wanted to say congratulations on all of the great things u have accomplished. Especially your site inter guild. -Neezles

Leave a Reply

Your email address will not be published. Required fields are marked *