Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  How to determine gamepad/joystick components mapping?  (Read 1004 times)
0 Members and 1 Guest are viewing this topic.
Offline Ramaloke

Junior Newbie


Exp: 4 years



« Posted 2014-06-23 11:51:12 »

I have an app that monitors user gamepad/joystick experience. And as I'm new to such stuff I ran at some issues and hope you'll advice me something.

I have two gamepads: XBox 360 Wireless for PC and SEGA Mega Drive Joystick (it's how it is identified by OS). The first one has 16 components the second one has only 12 components.  And if XBox's [12]'s component is Start, Sega joystick's Start component is [5]. A friend of mine has Logitech gamepad and PS3 gamepad, and I'm not sure what buttons mapping do they have. So I decided to implement several gamepad classes with specific mappings (one for XBox, another one for Sega, next one for Logitech gamepad), but what if some other gamepad will be used with this app? For example, Buffalo SNES USB gamepad.

Is there any solution on how to resolve such situation when you don't know what mappings has that or another gamepad?

Another idea is to suggest user to set buttons minimum himself. But I didn't find anything that is connected with components remapping in API. Is there any way to do this?
Offline Herjan
« Reply #1 - Posted 2014-06-23 12:12:02 »

There is no solution for this, you need to implement gamepad classes for all different gamepads with specific mappings. But lucky you, most gamepads are quite similar (most USB-controllers have the same buttons (and id's)).

Maybe, if you're lucky, someone already tested all types of gamepads and has posted all their buttons with its id's for you on the internet.

Offline Ramaloke

Junior Newbie


Exp: 4 years



« Reply #2 - Posted 2014-06-23 12:37:27 »

Is it possible to change mapping in the following way:
- I ask to press button A
- User presses a button (not necessary button A)
- I determine somehow (?) what component (from the components list) was pressed and save mapping to it: component pressed -> A

In such a way it could be a solution, I think.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Herjan
« Reply #3 - Posted 2014-06-23 14:38:58 »

I have never seen it and I would not recommend it...
Games that ask you to press the start-button (to start) do not do this to recognize your gamepad, (have you tried to press another button, it (probably) won't work).

You can check what kind of controller it is and then give it a mapping. You can also let the user customize his buttons. If you have given the user the wrong mapping or whatsoever, you can navigate him to the page where he can customize his buttons, you can do that automatically if the user hasn't responded for one minute in the start-screen, for example.

Also, to the n00bs but also the experts, check this feature out (I probably should add this link in my signature or whatever):
http://www.java-gaming.org/topics/new-feature-appreciation-results-in-post-medals/24011/view.html Roll Eyes

Offline Ramaloke

Junior Newbie


Exp: 4 years



« Reply #4 - Posted 2014-06-23 14:55:57 »

You can also let the user customize his buttons. If you have given the user the wrong mapping or whatsoever, you can navigate him to the page where he can customize his buttons, you can do that automatically if the user hasn't responded for one minute in the start-screen, for example.

Mmm, so the buttons can be customized? I mean one still can find out what components are stood for start, select and so on?

P.S> I don't see "Appreciate" button Sad
Offline Herjan
« Reply #5 - Posted 2014-06-23 16:15:56 »

Mmm, so the buttons can be customized? I mean one still can find out what components are stood for start, select and so on?

I mean it more like:
Program says: Press button for jump.
User: Presses button
Program: Gets input, links it to jumping.
Program says: Press blabla.


Offline CodeHead

JGO Knight


Medals: 41


From rags to riches...to rags.


« Reply #6 - Posted 2014-06-23 17:29:57 »

I'd say take a cue from games such as Super Meat Boy and others; design your setup around a standard controller such as the XBox controller, then let users customize the settings to match their actual controller. Even if your button mappings don't match the player's controller the first time they play your game, they'll be able to discover which of their buttons maps to action and cancel with minimal effort. From there it's just a matter of them going to a setup screen, similar to what Herjan posted, and configuring their inputs to what they like. It's futile to try and anticipate every possible controller configuration beforehand, especially once you consider that even if it was possible, preferences in how things are mapped can vary between owners of identical input devices.

Arthur: Are all men from the future loud-mouthed braggarts?
Ash: Nope. Just me baby...Just me.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (36 views)
2014-12-15 09:26:44

Mr.CodeIt (29 views)
2014-12-14 19:50:38

BurntPizza (61 views)
2014-12-09 22:41:13

BurntPizza (98 views)
2014-12-08 04:46:31

JscottyBieshaar (58 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (76 views)
2014-11-29 21:32:03

toopeicgaming1999 (137 views)
2014-11-26 15:22:04

toopeicgaming1999 (127 views)
2014-11-26 15:20:36

toopeicgaming1999 (37 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!