Help test the new Gamepad object!

Discussion and feedback on Construct 2

Post » Tue Sep 11, 2012 1:45 pm

@alspal: I tested it in Chrome 21 and it worked fine. However in Chrome beta and canary (currently 22 and 23) it didn't work because Google tweaked the way Gamepad support worked in them. Thanks for the heads up - it's fixed to use the new way in the next build.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Sep 11, 2012 4:53 pm

Since Gamepad was mentioned in the new build I decided to give it a go. Hooked up my Dual Shock 2 and put in some events for the gamepad and previewed. Nothing.

So I tried something else. I put x360ce in the Chrome folder and tried it that way. Now it works.

So it seems to me that it's Xinput only (at least in Chrome). Though I don't know if it's because of the browser, or because of C2. If it's because of C2 I'd highly suggest broadening the gamepad object to support more than just Xinput. If it's because of the browser... then I don't know what could be done. Maybe someone else does.

In any case, while Xinput is decent, it doesn't cover that much of the possible peripherals people use. While enthusiast like us here at the Scirra forums may feel comfortable mucking about with experimental drivers, third party software and whatnot to make stuff work. More than likely, the common user won't, and I don't expect them to (as already stated).

Aside from the obvious Xinput issue, there're some things that I'd like to see which would make the gamepad object more useful.

The gamepad object lacks some conditions that the keybord has. Namely "on key pressed" and "on key released". Gamepad versions of these would be great.

Setting up events for both gamepad and keyboard is a bit clunky currently. I'd have to copy the entire group and redo the events in it for gamepad. If the "OR" blocks supported more than one condition per ... uh.. block(?), it would make supporting multiple control types easier. Like this:

Left Arrow Down
Player on ground

OR

D Pad Left Down
Player on ground

This was mentioned in another post a while back, not sure what happened to that thread though.inkBot2012-09-11 16:59:37
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Tue Sep 11, 2012 5:50 pm

@inkBot - unfortunately which controllers are supported depends entirely on the browser - we can't do anything to add support. Browser makers are still working on it though, so I anticipate it will improve gradually over time.

Good point about the missing triggers - added to the todo list.

You can either use global variables or a third party function plugin (official features will be coming soon) to handle control input. Alternatively the events you gave can be rewritten easily using a subevent:

Left arrow down
OR
D Pad left down
---- Player on ground (subevent)
---- Do stuff!
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Sep 11, 2012 6:06 pm

[QUOTE=Ashley] @inkBot - unfortunately which controllers are supported depends entirely on the browser - we can't do anything to add support.[/QUOTE]
I was afraid of that. Guess we'll just have to bombard Google and Mozilla with emails about better gamepad support.

[QUOTE=Ashley]
Good point about the missing triggers - added to the todo list.
[/QUOTE]
Sweet.

[QUOTE=Ashley]
Alternatively the events you gave can be rewritten easily using a subevent:

Left arrow down
OR
D Pad left down
---- Player on ground (subevent)
---- Do stuff![/QUOTE]
That is a good solution, not sure why I didn't think of it immediately. Broader OR conditions would still be nice though. :)
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Wed Sep 12, 2012 2:56 am

It's cool that it works now, thanks! But could you add an action eventually to get the index of the last button pressed (or something like that), this way we can make ? custom controls ?.

If you don't know what I mean by custom controls, it means I can have a menu in the game that lets the user define their own input (everyone likes their input a specific way). This is a standard for every proffesional game, here is an example from a few games to show you what I mean:

dota2.jpg
seriousSam3.jpg
darksouls.jpg

A video on the subject.alspal2012-09-12 03:03:56
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Wed Sep 12, 2012 10:52 am

A way to get data for which button is/was pressed would be good for both the gamepad and keyboard objects. There seem to be expressions for the gamepad object to get some input data. But that seems to be returning a value from 0 to 100. I'm guessing this is simply checking if the button is pressed (since you have to specify the button in question it seems), and by how much if analog. Interesting, but not what I was looking for.

EDIT: All of that was available in the manual. XDinkBot2012-09-12 10:54:35
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Sat Nov 10, 2012 2:46 am

Does anyone have a list of contacts for the GamePad support for Chromium / Mozilla? Since Chromium is the basis of awesomium, adding gamepad support to it would be a double whammy (EXE and Chrome support).

I don't know if it's lack of man power or political issues that prevent more gamepad drivers from showing up in the browsers. Curious if anyone can point me in the right direction.
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Wed Jan 02, 2013 11:02 am

I'm using a wireless Xbox360 controller on Windows 7 (Xbox360 controller + wireless receiver).

- Is detected by windows and works fine with Spelunky! :)
- Is not recognized there: http://www.scirra.com/labs/gamepadtest/ (nothing happens... "Ready..." "Gamepad 0 ID:")

Tested on recent versions of firefox and chrome.
B
17
S
4
G
4
Posts: 137
Reputation: 3,767

Post » Fri Mar 15, 2013 8:57 pm

@Kyatric @Ashley or anyone else.

I planned to test a bunch of controllers, but the test seem to not work any more in either Firefox or Chrome, nor the Spaceblaster demo. I guess there have been loots of updates that broke does test demos since then?

Also non of the Conditions, "Has Gamepads" "On Gamepad Connected" "On Gamepad Disconnected" seem to work.

I have both the wired and wireless XB360 pad working in Chrome in my own game, but not in Firefox.

Btw, I suppose there is no way to make it possible to access the rumble feature?Tsengar2013-03-15 20:58:45
B
58
S
28
G
7
Posts: 13
Reputation: 6,203

Post » Fri Mar 15, 2013 9:17 pm

@Tsengar: Gamepad isn't supported in FF at the moment.
To have the test working in FF, you are supposed to install the old version 11 nightly with the beta support compiled in, which is kind of a burden.

For Chrome, as far as I know, you have to press buttons on the gamepad first to "enable" it and mostly only XBox360 gamepad is supported. (to be confirmed, @Ashley ?)

Support for other gamepad is coming though and support in FF is being worked on too, but isn't yet included in any stable release.
There were some movements in the bugzilla about gamepad support, so hopefully it's coming for FF.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: BBaller1337, nickbernstein and 16 guests