GROUPE STEAM
More Than 4 Local Multiplayer 5pluslocal
GROUPE STEAM
More Than 4 Local Multiplayer 5pluslocal
17
DANS UN JEU
159
EN LIGNE
Fondé le
27 janvier 2016
Langue
Anglais
How to get Steam Input to detect more than 4 XBox controllers [OBSOLETE]
EDIT: This is now obsolete
Just use the Extended Xbox Controller Support feature. If the game uses the SteamInput API then you are good to go. (Very few games do though.)


Steam Input currently has the limitation of only detecting 4XInput controllers so if you have more than 4 XBox360 controllers or XBoxOne controllers you'll only be able to use 4 of them with games using the Steam Input API even if the game claims to support more.
e.g. Super Bomberman R

Solution 1: Replace SDL2 in the Steam folder with one that uses RawInput
Jimbly has put modified SDL2 to use RawInput and if Steam uses it games that have Steam Input support can now access more than 4 controllers.

To make it easy to use the solution I've put together an automated script that:
* Closes Steam if it is running.
* Backs up the current SDL from the Steam folder.
* Replaces the SDL with Jimbly's SDL.
* Starts Steam with the -noverifyfiles option
* If the command window is left open after Steam closes it also restores the backed up SDL in case you want to have the original SDL as default. It's not needed since Steam restores the file automatically when Steam starts normally without the -noverifyfiles but it takes longer for Steam to start since a Steam update kicks in when it notices that the SDL is changed.

Here's the script if you want to take it for a spin: https://1drv.ms/u/s!AvTqYNMjugSugwFZ8V1A97x05vlf

It is our hopes that his changes will make it into the official SDL and by doing that make its way into Steam as well.

If you want to support Jimbly for his efforts I suggest buying his game: https://store.steampowered.com/app/467810/Splody/

And give him a shout out of appreciation in this thread :-)

Jimbly's SDL version is here: https://github.com/Jimbly/SDL/


Solution 2: Disable XInput for SteamInput (Does NOT work for XBox One pads)
As it turns out Steam uses SDL2 for its input so with the help of an environment variable you can make it access all gamepads via DirectInput instead of via XInput.

Note that when XBox 360 or XBox One controllers are accessed via DirectInput they:
* Don't have forcefeedback
* Triggers are on the same axis so games can't detect when both triggers are pressed
* Guide button does not work.

Option1: (Re)Start Steam with XInput off using my bat file
Download the bat file here: https://1drv.ms/u/s!AvTqYNMjugSugljzr20KpTJRYDOI
If your Steam is installed at another location than C:\Program Files\Steam just change line 2.
Run the bat file.

What the script does:
* Check if steam is running
* Kill Steam.exe
* Wait for all processes with Steam in the name to close.
* set the variable
* start Steam

If you start Steam without using this script Steam will have XInput on (unless you've fiddled with option 2 and set it in the environment variable).

Option 2: Using Environmnet Variables:
Environmnet variables are retained even after system reboot so you need to change the value every time you want to change it.

Create an environment variable called
SDL_XINPUT_ENABLED with value 0
(Change the value to 1 and restart Steam to change back to using XInput)

Option 3: Using a variable local to the cmd or powershell session:
Start up a cmd.exe
Type:
set SDL_XINPUT_ENABLED=0
start "" "C:\Program Files\Steam\Steam.exe"

This is what the script does to start steam. The advantage of using a "session" variable is that when you start up Steam in the regular way it will have XInput on.

Troubleshooting Solution 2
It works for wired Microsoft XBox 360 controllers but there is an issue for XBox One controllers since they can't be accessed in the background when using DirectInput so try solution 1.

(BUT even though XBox One controllers don't work via Steam Input with this solution it can still work with Steam input off for with games that use SDL2 directly. To test this set "Steam Input per-game setting" to "Forced Off" for that game.)

If you aren't trying to troubleshoot XBox One controllers for Solution 2 read on:
1. Check that the controllers are detected by Windows:
Press Windows button + R on the keybaord and then type joy.cpl

2. Check if the controllers are registered by Steam:
Go to Steam->Settings ->Controller->General Controller Settings
The controllers should be listed under Detected Controllers.

3. Does the game access controllers via the Steam Input API?
Some games do and some don't. (SuperBomerman R does)

4. Make sure the game does NOT have the "Steam Input per-game setting" set to "Forced Off".
If you're not in Big Picture Mode:
Go to Libraray
Right-click on the game and select properties
In the general tab check the value for "Steam Input per-game settings"
If the controllers are listed but don't work wtih a game that uses SteamInput to query controllers (like SuperBomberman R)

If you're in Big Picture mode:
Library->Find game-> Manage Game -> Controller Options
Make sure Steam Input Per-game settings is NOT set to "Forced Off".
Remember to click OK instead of backing out.

Thanks @Jimbly for pointing out that SDL Hints can be set using environment variables. Much simpler solution than recompiling SDL with XInput forced off.
Dernière modification de supersmo; 20 aout 2024 à 15h31
< >
Affichage des commentaires 31 à 45 sur 69
The original post is now updated with a solution for starting Steam with Jimbly's SDL2 file.
I've tested a bit and it works with XBox One and XBox 360 controllers.

@Jimbly: Thanks a million for the work you've put into fixing SDL2! Hope the modifications make it into the official SDL2 and later into Steam so evereyone gets the fix without having to use the scripts.
Jimbly a écrit :
Electron a écrit :
Do you have a patch for SDL that does this? I ship my own copy of SDL with my game so I could patch it.

Actually just published one today! Ended up settling on using RawInput as the most reliable way to get controller inputs from XInput-capable devices, correlated with XInput itself for the data that's missing.

I'm confident enough with it that I'm shipping it to my users, but it probably needs a little more testing, but you're welcome to give it a try.

Patches can be found on GitHub[github.com]. I've got some other patches to the version of SDL I use, but the specific patch for more than 4 XInput-capable devices is linked at the bottom.

Discussion about this on the SDL forums here[discourse.libsdl.org]. That's probably the best place to leave bug reports or feedback.

There's currently some wonkiness with Steam Controllers and other Valve virtual controllers, since Steam doesn't seem to provide RawInput messages when simulating controllers, so my patch currently just disables the new code (defaulting to 4 XInput devices) if one of those are detected.


Thank you a lot....it finally works using 6 xbox one controllers and 2 ps4 controllers!!
Jimbly a écrit :
Patches can be found on GitHub[github.com].

Trying to compile your your SDL fork, but I get some errors.

First I get:
src/joystick/hidapi/SDL_hidapi_xbox360.c:1040:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] SDL_bool has_trigger_data = SDL_FALSE;

I fixed that, but then I get
LTLINK build/libSDL2main.la libtool: link: warning: undefined symbols not allowed in i686-w64-mingw32 shared libraries LTLINK build/libSDL2_test.la libtool: link: warning: undefined symbols not allowed in i686-w64-mingw32 shared libraries LTLINK build/libSDL2.la *** Warning: Linking the shared library build/libSDL2.la against the non-libtool *** objects build/version.o is not portable! /usr/local/Cellar/mingw-w64/5.0.4_1/toolchain-i686/bin/i686-w64-mingw32-ld: build/.libs/SDL_windowswindow.o: in function `SDL_HelperWindowProc': /Volumes/Home/electron/SDL2-Jimbly/src/video/windows/SDL_windowswindow.c:814: undefined reference to `RAWINPUT_WindowProc' collect2: error: ld returned 1 exit status make: *** [build/libSDL2.la] Error 1
Hmm, I've only built with Visual Studio (should compile fine with the free VS Community Edition), didn't actually realize the Windows SDL could be made on anything else! I'm guessing mingw has some different rules. For the link error, sounds like maybe a Makefile didn't pick up the new src/joystick/windows/SDL_rawinputjoystick.c . Any further discussion we should probably do on GitHub, not hijack this thread too much more =).
Yeah I make games for Windows but I'd never use Windows on a machine I actually had to get work done on. I always cross-compile everything on Mac or Linux and SDL works fine.

I will summit an issue on GitHub if you enable the issue tab for the repo.
Electron a écrit :
Yeah I make games for Windows but I'd never use Windows on a machine I actually had to get work done on. I always cross-compile everything on Mac or Linux and SDL works fine.
I'm exactly the same way, except I cross compile from Windows to Linux and Mac =). Good to stick with what you know and are efficient with.

Electron a écrit :
I will summit an issue on GitHub if you enable the issue tab for the repo.
Huh, I had no idea you could turn the issues tab off, or that it was off by default (because the repo is a fork, I bet!). It's on now, sorry.
Ha, sorry, I wasn't trying to start an OS flame war :-) It's interesting that you do Linux and Mac releases, do you get many users? I have heard the percentage is so low that it's not worth the effort on Steam.
Also I have a related problem here, maybe you can help! https://steamcommunity.com/app/664240/discussions/2/2806204040003761235/
Electron a écrit :
Ha, sorry, I wasn't trying to start an OS flame war :-) It's interesting that you do Linux and Mac releases, do you get many users? I have heard the percentage is so low that it's not worth the effort on Steam.
For Splody, Steam reports it's about 5% of my sales, ~3% Mac, ~2% Linux, but the Linux users are way more friendly/talkative - I think I've only interacted with a single Mac user! The sales are probably not worth the effort, however most of the work required I needed to do for my PlayStation 4 port anyway (PS4 builds through Visual Studio, but using Clang, so needed everything to be written in a cross-platform way). I use OpenGL and I obviously use SDL for input, so that took care of most problems on Mac/Linux without much effort. Honestly for Mac I spent longer getting cross-compiling from Windows set up and working than I did on any "actual" work ;).

Also, though Steam does report to me "sales by platform", I can't really count that as how much my sales were impacted - I think the report is basically "what platform were they on when they clicked Buy", and a lot of Mac/Linux people I know jump into Windows from time to time, especially when gaming, however, even when they're in Windows, they're still much more likely to buy a game if it says it supports Mac/Linux. I'd guess maybe the actual effect is closer to 10%. However, that's still pretty small, and compared to my sales numbers that's within noise values, so I don't have any conclusive data.
Im a total noob with all this, can someone explain how to do this or send a link to a tutorial? Thanks :')
TimeWaster a écrit :
Im a total noob with all this, can someone explain how to do this or send a link to a tutorial? Thanks :')
The original post here has been edited with step by step instructions, just follow one of those =). If you don't have any XBox One controllers, Solution #2-Option #1 is simplest (just exit Steam, download and run that file).
Hello! :) I have 6 Xbox One controllers connected to one wireless adapter. I tried using the script mentionned at the beginning of this discussion. After using it, Steam Big Picture does recognise all 6 inputs. However, none of my games do.

Somebody mentionned a patch for the script that could maybe solve this issue? Has the script linked at the beginning of the discussion been patched already? Otherwise I,m not sure how to get the pacth and add it. I followed the Git Hub link but didn't know what to download or how to compile things and what not. I'm just not that tech savy! :P

Any help would be welcome! Thanks guys! :)
Not quite sure which script or which option you're referring to, but I think all of the "Solution #2" options won't work with Xbox One controllers. The "Solution #1" (replace Steam's SDL2.DLL and tell Steam not to put it back) should work fine, although I haven't tried myself in a couple months. I think the version linked above should work, but if you want to grab the latest DLL from GitHub, the one Steam needs is https://jimbly.github.io/SDL/SDL2Win32Release.dll.
If you see 6 controllers in Steam Big Pucture you’ve correctly applied sollution 1 which uses Jimbly’s SDL2.dll.

That said, these solutions won’t work for all games. They should work if the game uses the Steam Input API (which most games don’t) and Steam also needs to be configured to use Steam Input for the game.

These solutions are not the first things I try when I try to get a game to work with more than 4 controllers.

Generally I disable Steam Input for the game and see if the game has native support for more than 4 controllers.
In order to do this I set the Steam input per game setting to “Forced off”.
Then I test if it works and if it doesn’t, I look for an in game setting to “Disable XInput”.

If it still doesn’t work I look into solutions like these.

Which games are you trying to get to work with the controllers?
Dernière modification de supersmo; 7 janv. 2020 à 16h07
Yes, I see now that it's really a question of games using steam input or not. Because I did manage to use all 6 controllers with Screen Cheat, but couldn't make it work in Brawlhalla, Bossgard or Mage Quit.

I tried what was suggested above. Steam input Forced off, Steam Input Forced On, Xinput turned off. The first 2 change nothing. And disabling Xinput makes all Xbox controllers unusable.

From what I read online, Microsoft has removed the 4 controller limitation that Xinput had. It's not a problem anymore on Windows. So the problem is with Steam.

I opened a ticket about it and they said "At this time, the Steam Client has yet to update it's X-input for more than four controllers at a time. (...) Please keep an eye on the Steam Client Discussion forums for future updates." I hope they fix this soon. I spent a lot of money on these controllers without knowing about this problem.

Anyways, thanks for the help guys. I think I'll just get cheap generic controllers in the meantime.
< >
Affichage des commentaires 31 à 45 sur 69
Par page : 1530 50