FAQ  •  Register  •  Login

Wrongly recognized generic gamepad buttons

Forum rules
This forum is for technical discussion only. If you are interested in gameplay or client-side issues, please post in Bitfighter Features.
<<

Wuzzy

User avatar

Posts: 14

Joined: Sun Nov 04, 2012 10:46 am

Post Sun Nov 04, 2012 11:10 am

Wrongly recognized generic gamepad buttons

Hi!
This is a bugreport for version 017b.

I have the gamepad "Firestorm Dual Analog 3" from ThrustMaster, Inc. It is an USB gamepad, it has 12 buttons, one D-Pad and two analog sticks.
The buttons aren't labeled, but with the tool jstest (found in the rather old inpututils package) I were able to get the button numbers. They range from 0 to 11. Also, Bitfighter shows button numbers. The problem is, Bitfighter shows incorrect button numbers some buttons when I try to configure them. Of course, I used "generic joystick" for the button configuration.

jstest → Bitfighter
0 → 0
1 → 1
2 → 2
3 → 3
4 → 4
5 → 5
6 → does not change display
7 → 10
8 → 6
9 → blank
10 → blank
11 → 7

I also have a Microsoft SideWinder GamePad Pro. It has 9 buttons (but strangely jstest reports a 10th button. Whatever). Here is the button list:
jstest → Bitfighter
0 → 0
1 → 1
2 → 2
3 → 3
4 → 4
5 → 5
6 → does not change display
7 → 10
8 → 6

So, from 0 to 5, everything is correct, but from 6 to 11 everything is wrong. If I press button 6, the button/key shown is always the button/key which was there previously. Even if there was a [L] (or any other key or button) and you press button 6, in the GUI it still remembers the [L]. If you press button 9 or 10, the GUI shows just an empty circle.
The behaviour for buttons 0-8 is exactly the same for both gamepads.

Also note that this bug only affects the display of the buttons. The actual button mapping itself is correct. If I press any button, Bitfighter remembers it correctly. But Bitfighter fails to show the correct button number.
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Sun Nov 04, 2012 4:30 pm

Re: Wrongly recognized generic gamepad buttons

Hi Wuzzy. Welcome to Bitfighter!

For your joystick problems, there is a file installed with the game called 'joystick_presets.ini'.

You can add a new section in there for your joystick and alter all the button mappings to suit your needs.

Please see the intructions at the top of the file as well as how the other joysticks are set up.

If you find a good setting that you like for your joystick, we can include it in the game permanently.

Also feel free to come back and ask more questions.

Welcome again!
<<

Wuzzy

User avatar

Posts: 14

Joined: Sun Nov 04, 2012 10:46 am

Post Mon Nov 05, 2012 11:32 am

Re: Wrongly recognized generic gamepad buttons

Okay, I have done what you told me. I now have a pretty neat gamepad configuration, thanks!

But this was not the actual point. I do not see how this fixes the issue that the wrong button numbers in the generic joystick configuration. You completely ignored that the behaviour of the generic joypad configuration seems buggy to me.
The generic joystick config is a fallback option for those who have a gamepad which does not fit into all other categories, right? As there are so many different gamepads and joysticks out there, there are certainly a lot people with such a gamepad. In this case, it is easier to just make a quick and dirty configuration without having to edit config files. (It is not that editing these is difficult, but it literally took my hours to create a configuration to fit my needs.)
As I already said, the GUI does not show the correct raw button numbers. Almost all games simply show the raw button number in the GUI, because it is easy. And all these games show the raw button numbers correctly, only Bitfighter does not show these numbers correctly. I think the generic gamepad/joystick configuration must show these raw button numbers correctly, not just sometimes correctly. Otherwise, this would defeat the whole purpose of the generic joystick configuration, right? ;-)
Although I have now my own personal configuration for my gamepad, this does indeed not fix the bug. The bug is about the generic gamepad config, not about a specialized gamepad config. The suggestion you gave me just does make me blind for the bug. As long I stick to this ThrustMaster gamepad, I am fine and will not have to deal with this bug. But if I plug in a new gamepad, I have to fallback to the generic config again, and then I will experience the bug again. Then I have to write another configuration for this gamepad first etc. etc. This is just a workaround, not a bugfix!

Now I guess the reason why the game ignores the input of button 6 is completely ignored that button 6 is in fact the default "back/abort" button, right? I did not know that before, also the GUI does not make any hint that button 6 means "abort" in the key configuration itself, too.
Still unresolved is the strange behaviour for the buttons 7-11 (wrong number or even no number at all). As long as nobody has a better explanation for me why these buttons are wrongly numbered in the generic joystick mode, I stick to my theory that this is thanks a bug.

About my configurations: They fit my personal needs, but I do not think they make sense for others to use. I have to clean some things up and make some generalizations before I can publish a configuration for the Firestorm Dual Analog 3. Just one question beforehand: As all buttons aren't labeled: Should I start numbering them from 0 or from 1? (buttons 0, 1, 2, 3, … or buttons 1, 2, 3, 4 ...?)

The SideWinder Gamepad Pro is not suitable for the game, it has only one analog pad and I haven't figured out a way to play the game with only one analog pad. Oh, and it sucks. Therefore I won't publish a configuration for this gamepad.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Mon Nov 05, 2012 3:34 pm

Re: Wrongly recognized generic gamepad buttons

There's a lot to absorb there...

Start by entering the diagnostics screen (F7). What would be most helpful for me at the moment is if you listed (clearly) which button(s) you are pressing and what the diagnostics screen shows when you press them. I am pretty sure that screen shows the correct thing for other joysticks. Let's figure out how to make it show the right thing for yours.

Others may have other questions, but I think if we take things a step at a time we'll all be much saner at the end.

PS You may have already posted this info; please be patient with us, as there is a lot going on.
<<

Wuzzy

User avatar

Posts: 14

Joined: Sun Nov 04, 2012 10:46 am

Post Tue Nov 06, 2012 7:59 am

Re: Wrongly recognized generic gamepad buttons

What? There is a freaking diagnostics screen? Oh man, if I knew that earlier, I would have supplied you with this information from this screen instead.

This diagnostics screen is highly interesting.
I tested both gamepads using only the "Generic Joystick" profile.

First test
Here are the results of Firestorm Dual Analog 3:
D-Pad and both analog sticks are working properly.

Right to it, there are these circles on the screen.
As this gamepad has 12 buttons, I would have expected that these numbers appear on the screen:
0 1 2 3 4 5 6 7 8 9 10 11
Here are the numbers of the buttons as they appear on the screen:
0 1 2 3 4 5 6 7 9 10 blank blank

With blank I mean there is a circle but without a number in it.

Here is the same information again, but in some sort of list:
expected button → shown button
0 → 0
1 → 1
2 → 2
3 → 3
4 → 4
5 → 5
6 → 6
7 → 7
8 → 9
9 → 10
10 → blank
11 → blank


Every button press is recognized correctly as one of the circles flashes red when I press a button. Interesting: The position of the circle which gets red is exactly on the position where I'd expected the correct button number.
Interesting, too: The number after "Raw Controller Input" is always the number I would have expected.

The exact gamepad string is: "Mega World Thrustmaster dual analog 3.2" (I don't know why they picked this strange name; the gamepad is marketed as "Firestorm Dual Analog 3" and is produced by "ThrustMaster Inc.". I don't know what they mean with "Mega World".)

Second test
After that, I quit Bitfighter and plugged in my SideWinder Game Pad Pro and restarted the test. You can't use this gamepad for gameplay anyways, but it should be suitable for testing. ;-)
The detection string is: "Microsoft SideWinder Game Pad Pro USB version 1.0"
D-Pad: does not exist
L Stick: works (actually, it is a analog pad, but whatever!)
R Stick: does not exist

It has only 9 buttons but jstest sees 10 buttons. Therefore Bitfighter is likely to "think" that this is a 10 button gamepad. Silly Microsoft. ;-)

expected button → shown button → nth circle which flashes*
0, 0, 0
1, 1, 1
2, 2, 2
3, 3, 3
4, 4, 4
5, 5, 6
6, 6, 5
7, 7, 7
8, 9, 8
X, 10, X
X, blank, X
X, blank, X

Now this needs a bit explantation: The first two columns have the same meaning as in the Firestorm Dual Analog 3 case. The 3rd column is the position of the circle which flashes when I press the button with the raw ID shown in the first ID. 0,0,0.
"X" in the "expected" column means here that this button does not physically exist. I would have expected that the GUI simply does not show anything at all on this position, not even a blank circle. Plase note that a button 9 is reported by jstest, although only buttons 0-8 physically exist; jstest does not report a button 10 or 11. "X" in the "nth circle" column means that it does never flash (no surprise here).
Now here is something very interesting: If I press button 5, button 6 flashes. If I press button 6, button 5 flashes. This is an even stranger behaviour. :shock:
What we also see here is that the buttons shown in the GUI are the same fucking buttons as in the Firestorm Dual Analog 3. 0, 1, 2, 3, 4, 5, 6, 7, 9, 10, and two blank circles. Well

The text after "Raw Controller Input" is again always the expected button ID.

Technical informaton
And here are some information shown in the diagnostics screen that may be of interest for you:
M/C: 5
C/S: 35
build: 4537/017b
CPU: good old x86
OS: Linux (version 3.5.0)
compiler: gcc (version 4.7.2)

FYI, I used the package supplied by https://aur.archlinux.org/packages/bitfighter/. Yup, I am an Arch Linux nerd.

Edit:
From now on, I will hang around as long as possible on irc://irc.freenode.org/#bitfighter. This issue seems to bit complicated. Talk to me there if you have more questions. My name there is Wuzzy. (Obviously.)
<<

Fordcars

User avatar

Posts: 1016

Joined: Fri Apr 20, 2012 3:51 pm

Location: Some city, somewhere

Post Wed Nov 07, 2012 3:31 pm

Re: Wrongly recognized generic gamepad buttons

If you want, you can press ctr-q to grab a screenshot of Bitfighter to show this information.
skybax: Why is this health pack following me?
bobdaduck: uh, it likes you.
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Wed Nov 07, 2012 3:42 pm

Re: Wrongly recognized generic gamepad buttons

We talked this over with Wuzzy in IRC.

The issue is that there is NO button numbering standard for joystick/controller communication between it and the computer. This means that *every* game has to keep a special profile for your controller, or try to make an educated guess at the button mappings.

We didn't have his profile in Bitfighter and our guess was wrong. The solution is to add his controller profile - which he just posted here (thanks!):

viewtopic.php?f=4&t=1608
<<

Fordcars

User avatar

Posts: 1016

Joined: Fri Apr 20, 2012 3:51 pm

Location: Some city, somewhere

Post Wed Nov 07, 2012 8:15 pm

Re: Wrongly recognized generic gamepad buttons

Ahhhh
skybax: Why is this health pack following me?
bobdaduck: uh, it likes you.

Return to Technical Discussion

Who is online

Users browsing this forum: No registered users and 5 guests