• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker non-XBox controller Support

G

GM029

Guest
Does anyone know if it's possible to use the Genesis Mini Controller with GMS 2? When I plug it in it looks like Windows properly detects it as a gamepad up but GMS doesn't see it as a gamepad in my testing. It'd be really cool to be able to support it!

On another note does anyone know if the 8BitDo controllers work with GMS2?
 

TailBit

Member
Is this GMS2 through steam?

Asking because steam like messing with the controlls, for example for driving games. Then I have to do this.

Think you can do the same by right clicking GMS2 in the steam library, and then go settings and find the same option there.

GMS2 might need a restart afterwards for changes to take effect.
 
G

GM029

Guest
Ahh sorry I lost track of this thread, this is just locally on my computer, not on Steam.

So I've advanced a little in my quest for retro styled gamepad support and hit a bit of a wall. I'm testing with the Genesis Mini controller and a Windows controller styled like an NES controller.

Most of the buttons on non-Xbox controllers are woking now (A,B,C,Start,Select). For the life of me I can't get GameMaker to use the DPad properly. By default pressing right is registering as pushing diagonally down to the right on a left thumbstick and pushing left is like pushing diagonally left and up on a left thumbstick. Up and Down don't seem to register at all.

I wrote some code to loop through the gamepad_check_button values and all the buttons return a numeric value except anything on the DPad. Both my NES styled windows controller and Genesis Mini controllers are behaving the exact same way.
 
Last edited by a moderator:
G

GM029

Guest
I'll make the question a little more specific...

Has anyone gotten GameMaker Studio 2 to work with this gamepad (or equivalent)?

https://www.amazon.com/gp/product/B07M7SYX11

When I run the GamePad test in Windows it tracks the DPad perfectly.

When I use it with GameMaker it cannot see up and down on the DPad and left and right are treated like diagonal movements on the axis of a left thumbstick. It does see the other buttons though (A, B, Start, Select).

My guess is there must be provisions somewhere in GameMaker to work with these types of controllers, and not just XInput controllers.
 

Yal

šŸ§ *penguin noises*
GMC Elder
TLDR it's a mess, as you've already seen.

Non XBox / PS-whatever-the-current-number-is... 5? 4? controllers use a different API from the "good ol'" gamepads, Xinput (the old API is called DInput). There's some overlap between functionality, but most importantly DInput isn't fully standardized. In GMS1 the "joystick" API deals with DInput devices and the "gamepad" input with XInput devices... the joystick API is deprecated in GMS2 but device 4 - 11 are DInput (XInput are gamepad 0 - 3). But, some devices get detected both as DInput and XInput (and so will get assigned TWO gamepad IDs).

Ideally, you should make a menu that allows remapping the buttons on the fly.

Programs like Joy2Key lets you generate keyboard events from a gamepad, this can be used to give any game gamepad support.
 
G

GM029

Guest
Yea no matter what I've tried (including the 'gamepad_hat_count and 'gamepad_hat_value' gamepad functions) it doesn't seem to be able to get a read on the DPad on my two non-Xinput controllers so I'm not even sure how to make a controller mapping function.

Strange how the Windows GamePad test program has no issues with the different types of controllers, you'd think that GameMaker would be doing something similar to that.

I would guess with the slow movement of this thread that not many people have gotten these types of controllers working which sounds like a GameMaker issue to me. Personally I want to have maximum controller support baked right into the game (especially for all the inexpensive retro gamepads out there) but I'm not sure if it's really possible in GameMaker.
 
Just in case you havent made the d-pad of your NES usb gamepad work with your game here are a few suggestions.

Unfortunately I dont have the same usb game controller as you, so these are just suggestions which have workes with my troublesome game controllers.

1. I also have a retro type gamepad with usb, although its a sega style one, it have the feature to switch between xinput and directinput if I press the start button and "B" at the same time for a few seconds. In one of the modes the d-pad do not work correctly. In the other mode the d-pad works correctly (well either as d-pad buttons, or as a left stick).

2. I also have a game controller with a d-pad that seems to transmit wrong data when pressing left and right. It was because the d-pad was transmitting left stick analog data instead of d-pad button data. Therefore I check both for d-pad movement and for left stick (axis) movement in order to make the d-pad of this type of game controller work too. I found out that I should edit the stick sensibility with the function : gamepad_set_axis_deadzone(device, deadzone); // device is the game-controller-port and a good deadzone variable is 0.5. Because if the stick sensibility/deadzone is extreme like 0 or 1, then it can cause some of the directions to not be detected at all ! Therefore I use the deadzone value 0.5.

3. An old gamepad of mine have a d-pad that behaves like a joystick "hat" (thumbstick I think it is called). Those behave different too, but can be detected and used, and when used I had to adjust the sensibility using this function : gamepad_set_button_threshold(device, threshold);

4. Actually I also have a gamepad with a d-pad that sends down when pressing right, left when pressing down and so forth. That d-pad also transmit left stick (or hat) data at the same time, so I just first check the d-pad button data and IF there are other data send from the d-pad then the new data overrides the d-pad button data (which were wrong anyway).

Best regards and good luck
Max
 
Top