Making Games For The Xbox 360 Controller

November 30, 2007
Tags:

I thought I’d give a little insight into the things I learned about making a game for the Xbox 360 controller.  I’m a big fan of the controller’s feel and ease in developing for it.  The added bonus is that the wired controller can plug straight into the PC meaning there’s even more coverage for it.  I won’t go into details of Xinput but instead give more general advice.  I’ll also share a little knowledge that an ex-Microsoft colleague taught me about its use.

Go with what you know

Before you do any planning for the layout of your controls, sit down in front of an Xbox and play a bunch of games.  Focus particularly on games from the same genre as yours and take notes about what works and what doesn’t.

Playing other games should give you a general idea of what basic controls you want.  Should all movement be on the left stick or should you mix it up and use the A and B buttons or triggers as well?  The biggest advantage with doing this is that people are already playing the games you’ll be trying out.  If your controls are 80% the same as all other games of the genre then people will be able to just pick up and play your game instantly. 

Don’t let this rule out a completely new control layout if that’s what your game really needs, but I’d say 95% of games should really be sticking with what people know to reduce the barrier of entry.  As soon as you have to teach the player something they’ve never done before you’re going to lose a large chunk of your market to people that will just switch off.  If you really do want to make something completely new then I’d recommend spending a LOT of time on the tutorial to make sure all gamers will want to sit through it

Make the most of the controls

There are three basic types of inputs on the 360 controller (as with most joy pads).  They are listed below with what they should and shouldn’t be used for.

1.  Stick
Map really well (and intuitively) to player movement and looking.  It should be fairly obvious where these should be used.

2.  Trigger
Triggers allow analog input (ranging from 0 to 1, or equivalent).  You should be trying to use them as such.  Treating the triggers as a button (on or off) is not only a waste of a good resource, but also means that the player has to do more work just to “press a button”.  Triggers are designed to allow a range of input, and so players need to move the fingers a long way before they become “on”.  If you must use them as a button then think about not requiring the player to pull them all the way in to register a “press”.  Depending on its use you can make any movement at all count, or a % of the way down.

3.  Button
There are a lot of these.  Buttons are great at one thing, being on or off.  Steer clear of using them for something that really should have analog input.  An example is the accelerator of a car.  Unless you’re making a really simple driving game then having the accelerator either on or off just doesn’t give enough control.

Also some general rules.  The A and B buttons are where player’s fingers generally sit while they are in the neutral position.  For this reason you should map your most used control to A, follow by B.  Another thing to note is which combination of keys can’t be pressed together easily.  A and Y are really hard to press down at once without pressing X or B by mistake.  Likewise X and B are difficult.  Try and keep these buttons mutually exclusive in gameplay.

Experiment – change is difficult

Once you’ve got your configuration sorted and everyone has been playing with it for a few months it’s REALLY difficult to objectively compare the control scheme to a new one.  No matter how good the new control layout is it will feel unnatural and you’ll hate it.  The best way to stop this is to experiment as much as possible early on before you get accustomed to the controls.  Get lots of people to test the game using all the different input styles and see which people prefer before one becomes the standard.

If you have left it too late, then you really just have to stay at it for a long time to get used to it.  My estimate is that every two months that you use a control scheme, you have to stay at the new one for around a week before you’ll get used to it.  Be wary of this as there will be a “point of no return” on your project where it will be too late for you to change the control scheme and be able to really test it out objectively.

Don’t always stick with the basics

The right stick when used for looking around (primarily in FPS games) is a powerful weapon.  While it seems like a linear mapping of stick position to angular velocity (how fast the camera turns) might be enough, you’d be surprised how much nicer a game can feel when there’s a lot more happening under the hood.  This goes against my general rule of “less is more” and I believe there’s a real art to getting the “stick look” right in games.  An ex-Microsoft colleague once told me about the amount of work that goes on under the hood in Halo.  The angular velocity is based not only on the stick position, but how fast the player pushed the stick to that position and also what is in front of the player.  If players whip the stick to the side it generally means they want to turn really quickly.  Similar to the old wrist flick of the track ball mice to turn your character really quickly.  Also, when the player’s crosshair is over an enemy then you should slightly slow down the angular velocity a bit to make it easier with tracking.

This takes a lot of tuning and should be viewed in a similar way to makeup.  It should make the controls better, without you knowing it’s even there (for those that don’t know about makeup, I’m just saying make it subtle).

Comparing circles to squares

The final important fact I learnt about is the mapping of the sticks horizontal and vertical axis to their respective values (between -1 and 1 usually).  The 360 controller’s stick can move in a circle.  Depending on your style of game, you may want the stick to act as if it can move in a square.  The main problem here is derived from the fact that the player should be able to have full acceleration (up on the stick) while turning at full speed (fully to the side).  On a square this is easy as the top left and right corners map perfectly to this.  For a circle though you’ll need to write some code to do the mapping for you.  This is again more complexity under the hood, but you’d be surprised that it feels completely natural to the player and they won’t even notice what’s happening.

Conclusion

So there are some general rules of use.  Do you have any other rules I missed?  I’m really pleased with how Microsoft made the 360 controller both from an API perspective as well as its construction.  I’d highly recommend anyone making a PC game to look into adding support for the 360 controller as I’d like to see them become the joy pad of choice for PC gamers.

 

Share:
  • Digg
  • Reddit
  • Facebook
  • del.icio.us
  • DZone
  • LinkedIn
  • email

Find Us On Facebook

6 Responses to “Making Games For The Xbox 360 Controller”

  1. Just a couple of comments on the 360 controller…
    The Right stick is more sensitive to the Left, as if designed for higher precision ‘Look’ instead of ‘Move’ functionality. It also has a different recommended Dead Zone, which is an insignificant point, other than to confirm the hardware difference. As Dools says, sometimes you need to remap the Circular coordinates to Square, so for example, moving to the Top Left returns coords -1,-1 rather than -0.7,-0.7, allowing full range of independent four direction movement. The sticks have so little movement range however, that remapping loses even more of the limited precision. It is interesting to hear how Halo used movement over time to imply more information. I know many PC games track the mouse at higher than game frame rates and analyze the movement over greater than frame time, for the same effect. The 360 controller sure is a great piece of hardware, and much fun to use. Only the N64 controller comes close to it for usability.

  2. Thanks for the extra info Greg. I had forgotten about the different precision of the two sticks.

    I agree that the N64 was an awesome controller also. I do remember getting a sore hand after about 6 straight hours of Mario Kart though.

  3. If the sticks have varied precision, how does that affect the fact that a lot of games offer the ‘Left Handed’ gamer alternative? (ie. Switching analog sticks so left analogue becomes the right analogue functionality and vice versa?) I agree with the whole ‘Stick to the familiar’. People on the whole, hate change and anything unfamiliar or bizarre will likely be rejected by them. (Space Giraffe anyone?) I have read quite a few things saying ‘Use methods and conventions that have been done before as gamers will be used to them and not so intimidated by the game’s mechanics’ and I believe that is the same with controls.

    Interestingly enough, X seems to be becoming a replacement for B as the second most common action button. Or maybe it’s just the games I’m playing. (You should know we didn’t even use the B button in BSG. ^_^) Though I’ve never been a fan of analogue buttons, both in a digital and analogue scenario. Many a time I’ve missed a hit because I didn’t push an analogue button down far enough in a digital scenario (Sony, I’m looking at PS2 games!) or I’ve never been able to control the depth of my press during action games and just did the maximum attack/thrust always. Although analogue buttons work well as a throttle in flight or racing games.

    Triggers and shoulder buttons have always appealed to me as a ‘modifier’ or ‘common, repeated action’ button. They’re most often used for switching between things like weapons, modifying your attack/movement (Assassin’s Creed uses RT for modifying your actions to be high or low profile), or as a trigger for a gun.

    The D-Pad seemed to be left out, and isn’t a stick nor a button. I think it’s become obsolete in light of the analogue stick and is probably just there for backwards compatibility. Most games for the past few years have used it as a selection for some aspect of the game, such as weapons, items or camera modes. It could easily be replaced by say… c Buttons a la N64. I’d like to also add that having the analogue stick for movement and the D-Pad for menu selection is a very dumb idea because I don’t want to keep switching controls every five seconds during a conversation, and yes there are some very modern games (*cough*Final Fantasy 12*cough*) that do it. -_-’

    I’d be interested to hear a comparison of the XBox controller to the Playstation controller since they have different positions of the analogue sticks, no triggers buttons (though I think the PS3 has a pseudo trigger button for the L2/R2 buttons now), and different predominant genres. (FPS games vs. RPGs and platformers)

  4. [...] of tutorials and see how easy it is to get a simple 2D sprite and a 3D model working with full Xbox 360 controller support. My next article will be more focussed on where I think Microsoft should be taking XNA in the [...]

  5. Well written article.

  6. I agree completely that game developers need to build support for the 360 controller into their games. I say as a long time console gamer who doesn’t have a 360 in favor of simply using my windows machine. (after all, they really are about the same) Since i don’t have tons of experience in using the mouse and keyboard combo for games, and have become a firm fan of the rumble used in Microsoft controllers, I WILL NOT game without it. I’ve tried, and it simply isn’t as immersive to me to use the keyboard and mouse combo.

Leave a Reply