While developing a StepMania like game (but with the defold engine) I’ve found a problem I have not been able to solve. The engine appears not to recognize my dancepad “RedOctane USB Pad”, nor my “USB Joystick” gamepad. However, it perfectly recognizes my keyboard.
I’ve searched through this forum and found out there’s support for Xbox controllers, so I started digging into the builtins of the engine until I found the default.gamepads GAMEPAD file.
I’ve been playing with it for a while trying to make any of my controllers work, but, even though windows recognizes them and I can use them to play other games, my defold game doesn’t seem to take any signal from them.
Any idea on the issue? I thought that just configuring the default.gamepads file was going to be enough, but it appears it’s not.
But since the controller identifies as something not available in the current default.gamepads file, you will need to add an entry for it yourself. Thankfully we have a little tool for this, hold on and I’ll upload it here, what platform are you running on?
I agree with Sven. I love that you’re using non-conventional input in your game! I also think we should post something about the gdc tool to the Defoldmine section on the forum and encourage users to share their gamepad mappings.
but my gamepad is already usb plugged. I have also checked that windows recognises my device, so I’m probably not using the correct command line to call the program.
No that should be enough, looks like it’s not able to find the gamepad/joystick, strange. Could you try using a third part tool to verify it’s found and identifiable as a joystick? Try Joystick Tester from here: http://www.mcrenox.com.ar/downloads/
When I first tried the joystick tester it didn’t recognise the gamepad, but I activated an option at the Printers and Devices pannel of windows and the joystick tester started to work:
Also worth noting that the gdc tool expects you to press and hold a button for a second. If you just quickly tap the button, it won’t recognise the input.
Took me about 10 minutes to figure out why the tool didn’t work for me, heh.
Thanks for your answer @sergey.lerg .
I am still stucked with the problem though, because the moment I execute gdc.exe, it just says:
FATAL:HID: could not set glfw char callback.
No connected gamepads, bye!
It says so even if I have been holding a button from the gamepad for a while and then, without unholding the button, I execute gdc.exe.
I have tried again the gamepad with Joystick Tester as @sven suggested some time ago, and it works perfectly - it also works with different emulators.
So I still think there is something about how Defold or the gdc tool are build that make them not recognize my gamepads.
Have you tried a conventional game pad, like an Xbox controller? Did that work? Is it more than the controller you mentioned in your original post that doesn’t work?
Hi, I had some problems on my mac with gamepad, too.
Mac OS siera, defold 2 pre-release
I tried gdc and it told that everything is ok and device will be added - but I still don’t see it in default or custom file… and game on start writes that
WARNING:INPUT: No gamepad map found for gamepad 0 (Wireless 360 Controller), it will not be used.
INFO:DLIB: SSDP: Started on address 192.168.1.52
WARNING:INPUT: No gamepad map registered for gamepad 0, not used.
only a hand modification of default.gamepads helped - just copy one section and add the same with name device: "Wireless 360 Controller"
but… buttons works not the same as expected
is there simplier way or convert generated with gdc to a needed format?
Gdc should generate a file or section of a file (can’t remember which and I can’t test now) that you can include in a copy of the default gamepads file. It will not automatically add anything.
Based on @sven’s previous post the gdc tool should spit out a gamepads file with correct mappings that you can merge with a copy of the master gamepads file.
for now my gamepad “Wireless 360 Controller” works in Defold on macos because I copied area for microsoft xbox one contoller and change its name and set needed platform… and now everything works good. but I want to add one more controller (a popular for mobile I guess) 8bitdo zero. so I really need to get where file generated by gdc can be found
I ran the gdc tool on OSX and the tool writes a default.gamepads file in the same folder. If you’re trying this on Windows I think you need to ensure that the tool is run from a location where your user has write access (or perhaps run as administrator or something like that).