Ryochan7 / DS4Windows

Like those other ds4tools, but sexier
https://ryochan7.github.io/ds4windows-site/
GNU General Public License v3.0
7.02k stars 810 forks source link

DirectInput proper support possible? (e.g. BloodRayne 1/2) #870

Closed reyaz006 closed 5 years ago

reyaz006 commented 5 years ago

So I wanted to try BloodRayne 2 with DS4 controller and it didn't go well.

Does DS4W work with dinput games at all? I found a note about Bluetooth not working with dinput but supposedly it should have been solved by now. Apparently either it did not or I'm missing something. Using wired mode didn't work for me, even with enabling "Dinput only" and disabling "Hide DS4".

The most quoted guide about adding controller support for the game is here: https://steamcommunity.com/sharedfiles/filedetails/?id=458151514 It uses XInput Plus tool. I've tried both latest version of it and archived file from the guide - it didn't work. Strangely, the XInput Plus config tool does recognize the DS4 and all inputs from it properly.

Here are 2 solutions that I found to actually work with the game:

  1. XInput Plus + GloSC + Steam Input. The general guide is here. Upon closer inspection, I've found that just the following config also works: GloSC + DS4W. However this means I have to use a shortcut from Steam to play the game, and it also involves non-working Steam overlay, weird invisible window that stays active even after the game is closed etc. Also, if I don't close that invisible window I can play just fine with just running the game from Steam, without the shortcut.

  2. InputMapper. Its UI is quite uncomfortable, and I was unable to solve issues with axis but at least it makes the game recognize my DS4 controller. It seems to be maintained by a single person.

So, both solutions introduce some inconveniences. But in case with GloSC it has an open source code. It appears to use the same ViGEm-driver as DS4W. I failed to understand what exactly needs to be done to support dinput games like BloodRayne, what GloSC does exactly, but I'm fairly sure it should be possible without additional software.

Also, are there any more workarounds I could try? Possibly with using less additional apps and layers.

Thanks

mika-n commented 5 years ago

Nowadays DS4Windows supports two types of output devices: xbox360 or dualshock4. Some very old versions support only xbox360 output mode, so make sure you try the latest version of DS4Windows: https://github.com/Ryochan7/DS4Windows/releases

Try to use a profile with "Controller=dualshock4" output type because then the virtual output controller will be in dualshock4 format. See Settings and Controller output type option in a profile settings in DS4Windows app. https://github.com/Ryochan7/DS4Windows/wiki/Settings

Also, if you use BT connection with dualshock4 output mode then you probably need to enable exclusive mode because the original "physical" controller device in BT may be seen as a dead controller in Windows (either "Hide DS4 Controller" option in DS4Windows or if you really cannot get it to work in your PC then HidGuardian device driver solution): https://github.com/Ryochan7/DS4Windows/wiki/Exclusive-Mode-(Hide-DS4-Controller-config-option)-tips-and-issues

Of course there are various other reasons also (explained in the above linked page) why exclusiveMode/hidGuarian may be required ("double input" problem).

The use of UseDInputOnly is useful only if you use nothing but keyboard and mouse re-mapping options. You cannot re-map normal gamepad keys in UseDInputOnly mode.

And UseDInputOnly and HideDS4Controller options should not be used at the same time because then you would end up with no controllers at all: https://github.com/Ryochan7/DS4Windows/wiki/Troubleshooting#games-dont-see-any-controller-not-the-virtual-gamepad-controller-or-physical-controller

https://github.com/Ryochan7/DS4Windows/wiki/Troubleshooting

Ryochan7 commented 5 years ago

InputMapper and even Steam exhibit the same behavior regarding Bluetooth connections. Steam uses its own hooking method to hide the original DS4 from a game. DS4Windows can work with HidGuardian just like InputMapper does to force the original DS4 to be hidden. The old exclusive mode trick still works for me most of the time but there is a lot of software now that pretty much makes that old workaround useless (GeForce Experience suite).

Are you sure it is not just an issue with the game itself? I recently played the PC version of Soul Reaver and that game required a mod in order to get controller support working properly on modern systems. For that game, I found that using the DualShock 4 output mode was more responsive in game than using the Xbox 360 output mode and relying on the DirectInput interface.

reyaz006 commented 5 years ago

Thanks for replies. Let me summarize the suggestions...

InputMapper and even Steam exhibit the same behavior regarding Bluetooth connections.

What do you mean by same behavior? Yes, with Steam Input only the game also did not detect the controller. But with InputMapper it did. All in wireless mode.

Steam uses its own hooking method to hide the original DS4 from a game. DS4Windows can work with HidGuardian just like InputMapper does to force the original DS4 to be hidden.

Like I've said earlier, the "Hide DS4" was already activated.

Are you sure it is not just an issue with the game itself?

I'm not sure, but then again - there is that guide that assumes there is a collection of dozens or hundreds of dinput-only games that do not work with Steam Input, and thus most likely do not work with DS4W.

Let me describe another test I did to emphasize a point.

Environment:

Test 1:

Test 2:

Note: While GloSC is running, in [Control Panel \ Devices] I see 4 additional devices named "HID-compliant Game Controller", on top of previous 2.

I conclude that GloSC does something extra that makes the dinput game recognize my controller. How does this work? I have no idea. Neither GloSC's readme nor its source code contains strings like "dinput" or "directinput". Can that "extra thing" be implemented in DS4W? I guess so. Maybe I'm wrong.

mika-n commented 5 years ago
  • Try changing this to DS4 mode - tried now. After I change it in existing profile and press Save Profile, it doesn't save and reverts back to Xbox 360.

There is a bug in the current version which breaks this Controller xbox360-vs-dualshock4 option in the GUI. You could modify that option by editing a profile file in Notepad, but fix to that bug is probably coming in few days.

  • Enable "Hide DS4 Controller" option - it was already like that, it was the first thing I did when I started using DS4W in other games.
  • In [Control Panel \ Devices] I have "Wireless Controller" and "Xbox 360 Controller for Windows".

Hmm... If you have both WirelessController and Xbox360 controllers visible then HideDS4Controller (=exclusive mode) activation failed. What do you see in Logs tabpage in DS4Windows? Do you see a warning message that exclusive mode failed? Go through tips in the following page. If you cannot get the exclusive mode to work then you may have to install HidGuardian tool to do the trick (and not enabling the option in DS4Windows). https://github.com/Ryochan7/DS4Windows/wiki/Exclusive-Mode-(Hide-DS4-Controller-config-option)-tips-and-issues https://github.com/Ryochan7/DS4Windows/wiki/DS4Windows-and-HIDGuardian-Install-and-Setup-Guide#hidguardian-test-installer

Also, please take a look at the following tip if/when you enable dualshock4 output controller mode in DS4Windows. Steam has a nasty feature to activitely ignore DS4 gamepad if Steam client detects DS4Windows and few other apps running in the background. https://github.com/Ryochan7/DS4Windows/wiki/Troubleshooting#steam-doesnt-see-the-virtual-output-controller-if-a-profile-uses-the-dualshock4-output-type-steam-sees-the-ds4-controller-only-if-ds4windows-uses-xbox360-output-controller-type

reyaz006 commented 5 years ago

Hmm... If you have both WirelessController and Xbox360 controllers visible then HideDS4Controller (=exclusive mode) activation failed.

Wrong, I mean that I see 2 devices in [Control Panel \ Devices and printers]. In game controllers applet I see only one - the emulated xbox 360 one.

You could modify that option by editing a profile file in Notepad

Worked from what I see. I've changed "X360" to "DS4" in profile file and this changed the emulated device from "Xbox 360 Controller for Windows" to "HID-compliant Game Controller". In the game I see that B1-B16 are emulated and triggers can be set to actions too. Did just a quick test to confirm that and if I didn't miss anything then I call it perfect. Thanks. I'll get rid of InputMapper and do a reboot to make sure it still works well.

reyaz006 commented 5 years ago

I've got rid of extra software and confirm again that DS4W alone works well with BloodRayne 2 after setting this image

However I have a suggestion. In profile edit menu, it might help to name the buttons according to Dinput scheme, e.g. Button 1, Button 2 ... Button 15 instead of Cross, Circle, Square etc. Maybe allow to just switch to desired scheme with a separate setting. I think some games also start with Button 0 so that might be another additional scheme.