HarbourMasters / Shipwright

3.27k stars 490 forks source link

gamecontrollerdb issue braindump #4017

Open briaguya-ai opened 8 months ago

briaguya-ai commented 8 months ago

after seeing https://github.com/HarbourMasters/Shipwright/issues/3879#issuecomment-2002552704 i decided it's probably a good idea to write down some thoughts around gamecontrollerdb issues

the main issue is id conflicts. there are multiple controllers that end up with the same id for gamecontrollerdb. the upstream repo refuses to replace existing mapping strings, and even if they did that wouldn't be a good solution because it would mean other controllers are broken

one potential solution would be to move away from using SDL gamecontroller, and just use joystick instead. i don't think this is a good solution to this problem as it would complicate a lot of the gamecontroller stuff we take for granted. we'd basically need to create the joystick and then try to create a gamecontroller to support gyro etc. and if that doesn't work fall back or something. we'd also lose the ability to know button names when in joystick only mode. overall this would move the complexity into a place that feels hard to maintain.

i think there are a few things we can do to provide a solution that works

to

player: controller not working support: get mapping string from player, updates fork of db, any other players with the same controller can now just hit the update db button in game to get a db that works for them

closing thoughts

Malkierian commented 8 months ago

My first thought would be to agree with downloading it at runtime, if it doesn't exist, in case people make modifications themselves, so they don't lose them.

briaguya-ai commented 8 months ago

I was thinking we still just ship one with the build, but have the option to pull a new one down at runtime

Malkierian commented 8 months ago

The problem is that we still tell people to extract everything, with good reason. But that means overwriting their GCDB, and if they made changes, needing to map again. Would be easier to download at runtime than to put "Don't extract your GCDB file if you added your own mapping" in the update instructions and trust that they'd read and understand that.

Malkierian commented 8 months ago

And there's no guarantee we'll get everyone who needed to map to submit their mapping strings.

briaguya-ai commented 8 months ago

the issue i have with not shipping one is that we'd then be requiring the game have network access (at least once) for controllers to work

Malkierian commented 8 months ago

Then how about we have the one it ships with in a different directory from where it ends up being used from, and if it's not present on a fresh install, we can just copy the one it shipped with?

briaguya-ai commented 8 months ago

Directory or name could possibly work

Malkierian commented 8 months ago

Or, maybe, we could have a dummy file in the main directory that goes unchanged except by the user, and load both that one and the shipped one, with the user one taking priority?

briaguya-ai commented 8 months ago

we'd need to look into how possible loading multiple files is but maybe