Input differences

Discussion and feedback on Construct 2

Post » Thu Aug 15, 2013 7:31 pm

Hi, im coding a fighting game in c2 and started working on it in firefox nightly. it worked great but i recently switched to chrome beta because it runs a constant 13% cpu instead of 75% and holds a constant 60 fps.

I noticed that after switching browsers, a few of my functions werent triggering. I had set a threshold for joystick Y input at 60% for jumping and greater than or equal to 60%for Y and 60% for X for diagonal jumping and also for wavedashing. It went from having a large trigger area to a hairpin trigger area.

it only seems to affect the diagonals and strangely enough only on the right side and not the left... idk why its happening or what the difference is between browsers. I set X to 35% threshold and fixed it for chrome but now im catering to one browser over another... not sure why its occurring and i was wondering if its simply something that is already documented regarding how chrome processes joystick inputs vs firefox.Acryte2013-08-15 19:34:04
B
9
Posts: 12
Reputation: 477

Post » Thu Aug 15, 2013 8:37 pm

Many full-time game companies are afraid to put Gamepad/Joystick controls because of how tricky/buggy it is.

You shouldn't be aiming for gamepad/joystick support on multiple web browsers, especially not for what i imagine is a hobby project. It's pretty much mission impossible, and it will almost always bug for some people.Xionor2013-08-15 20:38:23
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Thu Aug 15, 2013 11:53 pm

Thanks, I appreciate it. Tell me, is it possible for us to code it to recognize (automatically) what browser type is being operated on? Then I could just have it set the threshold to a variable and adjust it based off what browser is being utilized.
B
9
Posts: 12
Reputation: 477

Post » Fri Aug 16, 2013 12:15 am

You would have to look into the browser object

The following expression could be used to identify browser version:

Name
Get the name the browser reports for itself. This may be inaccurate for backwards compatibility reasons, e.g. Google Chrome reports its name as Netscape.

Product
Get the product the browser reports for itself. This may be inaccurate for backwards compatibility reasons, e.g. Google Chrome reports its product as Gecko.

UserAgent
Return the full user agent string for the browser, e.g. Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63.



As the manual implies, they can be inaccurate at times, but it's your only way.
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Fri Aug 16, 2013 6:58 am

Thanks, I appreciate it. I might use one of those methods if I can get it to be consistent, otherwise I'll probably have a user defined setting.
B
9
Posts: 12
Reputation: 477


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 27 guests