Author Topic: Joystick hat mapping change (r10933)  (Read 2751 times)

0 Members and 1 Guest are viewing this topic.

Offline niffiwan

  • 211
  • Eluder Class
Joystick hat mapping change (r10933)
Just a quick note that as of SVN revision r10933, the number of valid buttons for a joystick has been raised from 32 to 98.  See mantis 2651 for more details on the type of setup that the limit of 32 can cause a problem with.

Anyway, a side-effect of this change is that the "button numbers" for the joystick hat have changed. If you use a joystick hat then you'll need to remap the hat otherwise it'll stop working.  New pilots won't have this issue, their hat will be set to the normal defaults (i.e. controlling the view).
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Joystick hat mapping change (r10933)
I noticed that Mantis comment, and have two questions:

1) Why couldn't the additional buttons have been added without changing the hat indexes?

2) Could you add a feature that will detect when a pilotfile has only 32 button bindings, and change the hat binding on-the-fly before the pilotfile is re-saved with the 98 bindings?

Because this change affects basically everybody who uses a joystick with four buttons.  The default binding includes the hat, and suddenly people are going to find that their hat binding which previously worked fine has suddenly stopped working without them changing anything.  It not only violates reverse compatibility, it also violates the principle of least astonishment.

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Joystick hat mapping change (r10933)
r10933 doesn't conflict with SDL Everywhere, but it appears that simply bumping up the MAX_BUTTONS would only cause headaches on the pilotfile side of things.

SDL 2.0 splits off the hat input devices from the button array, and naturally so should FSO if more of the SDL features are to be implemented. What this means for the pilotfile side of things is that it'll only have to do one conversion instead of needing to convert to the larger button array before converting to SDL hat mappings.

This means that the whole bit of the controlsconfig code needs something of an overhaul, which is a part of what I'm looking into with my multiple joysticks support branch. And yes, I do need to hurry up.  :banghead:
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Joystick hat mapping change (r10933)
In addition to and expanding on what z64555 said:

1) Why couldn't the additional buttons have been added without changing the hat indexes?

There's a number of assumptions made about the hat buttons being at the end of the normal buttons. It may be possible to untangle it all, but I think it'd be finicky, easy to miss something and probably all replaced anyway once SDL everywhere arrives.

2) Could you add a feature that will detect when a pilotfile has only 32 button bindings, and change the hat binding on-the-fly before the pilotfile is re-saved with the 98 bindings?

That would be possible, but z64555 alluded to this would mean extra conversion code in addition to the one that'll probably be needed for SDL everywhere and/or the multiple joysticks revamp post SDL everywhere. I'd rather not carry that baggage forward forever where the benefit period would be short, and the number of people receiving the benefit would be low (i.e. those with 32+ buttons and *not* using virtual joystick software).

Because this change affects basically everybody who uses a joystick with four buttons.  The default binding includes the hat, and suddenly people are going to find that their hat binding which previously worked fine has suddenly stopped working without them changing anything.  It not only violates reverse compatibility, it also violates the principle of least astonishment.

I was originally of the opinion that it was a trivial expectation to remap the hat, but you raise some good points.  Therefore (and I discussed this in more detail with z64555 on IRC today) I'd prefer at this stage to revert r10933, close the mantis ticket and leave increasing the max joystick buttons to be done post SDL everywhere when multiple joystick support is added.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Joystick hat mapping change (r10933)
I was originally of the opinion that it was a trivial expectation to remap the hat, but you raise some good points.  Therefore (and I discussed this in more detail with z64555 on IRC today) I'd prefer at this stage to revert r10933, close the mantis ticket and leave increasing the max joystick buttons to be done post SDL everywhere when multiple joystick support is added.

This sounds like a good plan.

 

Offline Macfie

  • 210
  • If somebody made a campaign I've probably got it
Re: Joystick hat mapping change (r10933)
Since this is in the current nightly what happens if you remap and then the change is reverted?  Will this require remapping again?
Normal people believe that if it isn't broke, don't fix it. Engineers believe that if it isn't broke, it doesn't have enough features yet.
The difference between Mechanical Engineers and Civil Engineers is:
Mechanical Engineers build weapons.  Civil Engineers build targets
An optimist sees the glass half full; the pessimist sees it half empty. An engineer sees that the glass is twice as big as it needs to be.

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Joystick hat mapping change (r10933)
Umm... it may cause a crash with the respective pilot since it may try to index beyond the size of the controls-config array - I'll put a note on that nightly to not use it.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Joystick hat mapping change (r10933)
I removed the threads so that nobody accidentally downloads them.