Fix joystick and gamepad library before jME 3.1 stable?

Ehm, sorry for the confusion. I meant “XInput or DirectInput per each device”.

To clarify: the one biggest problem is that the up/down axis of a thumb trigger isn’t seen by the test Joystick application. Then there are the wrong mappings, but these can be solved with a configuration file.

How do you manage that if player pushes both triggers? Plus and Minus sum up to zero. How can I detect that either both are being pressed or none is pressed?

Yes, you can see what is meant by left and right when looking at a disected gamepad (google images for “xbox gamepad disected”) - one motor is in the left grip the other in the right grip.

The term “soft” and “hard” might be related to the frequencies (one “bass motor” and one “high frequency motor”). I still need to do research to understand all this.
Btw if that could be confirmed, it’s yet another argument for the need to set each rumbler to a different value, independent from the other rumblers.

Edit: It’s better “xbox gamepad disassembed” or “xbox gamepad dismantled” - sorry for using the wrong word. You will find some useful pictures with any of those keywords.

Ehm … don’t use the “XInput” switch! :chimpanzee_closedlaugh:
Or wait until XInput is supported by jME (or bypass jME somehow by using zzuegg’s code).
Until then the hardware switch for XInput on your gamepad is useless with jME.
It’s a strange side effect that it works at all.

I’d like to avoid to say that to my customers :wink:
The point is that’s not really “my” problem… is the problem of every jme developer who wants to support gamepads. Logitech says that my controller on Windows works best with “Xinput” selected, so I do exactly that. Then a random developer tell me “dude, Logitech is wrong don’t trust them LOL”. :smiley:

By selecting XInput, I’m basically emulating an xbox360 controller, in that I’m having the same issues I would have if I were using an xbox360 controller?

If your customers use the current version of jME and the same gamepad like you… …then that would be the current solution.

Maybe you can ask zzuegg for his code and write a custom joystick implementation. That’s what I would try to do. At least for gamepads that are intended for XInput. But then you will have to write code that ignores DirectInput for this XInput joystick. And it would not fit natively in jME, but bypasses jME, which only has DirectInput as of now.

Also note that each other gamepad is mapped strangely (I tested 10 different gamepads and none looked correct). So the joystick-mapping.properties file should be full of entries (the mentioned database that will probably stay a dream for ever).

But yeah, I now see that we should fix the support for the XBox 360 gamepad since that’s probably the one gamepad that almost all users will have (at least those with a wish for quality and a big wallet). Also (even though someone may now scream “heresy!”) most users will have Windows - at least for steam (if they ever let your pink princess fly on steam - which I sincerely hope :chimpanzee_smile: ).

I could do this with all the cheap gamepads that I have. The XBox360 device is already in, so don’t need to create mapping for that one.

The problem is that this solution is not a real solution, because there might be hundreds of different gamepads out there - some with crazy features and mysterious buttons and switches. That’s why I say “but it will stay a dream, I guess.” - because there is no real concept to solve this. There might be people who make money by addressing this misery (commercial DirectInput gaming device databases). We could start an open source platform. I don’t know… :chimpanzee_sad:

Yes, in the end you can’t get around having a control configuration in your game. That’s just a given.

The goal is to handle most of the configurations we can automatically. Of the eight or so joysticks that I bought, only two required remapping to be like the others.

Yeah, many things are similar. I’m already happy that the DPAD cross / Coolie Hat switch is always the same (gamepad, joystick, steering wheel - all of them had the same 8-way thingy on them and always worked the same. Also the slider for forward / backward on all joysticks was the same.

I did not forget your arguments from our discussion two years ago and during the last few weeks I often thought about starting to implement a Lemur-based input config. I thought about how to actually design that process and made some sketches (already some months ago).

The control configuration is important for other reasons too: I’ve seen very cool input configurations in a project that I worked on, but a slightly disabled person told me that he could not play the game because one of his hands had some missing fingers - other (not so cool) configurations worked for this unlucky guy.

I also start a config/setup control few month ago, as part of jme3_skel. The first step was to be able to identify input and to store them as “template”, so the default behavior of the game is to display input (mouse, keyboard, gamepad).

Today I suspend dev on it so capture in the settings page is not done.

As a side note joystick-mapping.properties is not cross-platform. the settings for Windows are not the same as for Linux (same gamepad, in my game xbox 360 wired).

2 Likes

Oh nooo :chimpanzee_sad: that’s bad.

But your project skeleton looks interesting. Maybe I can learn something from that github project. :chimpanzee_smile:

Well, then we will need to tell our users that they can use their savegames with both Linux and Windows but need to reconfigure their DirectInput mapping for each platform separately.
That’s really uncool. I hope it doesn’t affect different OS versions too…

Yeah, I have some design notes also. InputMapper was designed with this sort of thing in mind.

I had (recently passed away) an uncle who only had one arm… so I was always looking for ways to let him play my games anyway. Mythruna was a real chore for him.

2 Likes

That’s really nice of you! I struggle around with one arm, too. So I’m always happy if there is a way to reconfiger the controls! It hasn’t to be ingame, config-files are good enough, but somehow it has to be done.

So there is no way around this? I really should set the dip switch to “DirectInput”?

xbox360 controllers don’t have this issue?

This is probably just one of a 100 things you will have to tell your users to do to work around something in your game on a particular platform. Flipping a switch is not so tough in the scheme of things.

I think I already wrote it, but I can write it a second time :chimpanzee_closedlaugh:

XBox gamepads are a little problem at the moment. Tested this with jME 3.0 and others have posted that this is official - XBox gamepad would work best with XInput (which is currently unsupported by official jME release). I hope that we can fix this for jME 3.1 (Alpha 2 or Stable version).

@zzuegg has made some very smart comments and wrote a first XInput implementation. But the jME team will need to properly integrate this into the engine - until then it’s only a hack (one problem: every XInput device will also be recognized by DirectInput and if we are lucky both APIs report the same name for the device + other problems might follow). You could use that hack, if zzuegg makes his XInput code available for us. You might need to tell your users that they have to select the right API for their device manually or you let your game detect XBox gamepad by name (like @pspeed said) - the right name shows up in the TestJoystick app (but you need to install the drivers for most gamepads, else the name is not correct in many cases).

Please don’t let me write this a third time… :chimpanzee_closedlaugh:

1 Like

OK, the little problem is missing axis like I experienced on another Xinput device or there is something else? Just for completeness…

and…

:chimpanzee_smile:

1 Like