Touch.Acceleration returns value 0 in WindowsPhone

Discussion and feedback on Construct 2

Post » Thu Jan 16, 2014 7:27 am

@Ashley

After I've finished my first bigger project (Bounce Line) I've noticed that I've could optimize the game much better, make it work on different resolutions without graphical glitches ... etc. Also I've noticed that it had some lag on mobile browsers, so I've begun to test what mobile browsers can handle.

In the meantime time I've changed my personal phone from LG Optimus 2X (Android 4.0.4) to Nokia Lumia 925 (Windows Phone 8). While testing the C2 accelerometer functions on mobile browser I've observed that it doesn't work on Windows Phone 8 at all.

This is the test page: http://tinyurl.com/c2acceltest
Here is the CAPX file: BrowserAccelTest.capx

I've invested some free time to get the following results:

[CODE]Nokia Lumia 925 (WindowsPhone 8.0)
Stock Browser (Internet Explorer Mobile 10)

Battery Level: Does not work, shows 100
Language Does not work, doesn't show nothing
Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Does not work, shows 0
Alpha, Beta, Gamma: Does not work, shows 0

HTC Mozart T8698 (WindowsPhone 7.8)
Stock Browser (Internet Explorer Mobile 9)

Battery Level: Does not work, shows 100
Language Does not work, doesn't show nothing
Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Does not work, shows 0
Alpha, Beta, Gamma: Does not work, shows 0[/CODE]

[CODE]iPhone 4
Stock Browser (Safari)

Battery Level: Does not work, shows 100
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Works
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works[/CODE]

[CODE]LG Optimus 2X

Stock Browser (Android 4.0.4)

Battery Level: Does not work, shows 100
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works

Chrome (v31.0.1650.59)
Battery Level: Does not work, shows 100
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Works
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works

Dolphin (v10.2.3)
Battery Level: Does not work, shows 100
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works

Dolphin Mini (v2.3)
Battery Level: Does not work, shows 100
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works

Opera (v18.0.1290.67495)
Battery Level: Does not work, shows 100
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Works
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works

Opera Beta (v19.0.1340.69518)
Battery Level: Does not work, shows 100
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Works
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works

Firefox (v26.0.1)
Battery Level: Works !!!
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Works
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works

UC Browser HD (v2.5.350)
Battery Level: Does not work . Shows 100
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works

UC Browser (v9.5.0.360)
Battery Level: Works !!!
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works[/CODE]

[CODE]Newman N2 / Freelander i20 (Android 4.1.1)

Stock Browser (Android 4.1.1)

Battery Level: Does not work, shows 100
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works
* Strange sensor behaviour (Megaman flies out of the screen)

Firefox (v25.0.1)
Battery Level: Works !!!
Language, Platform, DevicePixelRatio, BrowserName: Works
AccelerationX, AccelerationY, AccelerationZ : Works
AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works
Alpha, Beta, Gamma: Works[/CODE]

My conclusions:

1.
You could say that
(_)
( _)>-
(_)
WindowsPhone can't handle dancing Megaman
YEEEEAAAAAAAAHH

2. Browser.BatteryLevel is supported only by a few browsers (all of them on Android only). This function would be usefull for FullScreen games in order to see the battery level during gameplay until is too late (when you receive the low battery warning)

3. Touch.Acceleration_, Touch.Acceleration_WithG, Alpha, Beta, Gamma returns the same values regardless the orientation ... So you would have to make 4 different profiles for it (Portrait, Upside Down, Landscape Left, Landscape Right)
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Post » Thu Jan 16, 2014 12:49 pm

It's the browser that doesn't support those features. C2 can use them if the browser supports them, but if the browser doesn't then there's not much that can be done. Hopefully the Windows Phone 8.1 update with IE11 will fix a lot of that.
Scirra Founder
B
402
S
238
G
89
Posts: 24,637
Reputation: 196,071

Post » Thu Jan 16, 2014 6:28 pm

I thought it had something to do with the manifest file

Thanks for the answer
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Post » Mon Feb 17, 2014 6:55 pm

Is there a way to hard code in a C# method to give a value from acceleometer to the c2runtime? More explanation from me in this thread:
http://www.scirra.com/forum/give-value-from-c-to-c2runtime_topic86681.html
B
14
S
6
G
4
Posts: 107
Reputation: 4,868

Post » Mon Feb 17, 2014 8:21 pm

@trollface

As far as I'm concerned, at the moment it works on Android and iOS ... And WindowsPhone 8.1 update will bring Internet Explorer Mobile 11 TGeorgeMihai2014-02-17 20:22:49
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Post » Mon Feb 17, 2014 8:45 pm

[QUOTE=TGeorgeMihai] @trollface

As far as I'm concerned, at the moment it works on Android and iOS ... And WindowsPhone 8.1 update will bring Internet Explorer Mobile 11 [/QUOTE]

When I get my hands on the 8.1 SDK soon, I'll let you know.
B
31
S
10
G
7
Posts: 416
Reputation: 7,264

Post » Mon Feb 17, 2014 9:27 pm

This can be done with C#, and in truth it has been on my backlog for a long time. Windows Phone 8.1 should support it though, so I'll wait and see before adding anything.
Moderator
B
72
S
14
G
11
Posts: 900
Reputation: 11,945

Post » Thu Dec 18, 2014 5:18 am

I have tested the browswer test from IE (windows phone) and it works (more less) but after exporting the same project to Windows Phone and running it in the device, cant' get the alfa,beta, gamma values.

Is this a bug ? Shouldn work ? since it works from the browser...

Does someone knows if it's possible to get alfa, beta, gamma values from the acceloremeter when exportin to WP8 ?

Thanks in advance
B
6
Posts: 4
Reputation: 558


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests