Hard Light Productions Forums

General FreeSpace => FreeSpace & FreeSpace Open Support => Topic started by: Yarn on March 21, 2017, 06:19:10 pm

Title: Anyone else unable to use XInput controllers in recent nightlies?
Post by: Yarn on March 21, 2017, 06:19:10 pm
By "XInput controller," I'm referring to Xbox One and Xbox 360 controllers as well as other controllers that use the XInput standard (such as the Logitech F710 in XInput mode).

I noticed today that I'm unable to use any XInput controllers an any nightly build since SDL Everywhere was merged (July 18, 2016 and later). I can select the controller in wxLauncher, but the game doesn't seem to utilize it at all, neither on the control configuration screen nor in a mission.

I've attached a log that was produced by running the game with my Xbox 360 controller selected. Here's the part of the log regarding controller initialization:
Code: [Select]
Initializing Joystick...
Printing joystick info:
  Joystick name: XInput Controller #1
  Joystick GUID: 78696E70757401000000000000000000
  Joystick ID: 0
  Joystick device ID: 0
  No joystick is being used.

  Initializing Haptic...
  Available haptic devices:
    XInput Controller #1
 missing constant effect
 missing sine effect
 missing sawtoothdown effect
 missing spring effect
    ERROR: Haptic joystick does not support the necessary effects

So, yeah, as it says, the game isn't using the controller.

DirectInput controllers still work.

(I'm running Windows 7 SP1 64-bit, by the way.)

[attachment stolen by Russian hackers]
Title: Re: Anyone else unable to use XInput controllers in recent nightlies?
Post by: krevett62 on March 22, 2017, 02:53:41 am
Hi I had the same issue... I must use the "Store config in portable location" option in order to have my xinput controller to work ingame!
Title: Re: Anyone else unable to use XInput controllers in recent nightlies?
Post by: AdmiralRalwood on March 22, 2017, 06:56:18 am
Which version of wxLauncher are you running?
Title: Re: Anyone else unable to use XInput controllers in recent nightlies?
Post by: krevett62 on March 22, 2017, 07:02:53 am
I'm using the latest 0.12_RC2 For Yarn I don't know but my system specs are similar I'm on Win7 pro 64bits
Title: Re: Anyone else unable to use XInput controllers in recent nightlies?
Post by: AdmiralRalwood on March 22, 2017, 07:04:28 am
What are the joystick settings set to in your fs2_open.ini?
Title: Re: Anyone else unable to use XInput controllers in recent nightlies?
Post by: krevett62 on March 22, 2017, 09:29:08 am
I already posted about this issue but did not get an answer.
Curent joystick ID is set to 000000000000000000000000.

If I use portable location it works, but if I copy the fs2open.ini to my portable location (root folder), then my joystick stops working, that's weird!
Using 3.7.4 there's no such problem.
Title: Re: Anyone else unable to use XInput controllers in recent nightlies?
Post by: Yarn on March 30, 2017, 02:28:48 pm
I figured out that the problem is in wxLauncher, not FS2 Open.

When fs2_open.ini is written, two fields have to be properly set to select a joystick: CurrentJoystick, which is the index of the joystick (0 for the first one, 1 for the second, and so on); and CurrentJoystickGUID, which appears to be an identifier for the joystick consisting of 32 hexadecimal digits. In the case of XInput devices, wxLauncher is setting the latter field to 00000000000000000000000000000000 instead of the correct value (78696E70757401000000000000000000 in my case). I will let the wxLauncher team know about this.

In the meantime, here's how to get XInput devices working in recent builds of FSO:
Title: Re: Anyone else unable to use XInput controllers in recent nightlies?
Post by: jg18 on May 18, 2017, 12:34:45 am
I posted (http://www.hard-light.net/forums/index.php?topic=67950.msg1848369#msg1848369) in the wxL release thread that I can take a look at this.

As mentioned there:

I'll need some information from a coder who's familiar with the FSO input control code, specifically:

- which platforms this issue applies to (presumably all)
how to get the joystick/controller GUID, since FSO must do it somewhere. Presumably it's an SDL2 API call.