Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SteamInput can fail on Windows #98208

Open
lrahmann opened this issue Oct 15, 2024 · 2 comments
Open

SteamInput can fail on Windows #98208

lrahmann opened this issue Oct 15, 2024 · 2 comments

Comments

@lrahmann
Copy link

Tested versions

4.dev [6699ae7]

System information

Godot v4.3 - Windows 10 D3D12 (Forward+)

Issue description

There are multiple bugs when using Steam Input with Godot under Windows currently.

  • Godot will not always use XInput for these controller even tough Steam will provide a XInput API for them.
    joypad_windows.cpp#L101
    Does use a fixed list of inputs for which XInput is enabled. Nintendo Switch controllers are missing from this list for example.
    (There are probably more of these as the list passed from steam via SDL_GAMECONTROLLER_IGNORE_DEVICES contains a lot of different pid & vid values).
    Additionally, at least when using the joy-con charger via USB, the pid variable reported in this function by using the GUIID is different from the one steam provides (0x200e vs 0x2007).
    Using Steam Input for some controllers is mandatory at the moment until SDL will be used within Godot, as DirectInput will not only not work for these controllers but provide random garbage inputs and smashing random buttons.
    Nintendo Switch Pro Controller doesn't work  #81191. Which if not handled will create a lot of issues for players which may not even notice that a Switch controller is connected. (E.g. for us its was quite quick in selecting the "Exit Game" option in the menu)

  • JoypadWindows::process_joypads()
    may be called to late or not often enough when using Steam Input. This issue is for some reason only present in the D3D12 backend and results in duplicate controllers as well as missing ones. While adding a removal option here is relatively easy the doc explicitly states that one should not call this api too often when no controller is connected on a specific slot MicrosoftDocs

Both of these will probably be obsolete when using SDL for controllers instead of XInput/DirectInput so I'm not sure if worth it to be fixed. But as a lot of games will be using Steam on Windows for distribution and may run into this issue aswell.

Steps to reproduce

For Steam Input to be active the game needs to be run via Steam (either as a game on Steam or using the "Add a Non-Steam Game to My Library" functionality.

Minimal reproduction project (MRP)

Any recent Godot game will do. If needed I can provide a Steam App with a special branch for this issue.

@lrahmann lrahmann changed the title [] SteamInput can fail on Windows SteamInput can fail on Windows Oct 15, 2024
@Calinou
Copy link
Member

Calinou commented Oct 16, 2024

As a workaround, players can set up Valve Plug to forcibly disable Steam Input.

@lrahmann
Copy link
Author

Sadly not because of #81191 otherwise we could disable Steam Input via the backend as a default.
Getting players to setup Valve Plug is probably to technical and also not all players with this issue contact us directly.
I made a workaround around the issue in our fork but its more of a hack, regularly polling the XInput API to check if controller state changed somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants