Problem with multiple gamepads (they act as one gamepad)

mX273

Member
Hi Guys

I have a strange problem with my gamepads. I use 8 Gamepads called "MICREAL Wireless Controller" which are configured as XInput Controllers.
In the configuration of windows, they all work correctly and independent:
Gamepads.png

I wrote a little Testprogram to find out, which gampad uses which slot:

GML:
for (var i = 0; i < 12;i++)
{
    for (var k = gp_face1; k < gp_axisrv; k++)
    {
        if (gamepad_button_check(i, k))
        {
            draw_text(50 + i*40,100, string(i))
        }
    }
}
when i press a single button of a single gamepad, i get many slots at the same time. For example "4 5 6 7 8 ". If i unplug some of them, then plug it in again and restart the application, there are sometimes oher gamepads linked together. Very strange.
I didnt find a rule. The problem seems to be in game maker, because in the windows dialog they always work correctly. I also tried it when I configured some of them (up to 4) as XBox 360 controller) - same problem.

Can you help me?

Kind regards

mX273

can you help me
 

kburkhart84

Firehammer Games
I don't know what is going on for sure with your pads. But I CAN tell you that XInput only supports 4 devices(IDs 0 to 3). I can ALSO tell you that normal XBOX gamepads also show up as DirectInput devices, and so it is normal for those to show up both as some device between 0 and 3 and then ALSO show up as something between 4 and 11. It is certainly possible that your gamepads are doing something similar.

In my input system, I handle that by storing a device id along with the actual input(button/axis) as they get assigned to actions. I don't assign gamepads to players, rather individual actions. So a given action(like player 1's jump action) knows it is using gamepad 2, button 5, and so on and so on. The player has to actually hit the button to assign it to the action. By forcing the actual input to happen to assign it, my input system can check for the XINPUT versions first(IDs 0 to 3), and then checks the rest of the indices. This means that even if the device comes up multiple times, it registers the better version first(XINPUT has better support, and the DInput version has certain gotchas/glitches).

So indeed, if you are running into the same thing I am referring to, the solution is simply to ignore the gamepad IDs higher than 3 if you detect multiple at the same time. If however you are finding multiple with both values higher than 3 and NONE below 3, then you have a completely different issue.
 

mX273

Member
Ok, thank you for that info! I didnt know that it is normal for some gamepads to use 2 slots at the same time. Sorry, in this case i wrote it wrong. they are usually configured as DirectInput device (Slot 4..11). To change my input configuration like your description, it would be a huge effort now... i use gamepad-objects which are linked with a player-object by a reference.
Strange is, that there are sometimes used so many slots for 1 gamepad (e.g Slot 4, 5, 6, 7 and 8) - so i dont think it is the same issue as you described (with a single XInput and DirectInput Slot).
 

kburkhart84

Firehammer Games
Ok, thank you for that info! I didnt know that it is normal for some gamepads to use 2 slots at the same time. Sorry, in this case i wrote it wrong. they are usually configured as DirectInput device (Slot 4..11). To change my input configuration like your description, it would be a huge effort now... i use gamepad-objects which are linked with a player-object by a reference.
Strange is, that there are sometimes used so many slots for 1 gamepad (e.g Slot 4, 5, 6, 7 and 8) - so i dont think it is the same issue as you described (with a single XInput and DirectInput Slot).
If there is more than 2 being used, and they are all over 3(as in 4 - 12), then certainly it isn't the issue I brought up. I've never seen this issue myself honestly. Though I've never tried 8 identical gamepads on the same system either. I've done several gamepads all at once, but all different(except I've used multiple gamecube ones connected through an adapter that has 4 gamecube controller ports). I've never had issues with gamepads showing up separately though.
 

mX273

Member
It seems so. Anyway, how could i save and reload the input configuration? Unfortunately the IDs of all 8 Gamepads are the same and the Slots are not always the same (for example after a reboot of my computer, they can change).
 

kburkhart84

Firehammer Games
My input system currently does it just using the gamepad id(which rarely changes in my experience, even after reboots, though it happens every now and then). However, my next update is going to have it use GUIDs instead so that if the normal ids change I'll be able to detect that. It wouldn't help in your case since you seem to have a bigger issue though. You may have to do something much less extreme as using 8 identical gamepads unless you can figure out how to get around that issue.
 
However, my next update is going to have it use GUIDs instead so that if the normal ids change I'll be able to detect that. It wouldn't help in your case since you seem to have a bigger issue though.
If they're really identical controllers, they'll have the same GUID.
One of the thing is he's trying to use 8 DirectInput controllers as Xinput, which only 4 can be supported. That can only do no good.
Another thing to look for would be if the USB receiver can actually manage 8 controllers?
First, I would ditch all Xinput conversion, reboot the machine, and if that doesn't solve it, look at the hardware documentation online. This may not be GMS-related at all.
 

FoxyOfJungle

Kazan Games
when i press a single button of a single gamepad, i get many slots at the same time. For example "4 5 6 7 8 ". If i unplug some of them, then plug it in again and restart the application, there are sometimes oher gamepads linked together. Very strange.
I didnt find a rule. The problem seems to be in game maker, because in the windows dialog they always work correctly. I also tried it when I configured some of them (up to 4) as XBox 360 controller) - same problem.

The simplest approach is for you to check if the joystick is connected:

GML:
for (var i = 0; i < 12; ++i;)
{
    if gamepad_is_connected(i)
    {
        key_1 = gamepad_button_value(i, gp_face1);
        key_2 = gamepad_button_value(i, gp_face2);
    }
}
And you don't need two for loops for that.
 

kburkhart84

Firehammer Games
If they're really identical controllers, they'll have the same GUID.
One of the thing is he's trying to use 8 DirectInput controllers as Xinput, which only 4 can be supported. That can only do no good.
Another thing to look for would be if the USB receiver can actually manage 8 controllers?
First, I would ditch all Xinput conversion, reboot the machine, and if that doesn't solve it, look at the hardware documentation online. This may not be GMS-related at all.
I think the OP said they miswrote, and that it was all DirectInput devices instead of XInput. That's why I I mentioned my original response about double detection between DInput and XInput as well.

Take a look at Input by Juju and save yourself a ton of headaches.
Doesn't that still use native GML and just add stuff on top of it. Unless I'm wrong about that, it won't fix the issue so easily since GM itself is somehow detecting inputs on multiple gamepad IDs. My input system wouldn't fare any better for the same reason, since it uses GML only and just adds on top of it. If I'm wrong and Juju's system does more than what is available in vanilla GML, then there is that.
 

rIKmAN

Member
Doesn't that still use native GML and just add stuff on top of it. Unless I'm wrong about that, it won't fix the issue so easily since GM itself is somehow detecting inputs on multiple gamepad IDs. My input system wouldn't fare any better for the same reason, since it uses GML only and just adds on top of it. If I'm wrong and Juju's system does more than what is available in vanilla GML, then there is that.
I've tested 4 XB1 controllers that all identify identically in Windows and they all work fine and independently in the multiplayer test case example that is part of Input (once I added code to check extra controllers which is a couple of lines) as well as K&M at the same time.

If the issue is that which Slow Fingers mentioned re: XInput however then that's different.

Either way it would take less than 5mins to download Input and run the multiplayer example and see - maybe 10mins to duplicate some code and tweak some values to allow testing for 8 controllers.

If it works then all the hassle it saves will be worth the time spent testing it out as it handles hotswapping, rebinding, input assignments, has an input history, double press detection all built in etc and supports loads of controllers out of the box as it uses the SDL2 Game Controller Community DB.

It's awesome and I can't recommend it enough - well worth 5mins of OPs time to see if it solves their issues.
 
I think the OP said they miswrote, and that it was all DirectInput devices instead of XInput. That's why I I mentioned my original response about double detection between DInput and XInput as well.
Yeah, I just saw that. Well, this is one less thing to worry about!

@mX273: when you say it 'would require a major effort', that raises some questions on my end. Like, did it work and now it's broken? Or did you move on to other stuff knowing the input system was broken? Is this just happening with this particular combination of controllers? Did you try to add multiplayer code after most of the game was completed?
If we knew a little more about the backstory, that would very much help us help you.
 

mX273

Member
Thany you so much for your reply.
Ok im going to ckeck the input system of juju.

The problem is that i already designd my game menu like this. Every player who wants to play in the next game battle has to press start. Then a obj_gamepad object with the corresponding slot is generated... the menu and animations and so on are already generated.
It sometimes works with 8 controllers the way i like, so i thought i could solve that problem later :-(
 

mX273

Member
Unfortunately I can't check the input system of juju, because i still work with version 2.2.5 until my game is finsihed.
I found out, that close and start the game helps sometimes with the multiple slots used for a single controller. A game_restart() doesnt help. i have to close it manually first :-/

any ideas why?
 

rIKmAN

Member
Unfortunately I can't check the input system of juju, because i still work with version 2.2.5 until my game is finsihed.
Ah that's a shame - there is a legacy version of Input that works with 2.2.5 if you still wanted to try it: https://github.com/JujuAdams/input_legacy
It no longer receives updates but I don't remember there being any massive issues with it (though I may be wrong) - would still be worth a try just to see if it works with your 8 controllers and rule out a system / OS level problem.
 

rIKmAN

Member
Thank you!! Im going to test it!
Cool, let us know how it goes.
I'm not sure if the legacy 2.2.5 version has the same features/functionality at the latest 2.3 version or has the built in test cases, so it may be a bit more work to setup a test for the 8 controllers and it ultimately might not work at all.
As I say it's worth testing though for the headaches it could save later if it does work. Nothing gained, nothing ventured and all that.

EDIT:
Just had a quick chat with Juju and he said it should be fine given they are DInput controllers.
Specify the maximum number of players in the config and each function takes a playerIndex as an argument.

As I said though you will probably have to code the test cases yourself as they aren't included in the legacy version by default so it might take a bit more time.
 
Last edited:

mX273

Member
can you give me a tip. I dont understand what that example should help. I didn't find a multiplayer example. only an example
which recognizes if a gamepad is connected. Then it ask i would like to swap it? huuuh? swap with what?
By the way i extended it from 2 to 8 players:
input_set_max_players(8);
But I can't see any difference... there is only one ball which i can control with one of the gamepads.

input.png

Can you help me?
 

rIKmAN

Member
can you give me a tip. I dont understand what that example should help. I didn't find a multiplayer example. only an example
which recognizes if a gamepad is connected. Then it ask i would like to swap it? huuuh? swap with what?
By the way i extended it from 2 to 8 players:
input_set_max_players(8);
But I can't see any difference... there is only one ball which i can control with one of the gamepads.

View attachment 40521

Can you help me?
Yeah I just edited my last post as you posted - the legacy version doesn't have the multiplayer test cases in it, so you would have to write the code yourself to set it up and test them.
I haven't used the legacy version for a long time, but from memory it's just a an example to allow you to hotswap controllers, you'd need to edit/write your own code to allow 8 simultaneous pads controlling a ball each.
 

rIKmAN

Member
ohhh.... what a pitty. ok thanks a lot anyway!
Okay so I spent some time modifying the legacy example for you to allow 8 players to be connected - though I could only test with 4 as I only have 4 XB1 controllers handy, however it should work with upto 8.

I DM'd you the link to the project.

1) Run the project
2) Connect your pads one by one - the message that pops up is for debug purposes so click "Yes" and a new player will be added to the game.
If they are already connected when you start the game then the dialog will still popup - again click "Yes" to add the player to the game.
3) Do this for upto 8 controllers - each ball will be controlled by adifferent pad and are all marked on screen as to what player they are.
4) If you disconnectany pad a debug message will popup telling you what player disconnected, and that player will be removed from the game.

You can try disconnecting/reconnecting different pads and see what happens, I didn't do too much testing with that but it appeared to work fine and slots were freed and re-populated when reconnectiong without any issues.
Take a look at the modified code and it should give you a gopod idea of how to implement it into your existing game.

Let me know if it works for all 8 of your controllers or not - hope it helps!
 

mX273

Member
thank you so much for your effort! i only could test it with my beta version v2.3. there is an error as soon as i connect the first gamepad:
error.png
 

rIKmAN

Member
thank you so much for your effort! i only could thest ist with my beta version v2.3. there is an error as soon as i connect the first gamepad:
View attachment 40531
You said you were using v2.2.5, so I edited the legacy 2.2.5 version - load it into 2.2.5, it won't work in 2.3 due to the changes between versions.

If you are able to use v2.3 then just download the latest version as I said about 8 posts back and you could have saved me the time!
 

mX273

Member
1.png

I dont know what i did wrong the last time. A double click on the *.yyz file opens it in my beta 2.3. If i drag n drop it into my gm 2.2.5 i can import it (didnt work the last time).
Anyway, I could control up to 4 players. On some connected gamepads an error occured as in the screenshot above. any ideas?
 

rIKmAN

Member
View attachment 40534

I dont know what i did wrong the last time. A double click on the *.yyz file opens it in my beta 2.3. If i drag n drop it into my gm 2.2.5 i can import it (didnt work the last time).
Anyway, I could control up to 4 players. On some connected gamepads an error occured as in the screenshot above. any ideas?
No but I noticed that the first 4 slots are empty in the text in the top left.
If you disconnect all controllers, run the game and then connect them one by one, do they get connected starting from 0 or from 4?

I used 4 XB1 controllers and they connected from 0-3 (the top 4 lines in the debug text at the top left) but I only have those 4 controllers handy to use so couldn't test anymore than that.
 

mX273

Member
error1.png


There are no slots used from 0...3. only higher or equal 4 (4...11). The upper 4 numbers stay -1. It pop up the message box and if I click "yes" the error (last post) occurs on the last 4 gampads I try to connect.
I forgot to say, there was an error after the import (picture above).
I'm going to get some sleep now. checking tomorrow for more replys. thank you and good night :)
 
Last edited:

rIKmAN

Member
View attachment 40536


There are no slots used from 0...3. only higher or equal 4 (4...11). The upper 4 numbers stay -1. It pop up the message box and if I click "yes" the error (last post) occurs on the last 4 gampads I try to connect.
I forgot to say, there was an error after the import (picture above).
I'm going to get some sleep now. checking tomorrow for more replys. thank you and good night :)
To save wasting any more time as we just want to establish whether it will actually work - now you have said you do actually have access to v2.3 then just download the latest version of Input and test that.

There is an "obj_test_mp" object in the "Test Cases" folder that you can drag into the room, modify easily enough to check for 8 players and that should tell us whether it's worth persuing or not. Remember to delete the existing "rm_example" from the room when adding "rm_test_mp".

EDIT:
I DM'd you another link to a modified project to test before you try the v2.3 version of Input.
 
Last edited:

mX273

Member
No I have no access to v2.3, only v2.3 BETA which runs in a seperate installation directory. If i would update to 2.3,(not Beta) my 2.2.5 Version would be overwritten.
I tested your modified version of the input system (v2). After i say "yes" to the fifth controller it pops up the following error:

error.png
 

rIKmAN

Member
No I have no access to v2.3, only v2.3 BETA which runs in a seperate installation directory. If i would update to 2.3,(not Beta) my 2.2.5 Version would be overwritten.
I tested your modified version of the input system (v2). After i say "yes" to the fifth controller it pops up the following error:

View attachment 40546
We're just trying to see if Input would work for your purposes at the moment and whether it's worth persuing over your previous method so feel free to try the 2.3 version of Input in the 2.3 beta.
I don't have 8 DInput controllers so it makes it difficult to make quick changes/edits in response to errors like I could if I did have them handy.

In saying that, try setting input_set_max_players to 12, disconnecting all controllers, running the program and connecting them one by one again.
It's likely my quick edits that are issue as they were made without being able to test them - I have 4 XInput pads.

There's no need to post pictures of the error message, just copy the text and paste that in a code tag.
 

mX273

Member
i tried it in the beta. as soon as i connect the first controller the following error occur:

___________________________________________
############################################################################################
ERROR in
action number 1
of Async Event: System Event
for object obj_input:

Unable to find a handler for exception { longMessage : ERROR in
action number 1
of Async Event: System Event
for object obj_input:

illegal array use
at gml_Object_obj_input_Other_75 (line 6) - if (gamepad_device < 0)
, script : gml_Object_obj_input_Other_75, line : 6, stacktrace : [ "gml_Object_obj_input_Other_75 (line 6)" ], message : illegal array use }
NO CALLSTACK
at gml_Object_obj_input_Other_75 (line 6) - if (gamepad_device < 0)
############################################################################################
gml_Object_obj_input_Other_75 (line 6)
 

rIKmAN

Member
i tried it in the beta. as soon as i connect the first controller the following error occur:

___________________________________________
############################################################################################
ERROR in
action number 1
of Async Event: System Event
for object obj_input:

Unable to find a handler for exception { longMessage : ERROR in
action number 1
of Async Event: System Event
for object obj_input:

illegal array use
at gml_Object_obj_input_Other_75 (line 6) - if (gamepad_device < 0)
, script : gml_Object_obj_input_Other_75, line : 6, stacktrace : [ "gml_Object_obj_input_Other_75 (line 6)" ], message : illegal array use }
NO CALLSTACK
at gml_Object_obj_input_Other_75 (line 6) - if (gamepad_device < 0)
############################################################################################
gml_Object_obj_input_Other_75 (line 6)
As I said before the 2.2.5 project won't work in the v2.3 beta - I meant download the 2.3 version of Input and try that in the Beta.

However - in v2.2.5 of the IDE, load the last modified project I sent you (v2) and try changing input_set_max_players to 12, disconnect all controllers, run the project and then reconnect them one by one and see if that changes anything with regards to the error you posted in post #30
 

mX273

Member
Hi rIKmAN. Sorry for my late reply... couldn't test it earlier...

Version 2.3 of Input in my 2.3 Beta has compile errors:
GML:
Skript: __input_gamepad_set_mapping in Zeile 34 : Token is undefined at CompileStatement
Skript: __input_load_blacklist_csv in Zeile 26 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 31 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 35 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 48 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 52 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 58 : Hex number $ has an illegal format
Skript: input_history_global_include in Zeile 9 : Hex number $ has an illegal format
Skript: input_xy in Zeile 41 : Hex number $ has an illegal format
Skript: input_xy in Zeile 42 : Hex number $ has an illegal format
Skript: input_xy in Zeile 43 : Hex number $ has an illegal format
Skript: input_xy in Zeile 44 : Hex number $ has an illegal format
Skript: __input_class_verb in Zeile 54 : Hex number $ has an illegal format
Skript: __input_fix_config_struct in Zeile 10 : Hex number $ has an illegal format
Skript: __input_fix_config_struct in Zeile 19 : Hex number $ has an illegal format
Skript: __input_fix_config_struct in Zeile 28 : Hex number $ has an illegal format
Skript: __input_fix_config_struct in Zeile 29 : Hex number $ has an illegal format
Skript: __input_gamepad_set_mapping in Zeile 34 : unexpected symbol "=" in expression
Skript: __input_gamepad_set_mapping in Zeile 34 : malformed assignment
Skript: __input_sdl2_database_funcs in Zeile 231 : Hex number $ has an illegal format
Skript: __input_sdl2_database_funcs in Zeile 235 : Hex number $ has an illegal format
Skript: input_default_gamepad_swap_ab in Zeile 7 : Hex number $ has an illegal format
Skript: input_default_gamepad_swap_ab in Zeile 15 : Hex number $ has an illegal format
Skript: __input_load_type_csv in Zeile 119 : Hex number $ has an illegal format
Skript: input_bindings_reset in Zeile 63 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 15 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 16 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 17 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 18 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 67 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 68 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 69 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 70 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 71 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 138 : Hex number $ has an illegal format
Skript: __input_gamepad_set_type in Zeile 36 : Hex number $ has an illegal format
Skript: input_ignore_key_add in Zeile 13 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 22 : Hex number $ has an illegal format
--------------------------------------------------------

Input_V2 in IDE 2.2.5:
error.png
with "input_set_max_players(12);" i could connect 8 gamepads without the error posted in post#30.
But then i could control all Balls together with a single gamepad :-/. Any ideas?

First i thougth it could be a problem with my 8 USB Receiver dongles, but
in the window configuration of the gamepads (very first post), the all work correct and independent. Because of this i think
must be in Game Maker. Can you agree?
 

kburkhart84

Firehammer Games
First i thougth it could be a problem with my 8 USB Receiver dongles, but
in the window configuration of the gamepads (very first post), the all work correct and independent. Because of this i think
must be in Game Maker. Can you agree?
The reason for you testing with what was supposed to be "known good code" was so that you could prove that it was Gamemaker doing it and not your own code causing it. So based on your testing, I'm guessing that it IS gamemaker causing it. I looked up what the controllers are, and they seem to be relatively cheaply made. I don't know Gamemaker's internals, but it is possible that they coded it to use GUIDs to determine unique gamepads, and all these gamepads may have literally equal GUIDs. I've seen multiple reports of SDL not properly supporting this. I originally had it understood that the GUID was unique for every single device, but it seems that this is not the case, and that the GUID ends up only being unique per "model" of gamepad. So I'm honestly thinking it may be worth it to you to send details to Yoyo in a bug report, but I'm not 100% sure how likely you can expect it to be fixed. If they depend on GUIDs being unique, they would have to change their whole device polling method to fix this issue.
 

mX273

Member
Strange is... rarely it works with 8 controllers... i couldnt figure out a rule... it seems a kind of randomly. Yes GUID are unique per model. i tested it with different models of controllers... is there another way to load the corresponding key-mapping with some controllers of the same model? How do they manage this in selled multiplayer games? They can't presuppose that in multiplayer games all player uses different models of gamepads...
??
 

kburkhart84

Firehammer Games
Yes GUID are unique per model.
So this means that the 8 controllers you are working with all have the same GUID. And I don't know what gamemaker does internally. I know I saw several reports of issues with SDL in general with this kind of thing, so it is possible it isn't Gamemaker itself rather SDL(that they are using). It could certainly be gamemaker as well though.

How do they manage this in selled multiplayer games? They can't presuppose that in multiplayer games all player uses different models of gamepads...
Honestly, I don't know that many people that actually do local multiplayer on PC at all. And the ones that do generally have random gamepads between them. I don't think it is all that common that people actually have duplicate gamepads like you do. That said, it is much more common for people to have duplicates of XInput gamepads. Those are handled separately using the API, and theoretically should work fine as such, on Windows anyway.

Honestly, I've never really seen this issue pop up on these forums either. I don't know if it is unique to those controllers, nor how common it is. It's also possible I just haven't ran across others complaining about it.

I'm curious, are you somehow using a single dongle for all these controllers, or does each one have its own dongle?
 

mX273

Member
yes, all 8 have the same GUID. Can you explain what SDL is? And yes, i have for every gamepad a corresponding dongle. I have to press 3 buttons for 3 seconds and then a led starts to flash for 10s.
Within this time i have to connect the dongle. After that, the gamepad is linked with the receiver dongle. (Then repeat this for every other gamepad). Exactly i use these gamepads:
 

kburkhart84

Firehammer Games
Can you explain what SDL is?
SDL(SimpleDirectmediaLayer) is basically an API that is widely used for cross-platform code. Input isn't all that it does, but it is certainly what is under scrutiny here. It handles audio and graphics as well, providing a simple layer between your code(if you are going lower level, like C++) and the APIs needed(like OpenGL). The idea is that you don't have to have different code for different platforms as SDL handles that stuff. I personally never used it when I was coding stuff in C++ as I did graphics via OpenGL directly, and input via DirectInput directly. XInput was barely even a thing at that time so I didn't mess with it.

Exactly i use these gamepads:
Those are the ones that pop up when I googled it(with the info from your OP), so I figured I was right.

I'm going to finish up my audio system here in a day or two(gotta finish it before the Jam voting is done since it is being given as prizes for winners :) ). After that, I'm going to work on updating my input system with some new features. I may have some cheap gamepads lying around I had bought for my kids that are like models(that may have like GUIDs). I also have a gamecube controller adapter but I don't know if that one gives unique GUIDs etc... or not. Give me a few days and a may be able to do some testing with these things. I doubt I'll be able to fix your problem but I may be able to figure out if it is unique to those specific controllers or to other controllers with like GUIDs in a general sense. I could use the knowledge anyway :).
 

rIKmAN

Member
Hi rIKmAN. Sorry for my late reply... couldn't test it earlier...

Version 2.3 of Input in my 2.3 Beta has compile errors:
GML:
Skript: __input_gamepad_set_mapping in Zeile 34 : Token is undefined at CompileStatement
Skript: __input_load_blacklist_csv in Zeile 26 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 31 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 35 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 48 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 52 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 58 : Hex number $ has an illegal format
Skript: input_history_global_include in Zeile 9 : Hex number $ has an illegal format
Skript: input_xy in Zeile 41 : Hex number $ has an illegal format
Skript: input_xy in Zeile 42 : Hex number $ has an illegal format
Skript: input_xy in Zeile 43 : Hex number $ has an illegal format
Skript: input_xy in Zeile 44 : Hex number $ has an illegal format
Skript: __input_class_verb in Zeile 54 : Hex number $ has an illegal format
Skript: __input_fix_config_struct in Zeile 10 : Hex number $ has an illegal format
Skript: __input_fix_config_struct in Zeile 19 : Hex number $ has an illegal format
Skript: __input_fix_config_struct in Zeile 28 : Hex number $ has an illegal format
Skript: __input_fix_config_struct in Zeile 29 : Hex number $ has an illegal format
Skript: __input_gamepad_set_mapping in Zeile 34 : unexpected symbol "=" in expression
Skript: __input_gamepad_set_mapping in Zeile 34 : malformed assignment
Skript: __input_sdl2_database_funcs in Zeile 231 : Hex number $ has an illegal format
Skript: __input_sdl2_database_funcs in Zeile 235 : Hex number $ has an illegal format
Skript: input_default_gamepad_swap_ab in Zeile 7 : Hex number $ has an illegal format
Skript: input_default_gamepad_swap_ab in Zeile 15 : Hex number $ has an illegal format
Skript: __input_load_type_csv in Zeile 119 : Hex number $ has an illegal format
Skript: input_bindings_reset in Zeile 63 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 15 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 16 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 17 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 18 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 67 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 68 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 69 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 70 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 71 : Hex number $ has an illegal format
Skript: __input_gamepad_find_in_sdl2_database in Zeile 138 : Hex number $ has an illegal format
Skript: __input_gamepad_set_type in Zeile 36 : Hex number $ has an illegal format
Skript: input_ignore_key_add in Zeile 13 : Hex number $ has an illegal format
Skript: __input_load_blacklist_csv in Zeile 22 : Hex number $ has an illegal format
--------------------------------------------------------

Input_V2 in IDE 2.2.5:
View attachment 40762
with "input_set_max_players(12);" i could connect 8 gamepads without the error posted in post#30.
But then i could control all Balls together with a single gamepad :-/. Any ideas?
For the error message it looks like you are again possibly mixing up the version of Input and the version of the IDE you are trying to use - v2.3 of Input loads without any issues in v2.3 of the IDE.

As @kburkhart84 said - the reason I suggested to test Input for v2.3 was to rule out your own code as there is a multiplayer test case built into it which you can use to test instantly, but it turned out you needed to use the legacy version. I have little knowledge of Input for pre v2.3 and tried to hack together a quick test case for you which doesn't seem to have worked - and without access to the gamepads here and a week between replies from you it's impossible to quickly test changes to the code.

If you want to persue using the legacy version then it would be worth jumping on the Discord (link is on the Input github page) and speaking to Juju or one of the other users there who know more about the legacy version of Input and be able to advise you better than I can with regards to whether it should work or not and some test cases that could help diagnose for sure.
I think they'd be interested as this seems to be an edge case of sorts.

I agree with kburkhart84 that it may just turn out to be that you are using 8 cheap controllers too and there may not be a viable software solution, but I would still test Input for v2.3 with the v2.3 IDE and run the multiplayer test case though just to 100% rule it out and because it would personally bug me otherwise.

However at this point you may want to just ignore the advice to use Input and go your original route as my advice was assuming you were using GMS v2.3 and the latest Input for v2.3 which is much improved from the legacy version and pretty much plug 'n' play.
 
Last edited:

mX273

Member
OK, i upgraded GMS to V2.3.2.560 / V2.3.2.426 and tested this:

How exactly can i use the multiplayer example you described above? Do i have to drag and drop the object "obj_test_mp" to the room "rm_test"?

Anyway... what i've got is an output like this:

Code:
[Run] Run game
Options: Z:/input_24B2D8E8\MainOptions.json
[Debugger]target=127.0.0.1,yydebug="Y:/input_12053680_VM\input.yydebug"
X://windows/Runner.exe  -game "Y:/input_12053680_VM\input.win"
Setting scheduler resolution to 1
Attempting to set gamepadcount to 12
DirectX11: Using hardware device
Start debug server
Creating Debugger server port:6509
[DbgServer]6509
Collision Event time(microsecs)=21
Waiting for debugger to connect...
Client(-1) Connected: 127.0.0.1
Debugger connected
309 code buffers added (17402)
Input: Welcome to Input by @jujuadams and @offalynne! This is version 3.3.3, 2020-04-14
Input: Loading SDL2 database from "sdl2.txt"
Input: Unpacking SDL2 buffer...
Input: 953 controller definitions found, of which 345 are active for this platform
Input: Loaded in 1220.98ms
Input: Loading controller type CSV from "controllertypes.csv"
Input: 790 controller type definitions found
Input: Loaded in 41.92ms
Input: Loading controller blacklist CSV from "controllerblacklist.csv"
Input: 128 controller blacklist definitions found
Input: Loaded in 8.54ms
Total memory used = 9863996(0x0096833c) bytes
**********************************.
Entering main loop.
**********************************.
Pause event has been registered for this frame
Pause event has been unregistered
Input: Gamepad 4 connected
Input: New gamepad = "MICREAL Wireless Controller", GUID="5448434d000000000000504944564944"
Input: Warning! No SDL defintion found for 5448434d000000000000504944564944 (vendor=5448, product=434d)
Input: Warning! "5448434d" not found in type database. Guessing controller type based on "Unknown"
Input: Gamepad 4 discovered, type = "unknown", description = "Unknown" (vendor=5448, product=434d)
Pause event has been registered for this frame
Pause event has been unregistered
Input: Gamepad 5 connected
Input: New gamepad = "MICREAL Wireless Controller", GUID="5448434d000000000000504944564944"
Input: Warning! No SDL defintion found for 5448434d000000000000504944564944 (vendor=5448, product=434d)
Input: Warning! "5448434d" not found in type database. Guessing controller type based on "Unknown"
Input: Gamepad 5 discovered, type = "unknown", description = "Unknown" (vendor=5448, product=434d)
Input: Gamepad 6 connected
Input: New gamepad = "MICREAL Wireless Controller", GUID="5448434d000000000000504944564944"
Input: Warning! No SDL defintion found for 5448434d000000000000504944564944 (vendor=5448, product=434d)
Input: Warning! "5448434d" not found in type database. Guessing controller type based on "Unknown"
Input: Gamepad 6 discovered, type = "unknown", description = "Unknown" (vendor=5448, product=434d)
Input: Gamepad 7 connected
Input: New gamepad = "MICREAL Wireless Controller", GUID="5448434d000000000000504944564944"
Input: Warning! No SDL defintion found for 5448434d000000000000504944564944 (vendor=5448, product=434d)
Input: Warning! "5448434d" not found in type database. Guessing controller type based on "Unknown"
Input: Gamepad 7 discovered, type = "unknown", description = "Unknown" (vendor=5448, product=434d)
Input: Gamepad 8 connected
Input: New gamepad = "MICREAL Wireless Controller", GUID="5448434d000000000000504944564944"
Input: Warning! No SDL defintion found for 5448434d000000000000504944564944 (vendor=5448, product=434d)
Input: Warning! "5448434d" not found in type database. Guessing controller type based on "Unknown"
Input: Gamepad 8 discovered, type = "unknown", description = "Unknown" (vendor=5448, product=434d)
Input: Gamepad 9 connected
Input: New gamepad = "MICREAL Wireless Controller", GUID="5448434d000000000000504944564944"
Input: Warning! No SDL defintion found for 5448434d000000000000504944564944 (vendor=5448, product=434d)
Input: Warning! "5448434d" not found in type database. Guessing controller type based on "Unknown"
Input: Gamepad 9 discovered, type = "unknown", description = "Unknown" (vendor=5448, product=434d)
Input: Gamepad 10 connected
Input: New gamepad = "MICREAL Wireless Controller", GUID="5448434d000000000000504944564944"
Input: Warning! No SDL defintion found for 5448434d000000000000504944564944 (vendor=5448, product=434d)
Input: Warning! "5448434d" not found in type database. Guessing controller type based on "Unknown"
Input: Gamepad 10 discovered, type = "unknown", description = "Unknown" (vendor=5448, product=434d)
Input: Gamepad 11 connected
Input: New gamepad = "MICREAL Wireless Controller", GUID="5448434d000000000000504944564944"
Input: Warning! No SDL defintion found for 5448434d000000000000504944564944 (vendor=5448, product=434d)
Input: Warning! "5448434d" not found in type database. Guessing controller type based on "Unknown"
Input: Gamepad 11 discovered, type = "unknown", description = "Unknown" (vendor=5448, product=434d)
Pause event has been registered for this frame
Pause event has been unregistered
Pause event has been registered for this frame
Pause event has been unregistered
I just got the case that multiple gamepads were linked to a single dongle. So in the windows configuration windows they weren't independent.
It could be that i connected them too quickly (one by one). Anyway... in earlier tests that wasn't the case (they were independent).
 

kburkhart84

Firehammer Games
I just got the case that multiple gamepads were linked to a single dongle. So in the windows configuration windows they weren't independent.
I don't know how to use Juju's input system(never used it since I have my own). But if the controllers are losing their dongle, that's bad. Since you say this wasn't happening earlier I dont' think it is the cause of your problem, but it certainly is suspicious and overall not a good thing.
 

rIKmAN

Member
How exactly can i use the multiplayer example you described above? Do i have to drag and drop the object "obj_test_mp" to the room "rm_test"?
Delete the existing object in the room as add the mp object from the "Test Cases" folder.
Edit the Create Event to add however many pads you want to test and edit the Draw Event to output text for each one too.

I'm not at my computer right now so those instructions are from memory but if you still have any issues then hop on the Discord server and post in the #Input channel, I'm sure Juju/Alynne would be interested in this if it's an edge case and will help work out what the exact issue is.
 

kburkhart84

Firehammer Games
@mX273

I just finished making a little gamepad tester. It is available for free on the itch page for Firehammer Input. Just scroll down and get it. It is using the newest GMS version 2.3.2.560.

It has 12 columns, 1 for each gamepad index. Remember that the first 4(numbers 0 - 3) are for XInput devices, so your gamepads will show up as higher numbers since they are using DirectInput.

It has 7 rows as well, displaying the status(if connected or not), the positions of the X/Y axis as a numerical value, and the status of the first 4 buttons(as GMS reads them).

The point of this is mainly so you can confirm if there is somehow an issue with your code, or if it is indeed something to do with those gamepads. I have a few gamepads I tested with(but none that are duplicate models of each other). The testing works fine for mine, including picking up when you connect and disconnect gamepads. I AM still planning to do some further testing, to figure out how well GMS handles gamepads that are the same model(so I can make sure my input system either supports them or if it can't due to GMS, that it is well documented). I couldn't find the old gamepads that I thought I had somewhere so I may have to purchase a couple.

Let us know how it goes with that tester.

And yes, anybody else who reads this, the tester is freely available for anybody's convenience. This current version only supports Windows, as the gamepad IDs are known to always be between 0 and 12. I am planning on making a better version that supports all possible gamepad IDs(as for example on Linux they start at 20 and go up from there).
 
Top