OldUnreal / UnrealTournamentPatches

Other
1.04k stars 30 forks source link

[469a-c] No longer using dinput.dll/dinput8.dll #1100

Open bangstk opened 2 years ago

bangstk commented 2 years ago

This is going to be a real niche issue, but here it is.

For retail UT, I had an AutoHotkey script that would allow playing UT99 in splitscreen with up to 4 Xinput controllers, by launching multiple instances of the game, and using a dll wrapper called XInputPlus (a more modern alternative is Xidi) to handle the controllers.

The DLL wrapper would remap Xinput gamepad devices into a virtual DirectInput joystick device usable by UnrealTournament.exe, and each game instance would get a different XInputPlus config which would basically filter each game instance to only see a specific controller (so player 1 instance only sees player 1 joystick, and so on). It does this by serving as a middleman between Unreal Tournament and Windows' DirectInput joystick functions in dinput.dll/dinput8.dll.

Anyway, that technical stuff doesn't have much to do with UT. It worked with UT 436, the main issue is that UT 469c does not seem to be executing anything from dinput.dll/dinput8.dll anymore, so the controller remapping/filtering does not work, and the game native joystick support does not allow mapping gamepad analog triggers to the fire buttons. Probably the code has changed enough in WinDrv that it no longer uses dinput8.dll anymore?

So, how is UnrealTournament.exe accessing the Windows' joystick/directinput devices now? If it is using xinput directly, could it be altered internally so that the triggers report as joystick buttons rather than axes? Additionally, can there be an UnrealTournament.ini/WinDrv setting to only allow input from a specified XInput player number? Both of these changes would allow not needing the dinput.dll wrapper/XInputPlus at all.

Like I said, I understand this is a niche issue and joystick support is probably the last thing on your mind. But, I maintain that splitscreen UT where everyone has gamepads is quite fun :)

stijn-volckaert commented 2 years ago

This is indeed a bit of a niche issue. As far as I can tell:

afbeelding

v469 did, however, switch from dinput.dll to dinput8.dll, but we only use DirectInput for mouse input, and only if you explicitly choose DirectInput as your "Mouse Input" method in the in-game Options>Preferences>Input menu. Could you try switching to DirectInput-based Mouse Input to see if that solves the problem? If not, we could definitely implement XInput support in a future patch.

Vad1mCSO2 commented 2 weeks ago

If not, we could definitely implement XInput support in a future patch.

Interesting. XInput has rumble to get shaking and damage events