Xidi icon indicating copy to clipboard operation
Xidi copied to clipboard

Alias Gamepad configuration still merging analog and triggers

Open gordonfreeman01 opened this issue 11 months ago • 8 comments

Hi, I'm using Xidi's latest version 4.2.0 on the game Alias (https://www.pcgamingwiki.com/wiki/Alias). When using a Dualshock 4, it has the problem of triggers acting as Z-rotation making gameplay impossible natively. It retains this behaviour after applying Xidi 32-bit. The game has a main EXE which calls a configuration exe when setting up controls (it can be run separately). The configuration exe seems to be running dinput.dll and winmm.dll (dinput8.dll freezes the configuration utility when attempting to configure the controller). I tried using the Xidi hook method as well and it doesn't work. I tried using another tool - Gamepad Phoenix - and its logs show an attempt to call dinput but it freezes the app when it applies its own method to intercept the dinput call in the config utility.

I would be most grateful if this issue can be fixed and would love to provide any additional information that might help.

gordonfreeman01 avatar Jul 26 '23 00:07 gordonfreeman01

Dualshock controllers don't natively support XInput. I suspect Xidi probably isn't getting between the game and your controller at all.

If you want to check, enable logging and run the game with Xidi, then upload the log here. To enable logging, add this to your Xidi.ini configuration file:

[Log]
Enabled                             = yes
Level                               = 4

samuelgr avatar Sep 08 '23 01:09 samuelgr

Dualshock controllers don't natively support XInput. I suspect Xidi probably isn't getting between the game and your controller at all.

If you want to check, enable logging and run the game with Xidi, then upload the log here. To enable logging, add this to your Xidi.ini configuration file:

[Log]
Enabled                             = yes
Level                               = 4

Xidi_WinMM_alias.exe_8300.log

You're likely right, here's the attached log and while I did have inputs for at least a few minutes after the last log entry nothing is registered as per the logs attached above. Is there any way to have DS4 support in Xidi?

I found a solution for the controller using DS4Windows: under the "Settings" tab enable "Hide DS4 controller" then under the "Controllers" tab select the Xbox360 profile (create it if missing).

gordonfreeman01 avatar Sep 08 '23 15:09 gordonfreeman01

Looking at your WinMM log - it doesn't appear that the game uses WinMM to talk to game controllers. Based on your first comment:

(dinput8.dll freezes the configuration utility when attempting to configure the controller)

This game probably uses dinput8.dll. Most interesting would be a log file captured while using the dinput8.dll form of Xidi, even if the game or configuration utility freezes.

samuelgr avatar Sep 08 '23 23:09 samuelgr

Xidi_DInput8_alias.exe_22368.log Xidi_DInput8_Configuration.exe_6692.log Xidi_DInput8_alias.exe_22284.log Xidi_DInput8_alias.exe_20036.log

Here's a few runs of the main game and one for the config utility. Hopefully this helps!

gordonfreeman01 avatar Sep 09 '23 17:09 gordonfreeman01

Could you also please try dinput? I don't see any evidence of communication with Xidi's dinput8 form from those logs.

samuelgr avatar Sep 13 '23 04:09 samuelgr

I tried with dinput alone and no logs were being generated. However, the pad itself was also not working which was strange. It might have something to do with DS4Windows which I was messing around with just before testing so will try again later.

gordonfreeman01 avatar Sep 14 '23 18:09 gordonfreeman01

I did some digging into this game. It uses dinput8.dll with no need for the hook module version. The reason it isn't getting anywhere is that it tries to enumerate controllers in a technically-supported but unusual way, which Xidi does not currently implement.

First, it creates the DirectInput interface object (this shows in the logs). Then it tries to enumerate devices by calling this method:

HRESULT EnumDevicesBySemantics(
         LPCTSTR ptszUserName,
         LPDIACTIONFORMAT lpdiActionFormat,
         LPDIENUMDEVICESBYSEMANTICSCB lpCallback,
         LPVOID pvRef,
         DWORD dwFlags
)

The corresponding implementation in Xidi at the moment:

template <ECharMode charMode> HRESULT __stdcall WrapperIDirectInput<charMode>::
      EnumDevicesBySemantics(
          DirectInputType<charMode>::ConstStringType ptszUserName,
          DirectInputType<charMode>::ActionFormatType lpdiActionFormat,
          DirectInputType<charMode>::EnumDevicesBySemanticsCallbackType lpCallback,
          LPVOID pvRef,
          DWORD dwFlags)
  {
    // Operation not supported.
    return DIERR_UNSUPPORTED;
  }

Since it isn't supported in Xidi at the moment, the call fails, so the game does not end up using the DirectInput interface and thus controllers can't be configured.

I'll need to learn more about this style of enumeration and figure out if/how it can be supported in Xidi.

samuelgr avatar Sep 17 '23 17:09 samuelgr

Ok great, please let me know if I can supply anything else on my end to assist with this.

gordonfreeman01 avatar Sep 18 '23 00:09 gordonfreeman01