Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Okay so I'll start by apologizing for the length of this reply but I can't explain it any shorter I think, so sorry for the wall of text.

Ah, well I guess "gamepad_test_mapping" has to be a "new" function (new as in GMS2, I was using GMS 1.4 for the majority of making this game) since I don't think I've seen that one before.

So in theory I could do what you asked but it would require me to rewrite my controller support code which I'm not sure I want to do.

And even if I did, this only potentially solves the problem for a number of controllers since every single controller is different.

This right here in the GML manual:

"however due to the huge number of controller types and brands out there, it is impossible to map the GML constants to the correct inputs for every make and model"

This is exactly what I've been trying to tell people when they ask why I can't detect the name of what button is being pressed for example, because the same button has different ID's on different controllers.

And the issue you talk about is similar to that in which I have to manually add every single controller to a list and detect which one it is, which simply isn't feasible to me.

I know you only asked for a couple of controllers to be fixed this way but if I start doing a few then I have to do others you know (and rewrite my controller support as mentioned) and I'm not sure I'm up for that, depends on how big of a problem it is later.

And regarding "InputCandy", I won't be using any external libraries for various reasons, so that won't help.

Sorry if this is not exactly the answer you wanted but it is what it is for now, I'm sure I'll work on better controller support in the future but not right now.

(1 edit)

So, you started the input mapping a major release of GMS ago.

Well, the fact is that I'm not asking a strange 3rd party controllers, I'm asking about controllers that anyone has got (xbox one (s variant, but at this point should be the same on the other ones) wired an wireless, and nintendo switch pro controller)

Nowadays, also Steam and Proton can handle them on Linux. And, the mappings (guids and so on), are not specific to the specific unit, but to the particular controller/driver pair. Xpadneo/xpad/hid-nintendo drivers mappings are nowadays fixed as:

- xpad/hid-nintendo are inline modules on the kernels nowadays (no external drivers)

- xpadneo is widely used for ble xbox one controllers (even the newer ones)

So, let me be clear. As I have said, I have to use a third party app (in that case Steam with Steam Play, but can be any remapper tool), to make the game playable via a 1st party controller, on a supporter system by the game.

Any change as you missed the gamepad_test_mapping function, you have simply to renew the mapping db for the engine to solve the issue?

As 1,4 → 2 of GMS is a big gap, any change it can be solved simply rewriting the controller support?

The thing is this → I understand you can not support all the pads on the earth, but, in my modest opinion (it is an opinion, your project, your rules), as I can understand, this is an issue in other OSes too, first party gamepad support should be a bug with high priority. You can play with a keyboard, but for most of the users, broken gamepad support for a platformer → a metroidvania (on 1st party controllers, not on 3rd party ones, I want to enphasize this) is GAME BRAKER.

So someone can dawnload the game, see that it is not playlable via his/her 1st party controller, and leave the game. It is a shame for a so nice and well-finished game as Zordak.

You can "workaraund" (porkaraound really) this when publishing on Steam, as I said, forcing Steam Play emulated controller (you can try it yourself), at the exception of a button which can be easily remapped in games, works (and should work the same on every platform). However all this means that other releases on what is not Steam, will have a not woking controller mapping.

But, for curiosity, if not a 1st party Microsoft/Nintendo controller, which controller should be for sure supported on Zordak at the moment?

Just to be clear, nintendo switch pro controller was released on March 3, 2017 (6 years ago). The Xbox One S controller (1708 version) was introduced in the 2016 (7 years ago).

https://github.com/AntiMicroX/antimicrox , https://generalarcade.com/gamepadtool/ this are some tools to get the mapping for the controllers, and https://github.com/gabomdq/SDL_GameControllerDB there is an updated list of the mappings, in the SDL style (organized by operating system).

I really hope, at least for 1st party controllers, you will find a solution before publishing the game on the stores :)

Hey, I'm sorry for the very late and once again giant reply.

Okay so, since you are using standard controllers and not some off brand ones, I don't think this is completely my fault in this case since why wouldn't GameMaker support these controllers out of the box?

It's not like I'm using anything special in the code when checking for controller inputs, it's just their own built in functions.

The manual even says this:

"While GameMaker comes with mappings for a number of different gamepads based on SDL Gamepad Controller DB "

Which is the exact same thing you linked.

So I don't understand why it wouldn't just work out of the box in this case since GameMaker is supposedly already using these SDL mappings.

The only thing I can think of is that my GameMaker version is so out of date that this hasn't been added yet but that seems unlikely since my version has the gamepad_test/get/remove_mapping functions.

And after looking around a bit more here, I'm not sure rewriting the controller input system will do much (since it will end up pretty much the same as it is now), UNLESS I go the manual route and *manually* keep a database of all controllers, check and set the mappings accordingly, which seems like a huge pain to do, AND that's assuming that will even work.

But with all that said, I'm not saying I won't do it in the future, I just don't want to spend time/energy on controller stuff right now.

And to answer your question about what controllers should be supported by the game:

Any/all controllers should be supported, I'm not sure I've ever gotten feedback where controllers are not working at all on Windows, it's only on Linux there are issues.

The only thing that currently doesn't add up on Windows are the button names, the buttons all have different ID's depending on controller so it's basically impossible to know the name of what button was pressed, once again, UNLESS you go the manual route mentioned above.

Anyway, after reading through all of this again, I don't think you told me what the actual issue was, so what didn't work for your controllers? Like were they not detected at all or just no inputs?

Also, since this reply is already gigantic, I'll just leave a snippet of my controller code here to show what I'm actually doing:

And there you have it, that's how I poll for button presses, not sure what else I could do here.

Oh and just to clarify, I'm not trying to pass the blame on to the GameMaker devs, I'm sure I'm doing something wrong.. I just don't get why standard controllers like this wouldn't work out of the box when the manual states the same SDL library is being used behind the scenes.

I dunno if the mapping is really too old or not. Anyway, to answer you, both controllers are detected, but the mapping makes the game unplayable.

As some asix are mapped in other places, some buttons are not reconized at all, some buttons are reconized.

So I could say "reconized but incorrectly mapped".

Hey, once again sorry for the somewhat late reply.

Okay well, that's pretty much what I expected, that the controller technically works but the buttons are either jumbled or not detected.

I don't know what else to say really, if the manual is correct and GameMaker uses the same SDL library internally as you linked then I don't know why it doesn't work correctly.

We'll just have to see if it's fixed whenever I update my GameMaker version. (which will be "soon")

If it's not fixed with the update, then I don't know when/if it will be fixed but I will try to fix it at some point, it is currently not a high priority though.

Anyway, thanks for the feedback and I hope I'll get it fixed at some point.