Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Right now I'm working on input for my game.

The only controller I own is an XBOX 360 one.

From what I can see, if a controller's stick has a Z axis, these are actually triggers.

Essentially I'm wondering if from one controller to the next, will this be consistent?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Joysticks and alternative input devices tend to vary wildly in how they expose their inputs through to the drivers, so it isn't always the case that an analog Z axis will correspond to triggers (for example, if the controller's triggers don't have analog input values, they may just be additional buttons).

The API you use to access the joysticks may do some of the work for you and attempt to homogenize the data from the controller, but this depends heavily on the API and isn't always done properly, unfortunately.

It sounds like you're on a Windows platform. XInput only supports Xbox-like controllers, the "next best thing" is probably DirectInput, even though it's a bit long in the tooth and COM-like.

share|improve this answer
    
I would add that a technical reason to use XInput for 360 controllers is that DirectInput does not properly support the 360 pad's triggers (source) –  NoobsArePeople2 Apr 25 at 16:22

As a practical matter, under Windows and Mac operating systems, different gamepads expose their controls via vastly different mechanisms.

About the only thing you can count on is that if there are multiple analog sticks, the left one will be number zero, and that digital buttons 0 and 1 will be face buttons accessed by the right thumb.

Everything else seems to vary from manufacturer to manufacturer, and even device to device. This is one major reason why computer games absolutely must have a "controller configuration" feature, which allows users to map their gamepad's buttons and analog stick axes to in-game functionality. There's currently no other way to make games work properly for all players with all gamepads.

share|improve this answer

There's virtually no standardisation at all. Even if you just take the default controller for each platform they all map controls differently and the expected behaviour differs (eg. which of the buttons is meant to go back, which is to confirm, etc). And even if there was something common across all the controllers, what about the other controls - users may wish to use them, especially if they chose that controller especially for the extras.

At a minimum you need to test with the main individual controllers you wish to support. Ideally you need to be able to remap any button, trigger, or axis to any appropriate in-game action, then ship with defaults for common controllers and let players configure controllers to their satisfaction.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.