Jump to content

Gamepads 100% Firefox, Not Working Chrome?


JeZxLee
 Share

Recommended Posts

Gamepads 100% Firefox, Not Working Chrome?

 

Hi,

 

We are currently working on this HTML5 open-source game here:

www.OpenTetris.com

 

We have got 5 USB gamepads working well on Mozilla Firefox but not working well on Google Chrome?

The above URL has full source code located on the game's title screen.

 

Gamepad code locations:

- "initialize.js" line 118

- "screens.js" lines 127 - 129

- "input.js" lines 121 - 161

 

We have a hard deadline of December 1st for Beta1 and need to solve this issue with Chrome & gamepads before it...

Any help would be appreciated, thanks!

 

JeZxLee

16BitSoft Inc.

Video Game Design Studio

www.16BitSoft.com

Link to comment
Share on other sites

how did you add the video animation (guy at river) at the beginning? very cool

 

the game itself is quite fun. i would prefer a larger playing grid (too narrow)

Hi,

 

Thanks for playing.

The game is 100% open-source.

You can download the entire source code on the title screen.

(video playing is in "screens.js" - function at 1959)

 

Anyone know what we do wrong with gamepads on Google Chrome?

Thanks!

 

P.S. - You are in the game now! (check [About] screen)

 

JeZxLee

Link to comment
Share on other sites

I can't check your source since I'm reading on a tablet, but I had a similar problem when I was implementing my engine. In contrast to Firefox you have to call “navigator.getGamepads()“ every single frame in Chrome to get a “fresh“ reference to the gamepad objects. You can not simply store and reuse the references since chrome doesn't update the input values on these “old“ objects. Also the timestamp property has a wrong value in Chrome. It also can happen that chrome shows some kind of “ghost“ gamepads, so you should not bank on the provided number of plugged gamepads and therefore you should not automatically map them To the player profiles. Instead you should let the players connect the single gamepads to their single player profiles by pressing a button. This way you can ensure that your players are connected with an actual gamepad device instead of a mysterious ghost device. :-)

Link to comment
Share on other sites

I can't check your source since I'm reading on a tablet, but I had a similar problem when I was implementing my engine. In contrast to Firefox you have to call “navigator.getGamepads()“ every single frame in Chrome to get a “fresh“ reference to the gamepad objects. You can not simply store and reuse the references since chrome doesn't update the input values on these “old“ objects. Also the timestamp property has a wrong value in Chrome. It also can happen that chrome shows some kind of “ghost“ gamepads, so you should not bank on the provided number of plugged gamepads and therefore you should not automatically map them To the player profiles. Instead you should let the players connect the single gamepads to their single player profiles by pressing a button. This way you can ensure that your players are connected with an actual gamepad device instead of a mysterious ghost device. :-)

Hi,

 

Thanks for the response.

We do check "navigator.getGamepads();" each game frame.

Gamepads work 100% on Mozilla Firefox, but not perfectly on Google Chrome.

 

You can download the current source code at below URL link:

www.OpenTetris.com

(source code download is on title screen on lower-left hand)

 

Gamepad code locations:

- "initialize.js" line 118

- "screens.js" lines 127 - 129

- "input.js" lines 121 - 161

 

If you can look at our source code later and help us we would appreciated it.

Thanks!

 

 

JeZxLee

Link to comment
Share on other sites

OK....

 

So the gamepads ARE working on Google Chrome.

The issue is that the mapping is incorrect for SOME of my U.S.B. gamepads.

 

Working now on a gamepad custom mapping system.

Will post it when it's ready for testing.

 

Thanks!

 

JeZxLee

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...