Storm Tanks: Tank Controls & Cameras
by Tim Dix (Raverix) · 08/30/2010 (10:33 am) · 6 comments

Obviously the controls and camera have a very large impact on the feel of a game. As a result, I dedicated a good bit of time up front to really get the feel right. I’m not sure how many modes will be in the final version until the game has gone through more play testing, but at the moment I’ve got the following camera modes implemented (for lack of better names):
Barrel Mode: This is probably the closest to a ‘first person’ camera. The camera is fixed to and always aligned with the barrel. It’s slightly offset, so the aim of the weapon is adjusted to your eye vector. This mode can unfortunately shake a lot depending on the terrain, so I’m thinking of implementing some slight smoothing, but it always needs to be in sync with the tank, so I might end up working on improving the tank’s suspension code so that the tank absorbs more of the change, and you end up with a smoother camera.
Third Person Reticle Mode: In this version, the camera is your typical chase camera, and you have a third person reticle for where the tank is aiming. Being a chase camera, it’s very smooth. And aiming isn’t as dramatically affected by slight changes in the terrain. The orientation of the camera doesn’t change as the turret moves unless you get to the very edge of the screen.Third Person Camera Mode: This is a counter part to the Third Person Reticle Mode, while holding the key to be in this mode, the the turret remains locked in it’s relative position from the camera, and the camera and turret are rotated by your mouse moves. Easier to understand from the video below.
Tank Mode: This mode is your typical chase camera again aligned with the direction of the tank chassis, and is more of a utility than an actual mode. When you’ve got your turret more than 30 degrees off center, you can easily lose track of where you’re tank is headed, so I’ve implemented this much like free-look. While you hold it down, you’re camera swings around so you can quickly check where you’re going, and when you release it you’re back to your turret.Each of these modes has distinct advantages, but I'm concerned that it still may be too many? Anyone have a suggestion? Not sure, play testing down the line will let me know.
Video Demonstration: You may want to switch to 480, as the reticle can be hard to see.
For my controls to work the way I want, I needed to control both the turret, and the camera, independently. So, I started looking at the move structure to add a new set of variables to be passed. I was about to copy the existing code for yaw, pitch, and roll, but realized I only needed yaw and pitch. I also realized that my game doesn’t use roll or up. So, instead of adding two new float variables to be sent every tick, my vehicle interprets:
- move->roll => Camera Yaw
- move->z => Camera Pitch










































About the author
#2
08/30/2010 (11:52 am)
i like how you did it.
#3
I'd expect in-game the most useful is TPcamera mode as you'll want to spend most of your time scanning for targets/threats with the big-gun.
08/30/2010 (2:00 pm)
Awesome stuff!I'd expect in-game the most useful is TPcamera mode as you'll want to spend most of your time scanning for targets/threats with the big-gun.
#4
Oh, and nice work!
08/30/2010 (5:51 pm)
Without actually playing your game I can see the potential for all types of camera control as you've described. Perhaps with more time at the controls and playtesting then one or two modes may be more dominate.Oh, and nice work!
#5
08/31/2010 (7:00 pm)
Like it!! Really like the 3rd person Riticle mode....80
#6
So far, so good! Thanks!
09/01/2010 (1:08 am)
I've found that I'm using 3rd Person Reticle & Camera modes the most back and forth most of the time, and then I use barrel mode when moving in and out from behind cover. I only switch tank mode when trying to navigate through tight quarters.So far, so good! Thanks!

Torque Owner Jules
Something2Play