GMS 2 DualShock 4 not detected, with async

muki

Member
Hi all,

I'm trying to get my Dualshock 4 to work in GMS2. I did a bit of searching, and have followed this blog post on async. Plugged it into my game, and it detects my old Logitech (on directinput) just fine. Controls work too, when I assign gp_id to the rest of my game. I get the debug messages I'd expect unplugging and plugging the Logitech back in. Great!

Async - System in one of my control objects:
GML:
show_debug_message("Event = " + async_load[? "event_type"]);        // Debug code so you can see which event has been
show_debug_message("Pad = " + string(async_load[? "pad_index"]));   // triggered and the pad associated with it.

switch(async_load[? "event_type"])             // Parse the async_load map to see which event has been triggered
{
case "gamepad discovered":                     // A game pad has been discovered
    var pad = async_load[? "pad_index"];       // Get the pad index value from the async_load map
    gamepad_set_axis_deadzone(pad, 0.5);       // Set the "deadzone" for the axis
    gamepad_set_button_threshold(pad, 0.1);    // Set the "threshold" for the triggers
   
    gp_id = pad;
    show_debug_message("FOUND!");

    break;
case "gamepad lost":                           // Gamepad has been removed or otherwise disabled
    var pad = async_load[? "pad_index"];       // Get the pad index
   
    show_debug_message("NOT FOUND");

    break;
}

No luck with the Dualshock 4 however. No detection/undetected message, nothing.

This DS4 works fine for everything else I use it for outside of GMS2. Other games, no problem. This site detects it just fine as well.

I also tried the "non proper" way by manually going through ids 0-11, game still doesn't detect the DS4.

Any ideas?

I could use my Logitech for gamedev and my DS4 for everything else, but that's not a realistic solution at all, when it comes to finishing the game. Also I use it with USB, not BT.
 

kburkhart84

Firehammer Games
That's interesting...is the DS4 a true DInput device, or is it using emulated XInput? Does it show up in the Windows control panel?
 

Roldy

Member
I'd suggest, as a test, running the YoYo Dungeon demo. It has controller implementation and it successfully uses my DS4.
 

muki

Member
That's interesting...is the DS4 a true DInput device, or is it using emulated XInput? Does it show up in the Windows control panel?
It appears in the device manager, in the same place and fashion as does the Logitech. No idea what protocol it's using internally though.

I'd suggest, as a test, running the YoYo Dungeon demo. It has controller implementation and it successfully uses my DS4.
DS4 didn't work with the Dungeon test. But the Logitech works fine.

Been using the DS4 for a year and a half on lots of games outside of GM, this is the first time I've had any sort of issue with it.

This is pretty bizarre....
 

kburkhart84

Firehammer Games
It appears in the device manager, in the same place and fashion as does the Logitech. No idea what protocol it's using internally though.
If you open the details, does it actually show the buttons and axes and the positions of them? If not, it could be similar to the original PS3 Dual Shocks. With those, there was no DInput driver, but you could install a driver for them that turned them into an emulated XInput device. I don't know about the DS4 version which is why I didn't mention it before. Note that GMS under the hood is using DInput and XInput for gamepads, so if those APIs can't pick it up, then it won't work with GMS. There are other APIs for gamepads though, and it may be that many of your games are using those alternatives.

DS4 didn't work with the Dungeon test. But the Logitech works fine.

Been using the DS4 for a year and a half on lots of games outside of GM, this is the first time I've had any sort of issue with it.

This is pretty bizarre....
Maybe you can get @Roldy to try it again and see if it currently works. Maybe something changed between then and now. Another option would be to make Roldy a build and see if it happens in your build or if it works fine. Both of these things together would at the least determine possibly if it is an issue with your system and controller specifically, or if it is the build, and if it is something that changed at some point. I'd offer more help in that regard but I don't have one of those controllers.
 

muki

Member
Thanks for the help. Looks like I fixed it.

Go in Steam settings, controller settings, then general controller settings which brings up a big picture type of UI for configuration. I had PlayStation configuration support checked. Here's a quote about what this does:

"If Steam input PlayStation configuration support is enabled, it will then be reconfigurable per-game using the same configurator system available to Steam controllers"

I think I enabled this a year-ish ago because some game wouldn't work without it, and had forgotten. Sounds like it's some sort of API wrapper. It didn't break anything else (and I wasn't using GM at the time) so left it. Disabled it and both my game and the dungeon demo started working with the DS4.

Does GM have a "configurator system"? Maybe this is something YoYo needs to look into. Even if it's just a notification that pops up telling your that Steam is configured this way.
 
Top