Talk:Plan for improved joystick support
The Mad Cacti 09:26, 8 May 2011 (PDT): Re: "A config file proposal"
I'm glad to see config files discussed by someone other than me. I like this idea, except I'm not too fond of joystick_joystickname_gamename. I suggest either having some other way to do subsections, like [section] subsection [[[subsubsection]]]
Which has the benefit of keeping sections continuous, or maybe just [section::subsection::subsubsection], because I might want my underscores! And if you allow space in key names, you can allow them in section names as well.
Anyway, back to joysticks. I don't see the point of associating joystick models with games. I think Jay's approach in this regard is better: map from models to what's he's calling a joystick style, and then map from the style to the game. Except, I don't really see why we need different styles, though I know little about joysticks! Couldn't we just remap the possibly arbitrarily numbered axes and buttons to some standard numbering (eg axes 0,1 is the one for directional movement, 2,3 is the "offhand" one, 4,5 is POV hat 1, the "L1", "R1", "L2", "R3", etc buttons on PS controllers (whatever they're called) are numbered from 10)... which only matters IF the backend has some magical way to determine this information. If it doesn't, it's up to the player to do so. If the backend can determine such things using a little bit of player interaction (e.g. choosing a model in a list), then maybe they could go in the backend, but otherwise things like mapping buttons to keys should definitely go in the engine because it would be common to all backends.
Bob the Hamster 09:54, 9 May 2011 (PDT): For config file sections, I like your suggestion of [section::subsection::subsubsection] much better than my own suggestion.
Game-specific joystick configs really probably is going too far. I only suggested that because xmame (which has very good joystick support) does it... but I don't think I have actually USED that feature before, so it is needless complexity.
Unfortunately we are definitely going to need different joystick configs for different joystick hardware. Joysticks are amazingly nonstandard. All joysticks are made up of a collection of analog inputs, buttons, and hats, but there is no standard whatsoever for how they are arranged. You can't even assume that axis 0 is horizontal and axis 1 is vertical (I have even seen axisless joysticks, that report the directional pad as buttons)
We can probably come up with a pretty decent default style that will probably work on more than half of all joysticks, but configuration is still essential.
The Mad Cacti: I don't think game-specific configuration is going too far at all. There probably is little use to remapping axes for a specific game, but being able to map spare buttons to keyboard keys would be great and I definitely want to see this, though we can put it off until later. Also, we could map a few buttons to Z, X, C by default, since those are used by so many games.
Hieran Del8 8:48, 10 May 2011 (PDT): I like the idea of sections being separated by '::'. That'd be necessary if joystick configuration were managed by the engine, which I agree should be the case. I like the idea of different styles, but I don't like the idea of saving the joystick-to-keyboard bindings to a specific joystick model in a config file. It should probably be a configuration for all joystick styles. Maybe:
[joystick::bindings] Left = -Stick1_X Right = +Stick1_X Down = -Stick1_Y Up = +Stick1_Y Z = ButtonX X = ButtonY C = ButtonA MouseX = Stick2_X MouseY = Stick2_Y etc...
If there was a need to set an override to one of those defaults for a specific game, perhaps a configuration entry:
[joystick::bindings::Wandering Hamster] Q = ButtonB R = ButtonA ...whatever else to add/override to bindings