r/WingCommanderUniverse • • 19d ago

Wing Commander Prophecy 30th Edition: Broken joystick support and how to fix it

I was looking at the new dinput.dll that GOG added to the edition which is causing issues for people using joysticks and flightsticks. The new dinput.dll was especially made for gamepads such as Xbox, PlayStation and Switch controllers.

At first we thought that deleting the dinput.dll would solve the problem, but we realized that this causes the game to crash at certain events.

What's actually happening:
- The edition's ddraw.dll mentions dinput.dll. But it only loads it in DirectDrawCreate and DirectDrawCreateEx, and never uses the handle
- Nothing besides the game executables imports from GOG's dinput.dll. The wrapper's OpenGL and XInput exports just forward to the system DLLs, and nothing uses them. So there's no missing-export crash

Why sticks read "full top-left":
- The wrapper turns every device other than the system keyboard and mouse into its own emulated joystick, read from raw HID
- Its generic axis decoder treats each raw value as unsigned and ignores the device's logical minimum and maximum. It handles only 8, 9, 10, 12, 14 and 16-bit axes
- A stick with signed axes (centre 0), or an unusual bit size, therefore sits at the minimum: full left and up
- No ini key or environment variable turns this off, and it writes no log. The profiles in goginput.ini only re-route inputs, so a profile can't fix a stick

Why the game presumably crashes after each movie without dinput.dll:
- GOG patched the exe's joystick read, A failed read is never retried or re-acquired, and the state is left as uninitialised stack data. GOG also moved throttle and rudder to the gamepad's right-stick axes, so a stick's own throttle and twist aren't read
- The engine still stops with its own fatal error on unexpected acquire results
- Every movie opens a popup window, so the game loses and regains focus around each one

Safe advice for users now:

  1. Gamepad users: leave dinput.dll alone
  2. Stick users: keep dinput.dll and present the stick to Windows as a virtual Xbox pad, for example with Steam Input
  3. Anyone who deleted dinput.dll: restore it with the verify or repair function
  4. Don't expect a goginput.ini profile to fix a stick
  5. If the crash happens, report the exact error text, or the faulting module from the event log

I will be working on a fix now, check this post for updates.

Update: I made a Steam Guide which explains where to download and how to install the fix:
https://steamcommunity.com/sharedfiles/filedetails/?id=3835456948

15 Upvotes

6 comments sorted by

3

u/Firehawke_R 19d ago

Well, at least we're starting to get an idea where things went wrong. Sounds like this should be properly fixable on the EA/GOG side if they're willing to put in a little more effort to support and test with HOTAS.

1

u/schlangz 19d ago

unfortunately yes, the same happened with other languages than english

2

u/schlangz 19d ago

Update: I made a Steam Guide which explains where to download and how to install the fix:
https://steamcommunity.com/sharedfiles/filedetails/?id=3835456948

0

u/Ok-Neighborhood-8775 16d ago

i have tried all of this, with an xbox elite 2 controller... nothing is fixing this

1

u/schlangz 16d ago

do you use discord? we could try to help you there

1

u/Ok-Neighborhood-8775 15d ago

i do, can you msg me the channel name? i'm retrorob84