elishacloud / Silent-Hill-2-Enhancements

A project designed to enhance Silent Hill 2 (SH2) graphics and audio for the PC. It also includes scripts to build or modify SH2 audio files (SFX, BGM and Dialog).
http://www.enhanced.townofsilenthill.com/SH2/
zlib License
595 stars 42 forks source link

Dualshock 4 Vibration #168

Closed vrubayka closed 1 month ago

vrubayka commented 5 years ago

As far as I understand DirectInput controllers are vibrating in this game, but why not DS4? What seems to be the issue? Using XinputPlus with DS4Windows enables vibration but a simple plug-&-play option would better.

Polymega commented 5 years ago

Vibration works for both DirectInput and XInput controllers... Just not DS4. It doesn't seem to be an issue unique to our project either. You'll find tons of search results of people trying to get vibration from their DS4 while playing Rocket League PC or X game on Steam.

If Sony provided better documentation on how their DS4 works as a DInput device on PC maybe we could have figured out this vibration discrepancy and fixed it. But we have no info to go off of.

AeroWidescreen commented 5 years ago

If Sony provided better documentation on how their DS4 works as a DInput device on PC maybe we could have figured out this vibration discrepancy and fixed it. But we have no info to go off of.

Or if Sony released their own drivers. They don't seem to care though.

Polymega commented 5 years ago

They don't. PC goes against their market (console). I'm surprised they even made the DS4 compatible out-of-the-box with PC at all.

powerpuffboysz commented 5 years ago

Adding a middleman here but have you considered using a an xinput wrapper like DS4Windows or x360ce?

Polymega commented 5 years ago

vrubayka mentioned they're already using DS4Windows but wanted to know if they could drop that part while retaining vibration, to make it truly plug-and-play. Unfortunately, as far as we know, you can't.

w1lddog2 commented 5 years ago

I know is not recommended by the devs and i also understand why. But if you have a DS3 or a DS4 gamepad, you should use SCPToolkit even if there are no new version for it, it works great. The only downside is that you are going to need a BT dongle and that dongle will be exclusive for the gamepad. But vibration works and if you have a DS3 you will be able to use pressure sensitive buttons in PCSX2 and even in some pc games like GTA3, VC, SA (With a Patch).

I used my DS3 gamepad with scp toolkit and i was able to beat the game a few times without any issue.

Polymega commented 5 years ago

Nice! I only recommend the DS4 as a plug-and-play device without rumble on the install guide for sake of simplicity for the user who is installing the project.

For those who are aware/familiar of software such as DS4windows or SCPToolkit I figure they'll apply that software approach to this game as well.

DaRkL3AD3R commented 4 years ago

Just to add some commentary to this subject, I found years ago that DS4 force feedback works in DirectInput mode IF the controller is plugged into USB. If used wirelessly however force feedback no longer works. Same holds true for the lightbar. Some 8th gen console ports that have native DS4 support will have working lightbar features that mimic the PS4 experience when the controller is plugged in but the lightbar will remain static white when connected over Bluetooth.

Polymega commented 4 years ago

When Silent (CookiePLMonster) was first looking into restoring vibration I spent several hours trying to figure out why DS4 won't vibrate when used as a simple plug-and-play device. As you said, the controllers functions just like a DInput controller otherwise.

This issue affects quite a lot of games, it seems, as you'll find Google results for lack of DS4 vibration in PC games such as Rocket League, FFXIV, Tomb Raider, and more.

What I believe is the case, from the research I've done (and there's a surprising lack of info about this on the web), is that the controller is not (bad typo there) actually detected as a generic HID device on Windows.

Because of this--with generic HIDs having no real standard for things like vibration--the controller doesn't read/respond correctly/at all to DirectInput signals for force feedback.

If I can find some of the threads/sites on this again I'll edit this post and dump them below.

Edit: Fixed a lot of typos. Trying to do too many things at once.

The-King-of-Toasters commented 4 years ago

I've been running Silent Hill 2 Enhanced through Steam with DS4 config support. After I loaded a community binding profile, I get vibration and full movement of the left stick. The right stick search-mode featured in the fourth update video doesn't seem to work for me; I'll try to use the xinput wrapper to see if that works.

Polymega commented 4 years ago

The right stick search-mode featured in the fourth update video doesn't seem to work for me

Try this: http://enhanced.townofsilenthill.com/SH2/troubleshoot.htm#search-camera-movement-is-not-working-correctlyat-all-with-my-gamepad

You'll likely need to set it to a value of 2. While DS4 is detected as a generic HID device on Windows (I believe), it functions overall as a DirectInput device.

The-King-of-Toasters commented 4 years ago

Nevermind, I reset my config and got it to work. I'm using Silent Hill 2 community profile by "wdyt" and the XInput wrapper. The only problem (I think) is that using L3 opens the inventory instead of the "use health". The right-stick movement and rumble is fully supported! Might be worth testing this yourself and adding it to the guide. I believe Steam maps the PS4 as an XInput controller, plus added functionality like gyro and trackpad support. I wonder if you could use the gyro in search mode 🤔. More testing is required.

Polymega commented 4 years ago

That's great you figured it out! And gyro support for search camera movement would be trippy, heh.

Might be worth testing this yourself and adding it to the guide.

An overarching goal for the website is to keep the steps as simple as we possibly can (and we hope to make an installer for the overall project someday to fully achieve this goal). This is important because, for many people wanting to use the project, they're not all that computer savvy.

However, if you'd consider writing an in-depth guide on how to set it up with Steam/DS4 config support here, I would be happy to link to your post for any future people who'd want to dive deeper into customization for things like Steam/better DS4 support.

The-King-of-Toasters commented 4 years ago

Just found out that Playstation Now is bundled with a DS3 driver. When that's installed, Steam can auto-configure it too. I loaded the same community profile and it works perfectly.

I'll try and knock out a guide soon.

The-King-of-Toasters commented 4 years ago

Steps

  1. Connect controller to PC
  2. Add Silent Hill 2 to Steam.
  3. Associate controller with Steam.
  4. Install XInput plus.
  5. Load community controller config.
  6. Run Silent Hill 2 from Steam and test

Step 0

DS4

Just plug it in.

DS3

Step 1

See the guide I wrote: #222.

Step 2

Step 3

Follow the steps for installing XInput plus in the installation guide.

Step 4

Step 5:

Run Silent Hill 2 from Steam. If everything worked correctly, your controller should be automatically working. Note that this config makes the buttons act like a keyboard, but the sticks and rumble are fully supported. If buttons are not registering, reset all keybinds to default.

Addendum

I've tried mapping the DS4 gyro to search mode, but it needs a lot more testing. A simple setup needs the controller to be moved in awkward positions to work. In addition, the camera isn't usually centered when in search mode, meaning that the user has to physically correct for it. IMO the right stick is still superior, but if anyone else wants to give this a shot, please do.

Polymega commented 4 years ago

This is perfect. Thanks for taking the time to write this up, @The-King-of-Toasters.

Now, if anyone asks about Steam or DS4 capabilities, I can happily direct them to your guide here.

Thank you very much!

The-King-of-Toasters commented 4 years ago

No problem. Note that steam has first-class support switch pro controllers, and can work with many generic gamepads to have the same feature set as any xinput controller.

Polymega commented 4 years ago

@The-King-of-Toasters Thanks again for your useful guides! We pinned your Steam post to the top of the page.

palceueu commented 4 years ago

Steps

  1. Connect controller to PC
  2. Add Silent Hill 2 to Steam.
  3. Associate controller with Steam.
  4. Install XInput plus.
  5. Load community controller config.
  6. Run Silent Hill 2 from Steam and test

Step 0

DS4

Just plug it in.

DS3

  • Plug it in.
  • Grab the PS Now PC app.
  • Install it. A window will pop up asking to install the "Wireless controller for PLAYSTATION(R)3" driver. Accept it.
  • Feel free to uninstall it after it's finished, as the driver will stay installed.

Step 1

See the guide I wrote: #222.

Step 2

  • Open Steam in Big Picture mode (The rectangle left of the minimise button).
  • Navigate to Settings (Cog top right) -> Controller: Controller Settings.
  • Check the box for PlayStation Configuration Support.

Step 3

Follow the steps for installing XInput plus in the installation guide.

Step 4

  • Make sure you have your controller connected.
  • Go to Silent Hill 2 in your steam library. Select the "Controller Configuration" button. Alternatively, right click it and select Manage -> "Controller Configuration".
  • If step 2 worked, a small window should show up showing an image of your controller (DS3/DS4).
  • Select browse configs -> Community -> Show other controller types.
  • Select the "wdyt" config. Continue if it says it's not supported for your controller. (Note: perhaps the team could make an "official" config to make it easier for users.)

Step 5:

Run Silent Hill 2 from Steam. If everything worked correctly, your controller should be automatically working. Note that this config makes the buttons act like a keyboard, but the sticks and rumble are fully supported. If buttons are not registering, reset all keybinds to default.

Addendum

I've tried mapping the DS4 gyro to search mode, but it needs a lot more testing. A simple setup needs the controller to be moved in awkward positions to work. In addition, the camera isn't usually centered when in search mode, meaning that the user has to physically correct for it. IMO the right stick is still superior, but if anyone else wants to give this a shot, please do.

I could not find that wdyt config in the community tab, searched using different game names (Silent Hill, Silent Hill 2, Silent Hill 2 Director's Cut) and it didn't show up, could you specify what did you name the game in the steam library in order to search for that config?

The-King-of-Toasters commented 4 years ago

@palceueu Did you try Silent Hill 2: Director's Cut?

palceueu commented 4 years ago

@palceueu Did you try Silent Hill 2: Director's Cut?

Yes, in this instance the only config that shows up is Xbox One Conroller for SH2 by YIKES. in which the description specifically mention the lack of rumble ("Side-steps the game's lack of XInput support. Doesn't support rumble.")

The-King-of-Toasters commented 4 years ago

I looks like I deleted SH2 from Steam so I'm in the same boat. I guess I'll just remake it.

The-King-of-Toasters commented 4 years ago

And here it is. If your game name is Silent Hill 2: Directors Cut it should show up. If not, use this link: steam://controllerconfig/silent%20hill%202%20directors%20cut/2241988209 use the one below. I guess the real solution is to copy this config for all permutations of /Silent Hill 2(: (Director'?s Cut|Enhanced Edition))?/.

palceueu commented 4 years ago

And here it is. If your game name is Silent Hill 2: Directors Cut it should show up. If not, use this link: steam://controllerconfig/silent%20hill%202%20directors%20cut/2241988209. I guess the real solution is to copy this config for all permutations of /Silent Hill 2(: (Director'?s Cut|Enhanced Edition))?/.

Thank you so much, it works perfectly!

The-King-of-Toasters commented 4 years ago

So uhh, it turns out that with XInput enabled the game runs fine if you set your DS4 as a normal gamepad in Steam Input. The only difference is that I can't move James' head with the right stick when he's moving, as the left stick will force his head in the direction he's walking.

@Polymega is this how the game normally works with other XInput pads?

Polymega commented 4 years ago

Try adjusting this setting: http://enhanced.townofsilenthill.com/SH2/config.htm#RestoreSearchCamMovement

Namely, if you changed it to 2 or 3 when using the DS4 as a DirectInput gamepad, I imagine you'll want to change it back to 1 if using the DS4 with Xinput enabled.

The-King-of-Toasters commented 3 years ago

Piping up again to say that I think I've perfected my bindings. Since I bound the left stick to the arrow-keys, I was always moving James' head in search mode. My bindings now are unchanged, except both sticks are passed through as sticks, like normal. Now I get full analog+head movement and vibration. The only "issue" is that James automatically runs when pushing the left joystick fully up/down, negating the need for the run key — but I think this is intended. BTW, this works with and without the XInputPlus .dlls, all I need is the keyconf.dat bindings in the zip file (If I had to guess, it's because of the GamepadControlsFix, since reverting to the default bindings doesn't let me cancel with O/B. Everything else works fine). Just make sure to set RestoreSearchCamMovement = 1 in d3d8.ini.

Here's a screenshot of my bindings so far, I'll try and update the community one later on:

11488007343157805056_20210414220220_1

Polymega commented 3 years ago

Nice!

The only "issue" is that James automatically runs when pushing the left joystick fully up/down, negating the need for the run key — but I think this is intended.

In the game's Options > Game Options menu I believe you can set his movement to "analog." With that, he will move faster depending on how far you move the joystick in any one direction.

In the future, we still hope to make a native solution for DS4 and other controllers; one that won't need to rely on third party software. I don't know if that will ever happen, but there has been some interest in doing this from two people with backgrounds in raw/HID input support.

The-King-of-Toasters commented 3 years ago

Cool! I just uploaded my bindings to the community again, here's the "link:" steam://controllerconfig/silent%20hill%202%20director%27s%20cut/2457538421

JaegerFox commented 11 months ago

I don't know if this will help, but you might want to ask Duckstation or the Classic Rebirth modders for help, they use the DS4 controller natively and support the lightbar features, in Resident Evil it acts as a health indicator.

mirh commented 11 months ago

Duckstation uses SDL. Notoriously (see also #288) HIDAPI is how you workaround the iffiness of the DS4.

ovojake commented 5 months ago

reviving this thread as I cannot for the life of me get my dualsense to vibrate in this game. the controls and everything else works great, but no matter what I switch in ds4windows or steam, my controller just refuses to vibrate in this game. Could someone maybe share their ds4windows settings for this game?

Polymega commented 5 months ago

mirh mentioned it in a comment right above yours (https://github.com/elishacloud/Silent-Hill-2-Enhancements/issues/168#issuecomment-1857957325) in that getting PlayStation controllers to "just work" on Windows isn't straightforward at all. This is why we have disclaimers across our project site for PS controllers:

image image

ovojake commented 5 months ago

right I'm familiar with the pain of getting pc games to recognize dualsense, but it sounds like some people have gotten rumble to work. even if it requires a bunch of strange steps, I'm wondering if someones found any methods that have had success.

ovojake commented 5 months ago

Cool! I just uploaded my bindings to the community again, here's the "link:" steam://controllerconfig/silent%20hill%202%20director%27s%20cut/2457538421

link doesnt seem to work anymore, it just opens steam. would I miss anything if I just copied your controls from the screenshot you posted earlier? or is there some off screen magic you did to get the rumble working

mirh commented 5 months ago

https://ryochan7.github.io/ds4windows-site/troubleshooting/misbehaving-controller-ingame/#rumble-does-not-work https://ryochan7.github.io/ds4windows-site/guides/prevent-steam-conflict/

p.s. that "vibration is not guaranteed to work with DI controllers" note is quite sad knowing it's probably just a matter of clueless people with their dualshocks..