geeky / dinput8wrapper

This is a DirectInput 8 (dinput8.dll) Wrapper, which internally uses Raw-Input instead of DirectInput
MIT License
42 stars 6 forks source link

Fixes Stuttering issue with Rogue Warrior but no mouse controls and random keystrokes. #3

Closed KyleStilkey closed 3 years ago

KyleStilkey commented 3 years ago

So this fix has been the only fix that has worked for me for Kane and Lynch. It removes all microstutters and I was able to complete the game. I figured that this game had the exact same issue so I gave it a try and it does work. All stuttering issues seem to go away, but you lose your ability to use your mouse and in some menus the arrow keys are randomly being held down.

I am unaware if this is something you can fix with this or not, but I'd love to see this resolved. None of the other so called fixes work and I'm not going to disable 90% of my devices to just play this. It's a fun game to play for stupid moments, but not worth the hassle to get up and running.

geeky commented 3 years ago

Yes it seems that Rogue Warrior also frequently calls EnumDevices() in the main thread of the game which can cause stuttering (depending on how long the windows api needs to enumerate usb hid devices. Which in turn depends on the attached physical and virtual usb devices)

Rogue Warrior uses another function to fetch the mouse data, which was not implemented yet. Very basic support for it is now added: https://github.com/geeky/dinput8wrapper/releases/download/v1.0.0.3/dinput8.dll ...it seems that Rogue Warrior might now be playable - but i was not able to reproduce the hanging arrow keys in menus (yet)

KyleStilkey commented 3 years ago

Awesome! I'll give this a try later and appreciate the continued support. Even if these games are not the best games it's still much appreciated.

geeky commented 3 years ago

I will probably release a small update next weekend: The game seems to not call Acquire() for the mouse device and the wrapper will need to force the game to do so. Without Acquire() the mouse is not capture and moving the mouse outside the game on multidisplay setups will cause issues.

(I also noticed some seemingly random lags in d3d9.dll with Rogue Warrior. On my system these lags cause the desktop to be visible for a brief moment instead of the game. But those also happen without the dinput8wrapper and i probably wont be able to find a workaround for that game-/d3d-bug)

KyleStilkey commented 3 years ago

So I had some time to play test with this and I've so far not seen any keystrokes getting stuck in the menus. I also experience the random flicker to desktop and the mouse not being captured into the Windows.

I have fixed this on my system with dgVoodoo (using d3d9.dll) and just set the settings to Capture the Mouse, Keep Aspect Ratio and it seems to prevent this and keep the mouse locked into the game for multi monitor setups. I'm not sure if by chance there is a way you can do this with your fix or not, but not big deal if this is needed as an additional work around.

If this is a method to be used to fix this, I know sometimes dgVoodoo can cause issues with other Dll captures/wrappers and maybe you could run a quick test to see if this might cause any additional side effects or not, but overall the game at least is in a way better playable state and your hard work is appreciated.

geeky commented 3 years ago

Just released https://github.com/geeky/dinput8wrapper/releases/tag/v1.0.0.4 (Only fixes the mouse capture issue) With dgVoodoo the game seems to work fine ^^

KyleStilkey commented 3 years ago

I appreciate your hard work! Thank you!