Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have created a small game project in HTML5 using Phaser engine (tried both 1.1.5 and 1.1.6). Then to port it to mobile platform, used Phonegap/Cordova for Windows Phone 8, Android and iOS.

In my game, there are around 10 elements, which get animated (moving from point a to point b and some rotation at same time). On iOS and Windows Phone 8, I didn't face any issue.

But with Android, performance is unacceptable. On the other hand, if I run my game via device browser, it run smooth without any lag. But compiled APK runs very jerky and elements move very slow & in flickering manner.

I have checked android hardware acceleration flag is set to "true" in manifest file. Tried changing it false too, but that didn't reflected any change in performance.

I have checked same on Android 4.2 on Samsung S2 device and on that performance is better. But on Asus Nexus Tab 7 (running Android 4.4) its very jerky, while the OS and Device both are latest. Also checked on another device running Android 4.3 (Samsung Galaxy Grand Duos) and on that too performance is not good at all.

In my game tried both WebGL / Canvas rendering (Phaser engine uses Pixi.js, which fallback to 2d canvas if WebGL isn't supported), but no change. Similarly with easeljs.

If anyone else faced similar issue and can suggest any way to get native like performance. I checked cocoonjs examples and while they seems smooth and acceptable, I can't go for that route.

share|improve this question
2  
This question is very well written. I would like to know if you ran a benchmark or profiler to narrow down on what might be the culprit and if you contacted phonegap with a set of easy steps to reproduce this? –  Zehelvion Mar 1 at 9:51
    
I haven't written to phonegap yet. Tried profiler and couldn't find anything unusual with the framework or codebase. Perhaps thats the reason why everything runs smooth on desktop as well mobile browser too. One finding was that Android has a different runtime for WebView based apps and browser itself. But couldn't find anything which indicate that why such small tweening is causing so much lag in APK (WebView) mode. In fact, this issue is appearing on Nexus tab running KitKat which is said to have fastest webview (Chrome based). –  devilzk83 Mar 7 at 5:25
    
This is very superficial observation on my part; it seems that you might be onto a bug. I don't see why would there be a strong discrepancy in performance between highly-end devices. –  Zehelvion Mar 7 at 12:59
    
I think I m facing your very same problem. My game (fleeing chick on play store) runs quite smoothly on galaxy s2, because it has a small screen. On my nexus 7 it s quite slow. For some reason webgl doesn't seem to work for phonegap based apps. It may be a webview issue. The stock browser (chrome) on KitKat, supports phaser.webgl correctly. I have not found a solution to this issue yet. –  GNUton Mar 9 at 21:13
1  
I'm curious why you don't want to go the CocoonJS route. I believe both Phaser and Pixi run well within CocoonJS. What's preventing you from trying that option? –  Geoff Mar 10 at 16:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.