SoapboxRaceWorld / GameLauncher_NFSW

An unofficial launcher for Need for Speed: World (https://launcher.worldunited.gg / https://soapboxrace.world)
GNU General Public License v3.0
430 stars 133 forks source link

Xbox One Controller Non Functional in Linux environments #205

Open CosmicFusion opened 2 years ago

CosmicFusion commented 2 years ago

Update : tried switching from winehq 7.11 to lutris fshack 6.14 , controller vibration work as intended meaning the game can see the controller , yet i can't control the car .

Update 2 : tried switching to your custom wine build , controller vibration work as intended meaning the game can see the controller , yet i can't control the car .

.

TakuyaSama commented 2 years ago

I've got the same issue as you, asked on the Discord's server of SoapBox, plus the server where I play, NightRiderz, but the answer I got was that the game is picky, even on Windows.

Using Lutris/Bottles : [no] : Nah i use the command-line , no need for a stinky GUI

How do you run & configure if you want the game use of MangoHUD, etc? I'm quite interested into being able to launch the launcher/game without the need of install a GUI, like Lutris, in my case. What I did was went to the website, in Lutris, click on Install and, when I've got installed Lutris, it was a really simple (GUI though), process of following instructions, (really similar to Windows, click on Next, Next) if I remember correctly. Thank you in advance 😀

Unaccounted4 commented 1 year ago

Controllers don't work on Linux because the game needs the dinput8.dll override, which the launcher uses to load the mods for each server. Since NFS:W uses DInput for controllers, the override effectively stops them from working.

You can add the Lutris launch shortcut to Steam and assign keyboard buttons to the controller, but these will just be button presses and you won't get the analog feature if you bind something to one of the sticks.

leipero commented 1 year ago

Controllers don't work on Linux because the game needs the dinput8.dll override, which the launcher uses to load the mods for each server. Since NFS:W uses DInput for controllers, the override effectively stops them from working.

You can add the Lutris launch shortcut to Steam and assign keyboard buttons to the controller, but these will just be button presses and you won't get the analog feature if you bind something to one of the sticks.

That's not the case at all. While dinput8.dll is used for mods as an (ultimate) ASI loader, when set to "n,b" (native, builtin) dircetinput controllers work without any issues, I've played multiple games using dinput8.dll overrides (examples: NFS Carbon, Most Wanted, widescreen mod) with 0 issues using dinput controller. NFS World uses xinput for XBOX 360 Controller, and that is the main issue I will explain below.

@CosmicFusion @TakuyaSama @Unaccounted4 The reason why controller doesn't work is WINE actually, rather the game code itself is at fault here. The game itself requires specific name of the controller aside from xinput (and maybe the game itself supports some very specific dinput controllers as well, I don't know that, I know it doesn't support mine). The problem with XBOX Controllers under WINE is that older WINE versions use "js" and "event" and different naming scheme even for XBOX 360 Controller that is officially supported by game. WINE developers/contributors reworked whole naming/mapping system in some relatively recent WINE version, I can't remember exact version when that happened, I think after v7.x but don't hold me on that one. So, with those WINE versions XBOX 360 Controller should work out of the box without any issues. XBOX ONE Controller might have an issue, because (I assume) it does have a different name than 360 Controller, so basically, game is programmed to reject any controller that would work without a single issue just because of name/ID. So now, even newer Microsoft controllers will face the issue.

Solution is not that simple actually, use newer WINE version is a proper solution, however, SBRW.Launcher doesn't work with any WINE version aside from v6.14-4 (at least for me). So until that issue is solved (probably SBRW.Launcher bug), we will be unable to use controllers on WINE. The solution for XBOX ONE Controller can be to emulate XBOX 360 Controller using xboxdrv (if it still doesn't work with newer WINE versions). I've emulated XBOX 360 controller using dinput controller, as expected, with new WINE version and offline server, it works without any issue. Here is an example how XBOX 360 Controller looks in WINE v7.22 (my own build, built using wine-tkg build systems, should work with any): 2022-12-04 13-01-02

For my specific controller, i used in order to get mappings I want, you should obviouslly use it the way it's needed for your controller: xboxdrv --evdev /dev/input/event7 --evdev-absmap ABS_X=X1 --evdev-keymap BTN_TRIGGER=RT,BTN_THUMB=LT,BTN_THUMB2=X,BTN_TOP2=LB,BTN_PINKIE=B,BTN_BASE2=A,BTN_BASE=Y --mimic-xpad --silent

CosmicFusion commented 1 year ago

Controllers don't work on Linux because the game needs the dinput8.dll override, which the launcher uses to load the mods for each server. Since NFS:W uses DInput for controllers, the override effectively stops them from working.

You can add the Lutris launch shortcut to Steam and assign keyboard buttons to the controller, but these will just be button presses and you won't get the analog feature if you bind something to one of the sticks.

That's not the case at all. While dinput8.dll is used for mods as an (ultimate) ASI loader, when set to "n,b" (native, builtin) dircetinput controllers work without any issues, I've played multiple games using dinput8.dll overrides (examples: NFS Carbon, Most Wanted, widescreen mod) with 0 issues using dinput controller. NFS World uses xinput for XBOX 360 Controller, and that is the main issue I will explain below.

@CosmicFusion @TakuyaSama @Unaccounted4 The reason why controller doesn't work is WINE actually, rather the game code itself is at fault here. The game itself requires specific name of the controller aside from xinput (and maybe the game itself supports some very specific dinput controllers as well, I don't know that, I know it doesn't support mine). The problem with XBOX Controllers under WINE is that older WINE versions use "js" and "event" and different naming scheme even for XBOX 360 Controller that is officially supported by game. WINE developers/contributors reworked whole naming/mapping system in some relatively recent WINE version, I can't remember exact version when that happened, I think after v7.x but don't hold me on that one. So, with those WINE versions XBOX 360 Controller should work out of the box without any issues. XBOX ONE Controller might have an issue, because (I assume) it does have a different name than 360 Controller, so basically, game is programmed to reject any controller that would work without a single issue just because of name/ID. So now, even newer Microsoft controllers will face the issue.

Solution is not that simple actually, use newer WINE version is a proper solution, however, SBRW.Launcher doesn't work with any WINE version aside from v6.14-4 (at least for me). So until that issue is solved (probably SBRW.Launcher bug), we will be unable to use controllers on WINE. The solution for XBOX ONE Controller can be to emulate XBOX 360 Controller using xboxdrv (if it still doesn't work with newer WINE versions). I've emulated XBOX 360 controller using dinput controller, as expected, with new WINE version and offline server, it works without any issue. Here is an example how XBOX 360 Controller looks in WINE v7.22 (my own build, built using wine-tkg build systems, should work with any): 2022-12-04 13-01-02

For my specific controller, i used in order to get mappings I want, you should obviouslly use it the way it's needed for your controller: xboxdrv --evdev /dev/input/event7 --evdev-absmap ABS_X=X1 --evdev-keymap BTN_TRIGGER=RT,BTN_THUMB=LT,BTN_THUMB2=X,BTN_TOP2=LB,BTN_PINKIE=B,BTN_BASE2=A,BTN_BASE=Y --mimic-xpad --silent

I actually can run it Using any version of wine i wish to use , winehq-staging-7.11 in this case, yet my xbox one x controller, doesn't work

leipero commented 1 year ago

Controllers don't work on Linux because the game needs the dinput8.dll override, which the launcher uses to load the mods for each server. Since NFS:W uses DInput for controllers, the override effectively stops them from working. You can add the Lutris launch shortcut to Steam and assign keyboard buttons to the controller, but these will just be button presses and you won't get the analog feature if you bind something to one of the sticks.

That's not the case at all. While dinput8.dll is used for mods as an (ultimate) ASI loader, when set to "n,b" (native, builtin) dircetinput controllers work without any issues, I've played multiple games using dinput8.dll overrides (examples: NFS Carbon, Most Wanted, widescreen mod) with 0 issues using dinput controller. NFS World uses xinput for XBOX 360 Controller, and that is the main issue I will explain below. @CosmicFusion @TakuyaSama @Unaccounted4 The reason why controller doesn't work is WINE actually, rather the game code itself is at fault here. The game itself requires specific name of the controller aside from xinput (and maybe the game itself supports some very specific dinput controllers as well, I don't know that, I know it doesn't support mine). The problem with XBOX Controllers under WINE is that older WINE versions use "js" and "event" and different naming scheme even for XBOX 360 Controller that is officially supported by game. WINE developers/contributors reworked whole naming/mapping system in some relatively recent WINE version, I can't remember exact version when that happened, I think after v7.x but don't hold me on that one. So, with those WINE versions XBOX 360 Controller should work out of the box without any issues. XBOX ONE Controller might have an issue, because (I assume) it does have a different name than 360 Controller, so basically, game is programmed to reject any controller that would work without a single issue just because of name/ID. So now, even newer Microsoft controllers will face the issue. Solution is not that simple actually, use newer WINE version is a proper solution, however, SBRW.Launcher doesn't work with any WINE version aside from v6.14-4 (at least for me). So until that issue is solved (probably SBRW.Launcher bug), we will be unable to use controllers on WINE. The solution for XBOX ONE Controller can be to emulate XBOX 360 Controller using xboxdrv (if it still doesn't work with newer WINE versions). I've emulated XBOX 360 controller using dinput controller, as expected, with new WINE version and offline server, it works without any issue. Here is an example how XBOX 360 Controller looks in WINE v7.22 (my own build, built using wine-tkg build systems, should work with any): 2022-12-04 13-01-02 For my specific controller, i used in order to get mappings I want, you should obviouslly use it the way it's needed for your controller: xboxdrv --evdev /dev/input/event7 --evdev-absmap ABS_X=X1 --evdev-keymap BTN_TRIGGER=RT,BTN_THUMB=LT,BTN_THUMB2=X,BTN_TOP2=LB,BTN_PINKIE=B,BTN_BASE2=A,BTN_BASE=Y --mimic-xpad --silent

I actually can run it Using any version of wine i wish to use , winehq-staging-7.11 in this case, yet my xbox one x controller, doesn't work

Well, try to emulate XBOX 360 Controller using xboxdrv, or, since Linux use other driver for xinput, try xboxdrv as driver. I don't know how you can run it, for me, launcher gives errors, any WINE or even proton version aside from v6.14-4. Take a look at naming in WINE v7.11, I think that version is with reworked input stuff, but I'm not sure.

CosmicFusion commented 1 year ago

Controllers don't work on Linux because the game needs the dinput8.dll override, which the launcher uses to load the mods for each server. Since NFS:W uses DInput for controllers, the override effectively stops them from working. You can add the Lutris launch shortcut to Steam and assign keyboard buttons to the controller, but these will just be button presses and you won't get the analog feature if you bind something to one of the sticks.

That's not the case at all. While dinput8.dll is used for mods as an (ultimate) ASI loader, when set to "n,b" (native, builtin) dircetinput controllers work without any issues, I've played multiple games using dinput8.dll overrides (examples: NFS Carbon, Most Wanted, widescreen mod) with 0 issues using dinput controller. NFS World uses xinput for XBOX 360 Controller, and that is the main issue I will explain below. @CosmicFusion @TakuyaSama @Unaccounted4 The reason why controller doesn't work is WINE actually, rather the game code itself is at fault here. The game itself requires specific name of the controller aside from xinput (and maybe the game itself supports some very specific dinput controllers as well, I don't know that, I know it doesn't support mine). The problem with XBOX Controllers under WINE is that older WINE versions use "js" and "event" and different naming scheme even for XBOX 360 Controller that is officially supported by game. WINE developers/contributors reworked whole naming/mapping system in some relatively recent WINE version, I can't remember exact version when that happened, I think after v7.x but don't hold me on that one. So, with those WINE versions XBOX 360 Controller should work out of the box without any issues. XBOX ONE Controller might have an issue, because (I assume) it does have a different name than 360 Controller, so basically, game is programmed to reject any controller that would work without a single issue just because of name/ID. So now, even newer Microsoft controllers will face the issue. Solution is not that simple actually, use newer WINE version is a proper solution, however, SBRW.Launcher doesn't work with any WINE version aside from v6.14-4 (at least for me). So until that issue is solved (probably SBRW.Launcher bug), we will be unable to use controllers on WINE. The solution for XBOX ONE Controller can be to emulate XBOX 360 Controller using xboxdrv (if it still doesn't work with newer WINE versions). I've emulated XBOX 360 controller using dinput controller, as expected, with new WINE version and offline server, it works without any issue. Here is an example how XBOX 360 Controller looks in WINE v7.22 (my own build, built using wine-tkg build systems, should work with any): 2022-12-04 13-01-02 For my specific controller, i used in order to get mappings I want, you should obviouslly use it the way it's needed for your controller: xboxdrv --evdev /dev/input/event7 --evdev-absmap ABS_X=X1 --evdev-keymap BTN_TRIGGER=RT,BTN_THUMB=LT,BTN_THUMB2=X,BTN_TOP2=LB,BTN_PINKIE=B,BTN_BASE2=A,BTN_BASE=Y --mimic-xpad --silent

I actually can run it Using any version of wine i wish to use , winehq-staging-7.11 in this case, yet my xbox one x controller, doesn't work

Well, try to emulate XBOX 360 Controller using xboxdrv, or, since Linux use other driver for xinput, try xboxdrv as driver. I don't know how you can run it, for me, launcher gives errors, any WINE or even proton version aside from v6.14-4. Take a look at naming in WINE v7.11, I think that version is with reworked input stuff, but I'm not sure.

like this ? https://wiki.archlinux.org/title/Gamepad#Mimic_Xbox_360_controller_with_other_controllers

leipero commented 1 year ago

@CosmicFusion Exactly that, you might need to setup udev rules so you don't need to run as superuser all the time. You probably know how to do it, but I will share it here for others to have it just in case, for Arch (should work on other distros) as root, do: touch /etc/udev/rules.d/99-input.rules groupadd -f uinput gpasswd -a "$USER" uinput touch /etc/udev/rules.d/99-input.rules echo 'SUBSYSTEM=="misc", KERNEL=="uinput", MODE="0660", GROUP="uinput"' >> /etc/udev/rules.d/99-input.rules echo 'uinput' >> /etc/modules-load.d/uinput.conf rebuild init (Arch "mkinitcpio -p linux" or linux kernel you use) and reboot.

leipero commented 1 year ago

My point is, this is not a launcher bug, it's an game programming decision issue (not even a bug) in combination with WINE and/or newer controllers.