Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New mappings for SDL 2.26 #609

Closed
slouken opened this issue Aug 24, 2022 · 13 comments
Closed

New mappings for SDL 2.26 #609

slouken opened this issue Aug 24, 2022 · 13 comments

Comments

@slouken
Copy link
Contributor

slouken commented Aug 24, 2022

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.

@offalynne
Copy link
Collaborator

offalynne commented Aug 24, 2022

@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.

@Ryochan7
Copy link
Contributor

@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

@offalynne
Copy link
Collaborator

offalynne commented Aug 25, 2022

@Ryochan7 https://bit.ly/3QSkrgK

Great for Linux, but the QT project doesn't build on Windows or Mac OS #476

@slouken
Copy link
Contributor Author

slouken commented Aug 25, 2022

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,

@slouken
Copy link
Contributor Author

slouken commented Aug 26, 2022

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.

@cgutman
Copy link
Contributor

cgutman commented Aug 26, 2022

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?

@offalynne
Copy link
Collaborator

offalynne commented Aug 26, 2022

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

@kimimaru4000
Copy link
Contributor

@Ryochan7 There is no license for your gamepad mapper. Please add one so we can use it.

@slouken
Copy link
Contributor Author

slouken commented Aug 28, 2022

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.

@Ryochan7
Copy link
Contributor

Ryochan7 commented Dec 3, 2022

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

@offalynne
Copy link
Collaborator

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 ?

@slouken
Copy link
Contributor Author

slouken commented Dec 4, 2022

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.

@offalynne
Copy link
Collaborator

offalynne commented Dec 31, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants