Help test the new Gamepad object!

Discussion and feedback on Construct 2

Post » Sat Feb 11, 2012 1:22 am

Hi all,

Mozilla and Google are working on gamepad input for their browsers. It's very much experimental, but is basically the coolest thing ever. I've been playing around with it and have got some simple input being detected.

Unfortunately, the input is a mess. For one controller, the list of buttons and joystick axes can come back in completely different orders (sometimes even buttons counted as axes and vice versa) depending on the browser, the controller and the operating system! For example my XBox 360 controller has the buttons in a different order between Firefox and Chrome, and apparently (although I haven't tried yet) it changes again if you go to Mac, and so on and on.

However if we do a lot of testing with different controllers, browsers and OS's, I can build mappings in to the gamepad object that makes it consistent everywhere. For example, regardless of whether you've got a Playstation 3 controller or XBox 360, Firefox or Chrome, or Mac or Windows, it should consistently work with "left analog", "d-pad", "face button 1" and so on. I need help testing this though! It would be very nice if this was working smoothly with all common setups when support arrives in the mainstream browsers.

How to help
You can help by digging out any old controllers you have that plug in to your PC. Then, you need to install special versions of Firefox or Chrome which support Gamepad - it's not in the mainstream releases yet.

Firefox 11 nightly with Gamepad support:
http://people.mozilla.com/~tmielczarek/mouselock+gamepad/firefox-11.0a1.en-US.win32.zip

Chrome 18 beta:
https://www.google.com/landing/chrome/beta/
Once installed, you need to go to chrome://flags and click 'Enable' for 'Enable Gamepads' to turn on support.

Warning: installing beta versions of Chrome can sometimes overwrite your user profile. e.g. in the past I've had trouble going from a beta version of Chrome back to the stable one. Back up your profile first if you can, or just skip testing. The Firefox install is just a zip with the EXE inside it so it should run totally standalone.

Run the test
It's here:
http://www.scirra.com/labs/gamepadtest/
Nothing will happen until you press a button on the gamepad. Then, if you're properly set up, a list of buttons and axes should appear, with the name of the gamepad at the bottom.

One by one you can then test each axis and button, and see what order they are listed in and write down the results.

Results for Windows/XBox 360 controller on Firefox & Chrome
Here are my results to show the idea - listing the OS, browser, controller name as it appears in the test, and button and axis mappings.

Windows - Firefox
"45e-28e-Controller (XBOX 360 For Windows)"

Button 0: A
Button 1: B
Button 2: X
Button 3: Y
Button 4: Left shoulder button
Button 5: Right shoulder button
Button 6: Back
Button 7: Start
Button 8: Left analog button
Button 9: Right analog button

Axis 0: Left analog stick X axis
Axis 1: Left analog stick Y axis
Axis 2: Shoulder triggers (left up to 100, right down to -100)
Axis 3: Right analog stick X axis
Axis 4: Right analog stick Y axis
Axis 5: D-pad left and right
Axis 6: D-pad up and down


======================
Windows - Chrome
"Xbox 360 Controller (XInput STANDARD GAMEPAD)"

Button 0: A
Button 1: B
Button 2: X
Button 3: Y
Button 4: Left shoulder button
Button 5: Right shoulder button
Button 6: Left shoulder trigger (up to 100)
Button 7: Right shoulder trigger (up to 100)
Button 8: Back
Button 9: Start
Button 10: Left analog button
Button 11: Right analog button
Button 12: D-pad up
Button 13: D-pad down
Button 14: D-pad left
Button 15: D-pad right

Axis 0: Left analog X axis
Axis 1: Left analog Y axis
Axis 2: Right analog X axis
Axis 3: Right analog Y axis

Please note...
We only need each combo of OS-browser-controller tested once. If your combo is already tested in this thread, in order to keep the thread straightforward, please don't post it again. However, it's worth noting if yours is different to anyone else's test, just in case there's something funny going on.

Thanks everyone and hopefully when Gamepad support comes it will be awesome :D

Edit: if you want a quick test, try Space Blaster with Gamepad support:
http://www.scirra.com/labs/spaceblaster-gamepad/
Probably only supports XBox 360 controller at the moment.Ashley2012-02-11 12:12:26
Scirra Founder
B
207
S
136
G
43
Posts: 17,541
Reputation: 113,137

Post » Sat Feb 11, 2012 4:49 am

Confirming "45e-28e-Controller (XBOX 360 For Windows)" in firefox.

Also tested in FF: Noname PS2 pad (plugged 'n play through convertor MaDrics Superbox 3 Pro)

Pad got installed as USB gamepad in win7
In the test app, stays blocked on "GamePad Connected" and doesn't go further.
The pad has been tested in Derek Yu's Spelunky and is recognized.

Probably doesn't help much, but that's all I can test for now.
Moderator
B
154
S
53
G
28
Posts: 5,416
Reputation: 41,378

Post » Sat Feb 11, 2012 5:54 am

I was excited but now I'm let down, as it only seems to work with the popular but low quality d-pads controllers like the Xbox 360 one. I hope that it'll allow for more inputs later.

I wonder if once these gamepad API things are in the "normal" browsers we'll see some more consistency between them, but that doesn't really seem likely considering other browser differences at the moment.

Same results as you for Xbox controller on Chrome/Firefox on Windows 7.

Buffalo SNES USB gamepad: in Firefox it said "Gamepad connected" but then no other text appeared. On Chrome, I get no response at all.

My PS3/PC arcade stick works well in Firefox (ID:e8f-310d-GAMEPAD 3 TURBO) but like the SNES one it gets no response in Chrome. Don't feel there's much point in listing the inputs, as there's a lot of arcade sticks and many of them are custom built.alspal2012-02-11 05:58:03
B
76
S
48
G
11
Posts: 1,558
Reputation: 13,247

Post » Sat Feb 11, 2012 7:39 am

This is awesome guys, and that could be super usefull for prototyping as well!
Keep it up!
B
7
S
1
G
4
Posts: 8
Reputation: 2,772

Post » Sat Feb 11, 2012 7:39 am

@alspal: you should list it nevertheless.
The gamepad support is at its very beginning. Meaning that today basic USB pad doesn't get well recognized, but the API will evolve in a matter of months.
Let's Ashley have the most complete database of mappings possible as of now, this is listing we won't have to do again later.

Also it's not a surprise that it works better in FF than in Chrome for now, the gamepad API has been pushed by mozilla for a few months now.
Like HTML5 this is all very new.
Even worse it is in experimental stage. Meaning it will only improve.

Help the experimentation today
Tommorow will come sooner.Kyatric2012-02-11 07:41:13
Moderator
B
154
S
53
G
28
Posts: 5,416
Reputation: 41,378

Post » Sat Feb 11, 2012 12:12 pm

If you want a quick test, try Space Blaster with Gamepad support:
http://www.scirra.com/labs/spaceblaster-gamepad/
Probably only supports XBox 360 controller at the moment.
Scirra Founder
B
207
S
136
G
43
Posts: 17,541
Reputation: 113,137

Post » Sat Feb 11, 2012 3:11 pm

How cool!

I got a generic USB gamepad and it worked fine.

Windows 7 32bits
Firefox Nightly 11.0a1 (2011-12-12)
Detected as "Gamepad 0 ID 810-3-USB Gamepad"


Analog mode ON
Buttons in the following (correct) order:
B1, B2, B3, B4,
Left shoulder button, Right shoulder button,
Left shoulder trigger, Right shoulder trigger,
back, Start, Left stick, Right stick.

Axis maps as follows:
Left Stick left/right (X) = Axis 0, -100..100
Left Stick up/down (Y) = Axis 1, -100..100
Right Stick left/right (Z axis) = Axis 5, -100..100
Right Stick up/down (Z rotation) = Axis 2, -100..100

D-pad left/right = Axis 5, -100/100
D-pad up/down = Axis 6, -100/100


Analog mode OFF
Buttons in same order, but stick ones don't work.
Axis 0 and 1 read -1 when idle.

Axis maps as follows:
Left Stick left/right (X) = Axis 0, -100/100
Left Stick up/down (Y) = Axis 1, -100/100
Right Stick left/right (Z axis) = buttons 3, 1
Right Stick up/down (Z rotation) = buttons 0, 2

D-pad left/right = Axis 0, -100/100
D-pad up/down = Axis 1, -100/100

I have the right stick swapped like this, what may interfere in the readings.
B
3
Posts: 2
Reputation: 679

Post » Sat Feb 11, 2012 3:16 pm

@nornberg I don't think it's useful to run the test if you've done hacks to change the input. It should be the stock install. Otherwise any mappings I add will be wrong for everyone else. Could you run it again with a default setup? And maybe check Chrome 18 too? :)
Scirra Founder
B
207
S
136
G
43
Posts: 17,541
Reputation: 113,137

Post » Sat Feb 11, 2012 8:05 pm

@Ashley
Marvellous to see you getting on to this! Running late for a job, but couldn't resist doing a quick test:

Windows 7 - Firefox Nightly
Gamepad 0 ID: 46d-c216-Logitech Dual Action

Button 0: 1 (right button pad)
Button 1: 2 (right button pad)
Button 2: 3 (right button pad)
Button 3: 4 (right button pad)
Button 4: 5 (back left top)
Button 5: 6 (back left bottom)
Button 6: 7 (back right top)
Button 7: 8 (back right bottom)
Button 8: - (should be 9, but no reaction)
Button 9: 10

Axis 0: Left analog stick X axis
Axis 1: Left analog stick Y axis
Axis 2: Right analog stick X axis
Axis 3: -
Axis 4: D-pad left and right
Axis 5: D-pad up and down / Right analog stick X axis

More later ...
B
91
S
14
G
11
Posts: 549
Reputation: 16,921

Post » Sat Feb 11, 2012 10:40 pm

[QUOTE=Ashley]If you want a quick test, try Space Blaster with Gamepad support ...[/QUOTE]

I have seen the future of browser-based gaming and it works! (apologies to Lincoln Steffens)


This is absolutely fantastic, guys! Being able move around and fire in a browser-based game with a gamepad is a real blast!

(For the record, with my Logitech Dual Action/Win7/FF Nightly, I press 1 to start and to fire laser cannons, 2 to fire rockets, and use the left joystick to move around).

It was smitchell who put me onto the Gamepad API in this thread. I went on to hunt out Benjamin Read's excellent intro and downloaded his demo code.

His PS3 mappings didn't work with my Logitech gamepad, but with a bit of experimenting they were easy to change in the code. I had dreams (just dreams!) of trying to make a gamepad C2 plugin, but I could see that allowing for myriads of different mappings was going to be a real hassle - so I'm mightily impressed that Ashley has taken up the challenge and has already succeeded brilliantly!Velojet2012-02-11 23:41:17
B
91
S
14
G
11
Posts: 549
Reputation: 16,921

Next

Return to Construct 2 General

Who is online

Users browsing this forum: gonzdevour, Google [Bot], hmott, jayderyu, yaomon17 and 0 guests