{"id":85,"date":"2007-11-30T14:26:19","date_gmt":"2007-11-30T04:26:19","guid":{"rendered":"http:\/\/www.doolwind.com\/blog\/?p=85"},"modified":"2007-11-30T14:26:19","modified_gmt":"2007-11-30T04:26:19","slug":"making-games-for-the-xbox-360-controller","status":"publish","type":"post","link":"https:\/\/www.doolwind.com\/blog\/making-games-for-the-xbox-360-controller\/","title":{"rendered":"Making Games For The Xbox 360 Controller"},"content":{"rendered":"<p align=\"left\"><a href=\"http:\/\/www.doolwind.com\/images\/blog\/xbox360controller.jpg\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" align=\"right\" width=\"170\" src=\"http:\/\/www.doolwind.com\/images\/blog\/xbox360controller.jpg\" height=\"120\" \/><\/a>I thought I&#8217;d give a little insight into the things I learned about making a game for the Xbox 360 controller.\u00a0 I&#8217;m a big fan of the controller&#8217;s feel and ease in developing for it.\u00a0 The added bonus is that the wired controller can plug straight into the PC meaning there&#8217;s even more coverage for it.\u00a0 I won&#8217;t go into details of Xinput but instead give more general advice.\u00a0 I&#8217;ll also share a little knowledge that an ex-Microsoft colleague taught me about its use.<\/p>\n<p><strong>Go with what you know<\/strong><\/p>\n<p align=\"justify\">Before you do any planning for the layout of your controls, sit down in front of an Xbox and play a bunch of games.\u00a0 Focus particularly on games from the same genre as yours and take notes about what works and what doesn&#8217;t.<\/p>\n<p>Playing other games should give you a general idea of what basic controls you want.\u00a0 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?\u00a0 The biggest advantage with doing this is that people are already playing the games you&#8217;ll be trying out.\u00a0 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.\u00a0<\/p>\n<p>Don&#8217;t let this rule out a completely new control layout if that&#8217;s what your game really needs, but I&#8217;d say 95% of games should really be sticking with what people know to reduce the barrier of entry.\u00a0 As soon as you have to teach the player something they&#8217;ve never done before you&#8217;re going to lose a large chunk of your market to people that will just switch off.\u00a0 If you really do want to make something completely new then I&#8217;d recommend spending a LOT of time on the tutorial to make sure all gamers will want to sit through it<\/p>\n<p align=\"justify\"><strong>Make the most of the controls<\/strong><\/p>\n<p align=\"justify\">There are three basic types of inputs on the 360 controller (as with most joy pads).\u00a0 They are listed below with what they should and shouldn&#8217;t be used for.<\/p>\n<p align=\"justify\">1.\u00a0 Stick<br \/>\nMap really well (and intuitively) to player movement and looking.\u00a0 It should be fairly obvious where these should be used.<\/p>\n<p align=\"justify\">2.\u00a0 Trigger<br \/>\nTriggers allow analog input (ranging from 0 to 1, or equivalent).\u00a0 You should be trying to use them as such.\u00a0 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 &#8220;press a button&#8221;.\u00a0 Triggers are designed to allow a range of input, and so players need to move the fingers a long way before they become &#8220;on&#8221;.\u00a0 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 &#8220;press&#8221;.\u00a0 Depending on its use you can make any movement at all count, or a % of the way down.<\/p>\n<p align=\"justify\">3.\u00a0 Button<br \/>\nThere are a lot of these.\u00a0 Buttons are great at one thing, being on or off.\u00a0 Steer clear of using them for something that really should have analog input.\u00a0 An example is the accelerator of a car.\u00a0 Unless you&#8217;re making a really simple driving game then having the accelerator either on or off just doesn&#8217;t give enough control.<\/p>\n<p align=\"justify\">Also some general rules.\u00a0 The A and B buttons are where player\u2019s fingers generally sit while they are in the neutral position.\u00a0 For this reason you should map your most used control to A, follow by B.\u00a0 Another thing to note is which combination of keys can&#8217;t be pressed together easily.\u00a0 A and Y are really hard to press down at once without pressing X or B by mistake.\u00a0 Likewise X and B are difficult.\u00a0 Try and keep these buttons mutually exclusive in gameplay.<\/p>\n<p align=\"justify\"><strong>Experiment &#8211; change is difficult<\/strong><\/p>\n<p align=\"justify\">Once you&#8217;ve got your configuration sorted and everyone has been playing with it for a few months it&#8217;s REALLY difficult to objectively compare the control scheme to a new one.\u00a0 No matter how good the new control layout is it will feel unnatural and you&#8217;ll hate it.\u00a0 The best way to stop this is to experiment as much as possible early on before you get accustomed to the controls.\u00a0 Get lots of people to test the game using all the different input styles and see which people prefer before one becomes the standard.<\/p>\n<p align=\"justify\">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.\u00a0 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&#8217;ll get used to it.\u00a0 Be wary of this as there will be a &#8220;point of no return&#8221; 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.<\/p>\n<p align=\"justify\"><strong>Don&#8217;t always stick with the basics<\/strong><\/p>\n<p align=\"justify\">The right stick when used for looking around (primarily in FPS games) is a powerful weapon.\u00a0 While it seems like a linear mapping of stick position to angular velocity (how fast the camera turns) might be enough, you&#8217;d be surprised how much nicer a game can feel when there&#8217;s a lot more happening under the hood.\u00a0 This goes against my general rule of &#8220;less is more&#8221; and I believe there&#8217;s a real art to getting the &#8220;stick look&#8221; right in games.\u00a0 An ex-Microsoft colleague once told me about the amount of work that goes on under the hood in Halo.\u00a0 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.\u00a0 If players whip the stick to the side it generally means they want to turn really quickly.\u00a0 Similar to the old wrist flick of the track ball mice to turn your character really quickly.\u00a0 Also, when the player&#8217;s crosshair is over an enemy then you should slightly slow down the angular velocity a bit to make it easier with tracking.<\/p>\n<p>This takes a lot of tuning and should be viewed in a similar way to makeup.\u00a0 It should make the controls better, without you knowing it&#8217;s even there (for those that don\u2019t know about makeup, I\u2019m just saying make it subtle).<\/p>\n<p align=\"justify\"><strong>Comparing circles to squares<\/strong><\/p>\n<p align=\"justify\">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).\u00a0 The 360 controller\u2019s stick can move in a circle.\u00a0 Depending on your style of game, you may want the stick to act as if it can move in a square.\u00a0 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).\u00a0 On a square this is easy as the top left and right corners map perfectly to this.\u00a0 For a circle though you&#8217;ll need to write some code to do the mapping for you.\u00a0 This is again more complexity under the hood, but you&#8217;d be surprised that it feels completely natural to the player and they won&#8217;t even notice what&#8217;s happening.<\/p>\n<p align=\"justify\"><strong>Conclusion<\/strong><\/p>\n<p align=\"justify\">So there are some general rules of use.\u00a0 Do you have any other rules I missed?\u00a0 I&#8217;m really pleased with how Microsoft made the 360 controller both from an API perspective as well as its construction.\u00a0 I&#8217;d highly recommend anyone making a PC game to look into adding support for the 360 controller as I&#8217;d like to see them become the joy pad of choice for PC gamers.<\/p>\n<p align=\"justify\">&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I thought I&#8217;d give a little insight into the things I learned about making a game for the Xbox 360 controller.\u00a0 I&#8217;m a big fan of the controller&#8217;s feel and ease in developing for it.\u00a0 The added bonus is that the wired controller can plug straight into the PC meaning there&#8217;s even more coverage for <a class=\"more-link\" href=\"https:\/\/www.doolwind.com\/blog\/making-games-for-the-xbox-360-controller\/\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[33],"tags":[82],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-game-development","tag-xbox-360"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgEc5-1n","_links":{"self":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":0,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}