I’m sort of curious who uses or has tried to use gamepads with JME.
I’ve been playing a lot of console games recently so I got it in my head to try to map a gamepad to JME. For third person action games, this seems like a nice control scheme for people who have gamepads (ie: every xbox owner I guess).
Because I don’t tend to do things halfway, I bought a few cheap gamepads (and will have a few more coming on Wednesday) so that I could test. I found it nearly impossible to come up with a default control scheme that worked on more than one of these at a time with the information that JME currently provides. (In fact there is a “bug” in JoystickInput that prevents one of them from working at all for the second analog stick.)
I figure I can’t be the first person to have hit this… so I started wondering if anyone else has even tried it.
I hope to enhance the JME Joystick classes to provide more information about the joystick axes so that it is easier to find a good default mapping and to fix any bugs I find along the way. I’ll also try to update flycam, etc. to take advantage of a gamepad’s dual sticks when detected. (The default joystick mapping for this is pretty lame on a gamepad.)
If there is interest then that also means there are potential testers.
I’m not a regular gamepad user myself, but I can test with the one I got here (when there is something to test).
Good initiative!
Why don’t you create a test case with buttons which light up when the corresponding button is pressed? That way I guess it’d be very easy for us to test and post results.
I don’t have a gamepad yet, but maybe I want to buy one.
Android 4.x has build-in support for gamepads ( http://hub.jmonkeyengine.org/gsoc-2012/ideas/android-integration-improvements/ ). Maybe it’s a good idea to look at this too.
Afaik @ceiphren has the same problem with Pirate Hell The default mapping is completely upside down with my PS3 controller on mac
Seems theres no standard for the axis direction configuration…
@memonick said:
Why don't you create a test case with buttons which light up when the corresponding button is pressed? That way I guess it'd be very easy for us to test and post results.
Heheh... frankly I'm almost insulted by this. ;)
The issue isn't detecting which button is pressed but figuring out which of the 5 or 6 axes one should assign to which type of motion.
And of course I'll add a test app. What else would you guys be testing?
@pspeed: This is also an heavy issue for me as the controls of pirateHell are optimized for gamepads. I tried 3 different pads and everyone react different. I also saw this problem in Devil May Cry 4 for PC. Different Pads, different Inputs. So it seems there’s no other way than keeping the control configurable.
@normen said:
Afaik @ceiphren has the same problem with Pirate Hell :/ The default mapping is completely upside down with my PS3 controller on mac :( Seems theres no standard for the axis direction configuration..
Yeah, I don't know if I'll be able to detect reverse axes but hopefully we'll at least get the two stick mapping right. Inversion of axes is an option third person games should already support for camera, I guess.
It's really a shame that the input API we use provides no hardware information about the USB device... because at least I know that PS3 controllers actually show up as PS3 controllers in the windows game controller screen. This information seems to be unavailable to the API, though.
When I have enough tests, I'm hoping that certain "signatures" can be guessed by the order and name of the axes but my sample size is small so far.
@ceiphren said:
@pspeed: This is also an heavy issue for me as the controls of pirateHell are optimized for gamepads. I tried 3 different pads and everyone react different. I also saw this problem in Devil May Cry 4 for PC. Different Pads, different Inputs. So it seems there's no other way than keeping the control configurable.
This will always be true... but I think we can do better defaults. After all, somehow the windows joystick calibration seems to find the right axes.
I'm willing to put some effort here and also invest in some gamepads... I've got three more arriving on Wednesday. So hopefully between my small gamepad sample and the rest of the community we can nail down some defaults that work in most cases.
@pspeed said:
Heheh... frankly I'm almost insulted by this. ;)
The issue isn't detecting which button is pressed but figuring out which of the 5 or 6 axes one should assign to which type of motion.
And of course I'll add a test app. What else would you guys be testing?
Sorry, misunderstood what you meant ^^
I guess you could probably do a “gamepad detected” type screen - and have them press up, right, etc and work out the axis from that?
You can then remember them for that device to avoid asking every time. (With a way to change the settings if they got it wrong of course).
@pspeed: I’ve got a xbox360, a Saitek P3200 and a Logitech F310. If I can help you just tell me what to do.
@pspeed said:
When I have enough tests, I'm hoping that certain "signatures" can be guessed by the order and name of the axes but my sample size is small so far.
Hmm.. Wasn't there some id number like a manufacturer id or something? Guess that might be something to look for, maybe theres even some lists already.
@ceiphren said:
@pspeed: I've got a xbox360, a Saitek P3200 and a Logitech F310. If I can help you just tell me what to do.
Yeeha... our sample size grows all the time. The more expensive gamepads were going to be the ones I'd have problems testing. :) Looks like you have some decent ones.
I so far have not been able to get my ps3 sixaxis working at all.
@normen said:
Hmm.. Wasn't there some id number like a manufacturer id or something? Guess that might be something to look for, maybe theres even some lists already.
The USB device will have some identifying information. This is not exposed through the API that JME is using.
...but so far the names and orders of the axis and the number of buttons they report seem to vary somewhat. I'm hoping maybe there is a pattern there or something.
For what it's worth, my test app will be a modified version of the test joystick app that will display all of the joystick info on the screen and values as you move the stuff around or something. I will also try to detect a game pad and provide indicators on how the game pad thinks it will be working with the default mapping.
...bonus points if someone has a free and small gamepad model with moveable joysticks or something. Otherwise I will just report it with text.
I’ll see if I can have some updates to test by Wednesday night. I’ll try doing some of the work tonight but I want to wait until my other gamepads come before I push anything out.
@memonick said:
Why don't you create a test case with buttons which light up when the corresponding button is pressed? That way I guess it'd be very easy for us to test and post results.
Priceless!!! I've been wanting to say that for a long time... hahahahahaahahaha
I think this as a great idea @pspeed , i was hoping someone would get to this
i have attempted to use 2 different joysticks (Logitech Dual Action + xbox360 gamepad clone) with jme3 and my input is this:
i notice there is always 1 more axis reported by getAxisCount() than i am actually able to map.
also, i havnt noticed the method Joystick.rumble() or JoyInput.setJoyRumble() working on the vibrate motors of my cheap xbox360 clone gamepad. of course it was used, so it might just be that vibration doesnt work anymore.
http://hub.jmonkeyengine.org/groups/general-2/forum/topic/question-about-joystick-rumblefloat-amount/
Here is a link to my post, its a bit more in-depth.
EDIT: removed obsolete test case