What kinds of gamepads can I use?

Discussion and feedback on Construct 2

Post » Mon Mar 16, 2015 5:58 pm

I'm trying to add gamepad support to my game, but Construct 2 will not recognize my cheap PS2-style gamepads. The LastButton property will always be 0 for them.

When I test with an XBox360 controller, everything is fine. But I don't want to require every gamepad user to go out and get an XBox360 controller.

So... where do I find out what gamepads are supported by Construct 2 or by the Chrome browser I test on?
B
9
S
1
Posts: 98
Reputation: 853

Post » Mon Mar 16, 2015 6:13 pm

Typically everything that says "Xbox360-compatible" on the box.
Some had luck with PS3-compatibles, but that depends on a lot of factors (meticulous driver setups, for instance)

A wider range isn't supported, unfortunately. That's not up to Construct2 though, it's entirely browser-shenanigans.
B
73
S
28
G
32
Posts: 480
Reputation: 19,671

Post » Mon Mar 16, 2015 6:56 pm

How unfortunate. I guess I'll just bill my game as "Playable with XB360-Compatible controllers!"

I wonder if Firefox or Chrome offer addons for more controller types?
B
9
S
1
Posts: 98
Reputation: 853

Post » Mon Mar 16, 2015 7:59 pm

I've been playing for a while with my old gamepad (Mint Gamepad MGP-509) - it didn't work straight away.
I tried using it with a soft called "x360ce" then:
- Chrome - only left analog works
- NW - same, just left analog works
- IE - lol
- Firefox - everything works except couple of buttons

So I assumed that this only fully works with proper X360 compatible gamepads.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,598
Reputation: 34,823

Post » Mon Mar 16, 2015 8:15 pm

I never done it but I believe that you can get other gamepads to work if you use the button index in the gamepad object. I think I read about that in one of Ashley's blogs, or the manual... somewhere, I just can't remember where.
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Mon Mar 16, 2015 8:41 pm

Logitech gamepad f310 works well in my test.
ImageImage
B
105
S
46
G
23
Posts: 778
Reputation: 22,226

Post » Mon Mar 16, 2015 9:14 pm

@ryanrybot: I'm using Button Index exclusively. However now that I'm done with the implementation there's something else I can check before calling it a lost cause...
B
9
S
1
Posts: 98
Reputation: 853

Post » Mon Mar 16, 2015 9:17 pm

I have tried alot of different gamepads for my game and all of them works like a charm so the problem might be your cheap gamepads as you called them. Your game probably works for the majority of the gamepads on the market.
B
54
S
23
G
12
Posts: 747
Reputation: 11,910

Post » Tue Mar 17, 2015 1:53 am

Sorry @MoscowModder, it was Raw input I was thinking.
Here's an excerpt from the Manual...
Key mapping

Different controllers have different button layouts, or the buttons have different names. For example, the Playstation 3 controller uses square, circle, triangle and X buttons, whereas the XBox 360 controller uses A, B, X and Y (note that X appears in a different position in each controller too). For consistency, the Gamepad object refers to the XBox 360 layout only.

The Gamepad object will also attempt to map other controller's keys to the XBox 360 layout internally, to ensure the same button always triggers the same event. However it is impractical to set this up for every device in existence, so some device buttons may trigger different key events in the Gamepad object. This is partly why it is recommended to focus on XBox 360 controllers. If you are interested in using Gamepad input extensively, be sure to test on as wide a range of devices as you can obtain.
Raw input can be obtained, circumventing the Gamepad object's built in key mapping, using the Raw expressions.

...

RawAxis(Gamepad, Index)
Retrieve raw axis input for a specific gamepad and axis index. This returns the value without keymapping, applying the analog deadzone, or multiplying the returned value by 100. Axis values range from -1 to 1.

RawAxisCount(Gamepad)
Return the number of axes available in the raw input for a specific gamepad. This returns the value without keymapping.

RawButton(Gamepad, Index)
Retrieve raw button input for a specific gamepad and button index. This returns the value without keymapping. Button values range from 0 to 1 (pressure sensitive buttons can return values in between).

RawButtonCount(Gamepad)
Return the number of buttons available in the raw input for a specific gamepad. This returns the value without keymapping.


How to actually set it up to get other gamepads to work is out of my experience, but I hope this might be something beneficial.
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Tue Mar 17, 2015 2:09 am

There is a bug in Chromium where when using non-xbox controllers (at least on several of my different non xbox controllers), they can only be used once. If you close the browser or tab, and then open the game again the controller will no longer be recognized.

With Firefox though, this bug is non-existant, you can use your controller no matter how many times you open or close the browser or tab. Who knows how long Chrome will take to catch up in this area?
B
147
S
74
G
20
Posts: 1,786
Reputation: 22,527


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 0 guests