• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Gamepad Mapping

ophelius

Member
Hi,
I've been looking into programming an option for my game to remap the gamepad buttons and save profiles.
From what I understand, the best way to properly create and save mappings for any specific controller is to construct a proper map string:

"<guid>,<description>,platform:<platform-name>,<bindings>"

which you can then use to properly identify, save and remap controllers.

But what I've discovered is 2 of my controllers, 1 USB NES and 1 USB SNES, both from RetroUSB.com, share the exact same GUID string AND description, making it impossible to tell which of the 2 controllers are plugged in.
So how do I create a proper mapping that I can save and retrieve which tells me exactly which controller I have plugged in, when it's not guaranteed that each separate controller model will have a unique GUID?

It also shows that both have 17 buttons, which is way off.

Thanks for any help
 
Last edited:
Hi,
I am also working on a remapping system for my game.
I am also having problems with game controllers that share the same guid, or at least the same vendor_id and product_id.
Do those two game controllers of yours (RetroUSB USB NES and USB SNES) have the same long guid text string or is it just the vendor_id+s and product_id´s. I havent started comparing the whole guid string, but maybe I should too.
The most problematic controllers I have are from Thrustmaster and Retro-bit, and the troublesome vendor_id and product_id combination 0x0079, product_id 0x0011. Many game controllers share those, and some of the share the description "USB Gamepad". Anoying really. I read that this combination (0x0079 / 0x0011) was removed from a database of controllers (SDL or Cronusmax, dont remember) because game controllers with 0x0079/0x0011 were impossible to differentiate from each other - however I still keep them, because the description is sometimes different.
If you just want to make sure the the mapping that you save are used for the correct controller the next time you load the game, then it should be enough to save the gamepad port number used by each controller with the other game controller settings. I do that and the game controllers I use they have the same gamepad ports when I restart the computer/game - unless of course I switch them or add/remove other game controllers. However this cannot be used for detecting game controllers.
Just some thoughts, that I hope you can use.
Best regards
Max
 
Last edited:

kburkhart84

Firehammer Games
With my input system, I'm not saving GUIDs or anything like that...I'm just using gamepad device numbers. Those don't change that often, but if they do, you can easily just remap the controls and move on. Also, if you are remapping controls by having the player actually hit the button(or move the axis), it doesn't matter if it somehow claims 17 buttons are supported if they actually aren't, as you won't detect those fake buttons anyway. Last point, note that on some DInput devices, the DPad counts as 4 buttons instead of a pair of axes...and the DPad sometimes works as a POV hat, so this is another reason to just check all of that when you are searching for inputs pressed to remap keys. With DInput...don't assume anything.
 
Top