New mappings for SDL 2.26
slouken opened this issue · 13 comments
This is here just as an FYI, SDL 2.26 is adding hashing of some additional data to help reduce collisions between mappings for difference devices that share the same USB VID/PID. The exact algorithm is still in flux, but once finalized, you should be able to use controllermap from the new SDL to create mappings that can more easily be upstreamed in the future.
@slouken would you please consider reaching out to GeneralArcade to see if they can update their graphical tool or distribute the source, since their tool is what the majority of our contributors use ?
A heads up if/when Steam’s mapper gets this change as well would be appreciated.
@slouken would you please considering reaching out to GeneralArcade to see if they can update their graphical tool or at least release the source since that’s what the vast majority of our contributors use ?
A heads up when Steam’s mapper gets this change as well would be appreciated.
It isn't going to happen. Tool hasn't even been updated in 4 years. I haven't worked on it in a long time but I got a similar tool that does the job equally well. The AppImage should still work.
https://gitlab.com/ryochan7/sdl2-gamepad-mapper
SDL2_Gamepad_Mapper-0.0.3-x86_64.AppImage
https://drive.google.com/file/d/12CtYjPbP8YLN7dCIJiKX5EcNdf4PIz4g/view?usp=sharing
@Ryochan7 https://bit.ly/3QSkrgK
Great for Linux, but the QT project doesn't build on Windows or Mac OS #476
It looks like at least on Windows you can drop in the new SDL2.dll into GeneralArcade and get the new format GUID and mapping:
030024c8a306000022f6000000000000,Cyborg V.3 Rumble Pad,platform:Windows,a:b1,b:b2,x:b0,y:b3,back:b8,guide:b12,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:+a3,righttrigger:-a3,
https://gitlab.com/ryochan7/sdl2-gamepad-mapper
SDL2_Gamepad_Mapper-0.0.3-x86_64.AppImage https://drive.google.com/file/d/12CtYjPbP8YLN7dCIJiKX5EcNdf4PIz4g/view?usp=sharing
@Ryochan7, how do you update the version of SDL in this AppImage? We need SDL2 2.25.0 or newer to get the new GUID format.
We have to be careful with when and how we use the new GUID format.
I think we want to prefer the older format (which is still compatible with SDL 2.25+) for the vast majority of game controllers that don't have VID/PID conflicts.
If we start using the new format exclusively, games using older versions of SDL (which is all games today, since 2.26 isn't out yet) will not be able to use newly added mappings.
Maybe we want to have contributors use a tool that generates both GUIDs and we add the least specific one that doesn't conflict?
would be especially nice if Valve were to make anonymous device usage data public to help prioritize the highest market share devices when picking the “wildcard” mapping for GUIDs that otherwise collide
@Ryochan7 There is no license for your gamepad mapper. Please add one so we can use it.
We have to be careful with when and how we use the new GUID format.
I think we want to prefer the older format (which is still compatible with SDL 2.25+) for the vast majority of game controllers that don't have VID/PID conflicts.
If we start using the new format exclusively, games using older versions of SDL (which is all games today, since 2.26 isn't out yet) will not be able to use newly added mappings.
I changed the format in libsdl-org/SDL@3cbfd75 so mappings are backwards and forwards compatible.
Now that SDL 2.26 is out, got around to updating my old mapper app. Got a couple of bugs fixed in the process. AppImage has been tested on Ubuntu 20.04, Fedora 36, and the latest Manjaro. It was compiled against SDL 2.26.0.
SDL2_Gamepad_Mapper-0.0.4-x86_64.AppImage
https://drive.google.com/file/d/1qOFrJlnzKHMDeR9eiaGUNBFonLwVy3dE/view?usp=sharing
https://gitlab.com/ryochan7/sdl2-gamepad-mapper/-/releases/v0.0.4
If I understand correctly, the new process for adding DB entries for 2.26 format should be:
- in case of duplicate GUID, add CRC to GUID
- in case of non-duplicate GUID, add CRC to mapping
Does this match your intentions @slouken ?
No, always clear the CRC from the GUID, and always add the CRC to the mapping. That should future proof the mapping.
I tend to omit the CRC from official mappings, but only for well known vendors like Microsoft, PowerA, etc, where I know they always set a unique VID/PID.
Consolidated SDL 2.26 format mappings into a branch, for now
Edit: No support has been provided from the SDL project to determine whether the name-based CRC is actually a measurable improvement so I'm no longer maintaining a branch with the CRC fields.