ashes999 Posted October 12, 2014 Share Posted October 12, 2014 I made a very simple game where you have a dragon flying on screen and collecting balloons. You can play it here, courtesy of GitHub Pages. You can view the source on GitHub, but be aware that it's CoffeeScript. (If you want to see the raw Javascript, you can see it here.) The game runs fairly quickly on my dev boxes in Chrome (tested in Linux VMs). It doesn't have much; maybe 10-15 sprites on screen at once, one text object, and some sine waves (yeah, I know, I couldn't resist). I built it using PhoneGap's cloud build service (it's quick to set up). But it runs slow on Android. Really slow. Oozingly slow, like a few frames per second. I'm not sure why. I checked it on my phone (Samsung Galaxy Discover -- circa 2012). I also checked it on BlueStacks, which should run lightning-fast on my desktop PC. It's still slow. Any suggestions? Is it because I left the drawing mode in AUTO instead of CANVAS? spinnerbox 1 Link to comment Share on other sites More sharing options...
lukaszwojciak Posted October 12, 2014 Share Posted October 12, 2014 Phonegap and the uiView aren't made for game wrapping - no hardware acceleration. Try CocoonJS Canvas+ (iOS + Android) or Ejecta (iOS only). Link to comment Share on other sites More sharing options...
ashes999 Posted October 12, 2014 Author Share Posted October 12, 2014 I tried CocoonJS and I didn't like it. With PhoneGap, after waiting about 15-20 seconds, I get a "hello world" app building to ~300kb. With CocoonJS, after waiting around three minutes, I get an equivalent 18MB app. Link to comment Share on other sites More sharing options...
Wavertron Posted October 13, 2014 Share Posted October 13, 2014 I recently used the Intel XDK and performance was great. On par with cocoonjs. The trick was to build an Android Crosswalk app (A standard Android app was woeful). Dunno about iOS but XDK can compile for it.Edit: yeah I think you might want to use CANVAS not AUTO. I haven't done a lot of testing around this but I used CANVAS I think.As an aside I've read that Intel is really pushing for html5 Link to comment Share on other sites More sharing options...
JUL Posted October 13, 2014 Share Posted October 13, 2014 While it's true that intel XDK rendering preformannces are similar to cocoonjs', from my experience on android, the sound support/management is total crap.Playing multiple sounds turns to a catastrophe. Anyway, your dragon game above, I can confirm it runs smoothly with chrome (on OSX), and very poorly with firefox. Try using Phaser 2.0.7, I'm quite sure those slowdowns come from the latests versions, namely, 2.1.2 and 2.1.1, which run on a different version of pixi which triggers those slowdowns problems. I'm 99% sure those slowdowns won't occure with 2.0.7. spinnerbox 1 Link to comment Share on other sites More sharing options...
j0hnskot Posted October 13, 2014 Share Posted October 13, 2014 Try removing the text first. I think there should be some fps increase. If this is the case replace it with bitmap font.Also check the performance by disabling some functions in your update loop. On my samsung galaxy core runs with about 20-30 fps on chrome. Link to comment Share on other sites More sharing options...
casarock Posted October 13, 2014 Share Posted October 13, 2014 Hi, I've figured out, that using a TTF-Based text on a Firefox Device causes terrible slowdowns! Maybe it's the same problem when using Phonegap? Link to comment Share on other sites More sharing options...
Wavertron Posted October 13, 2014 Share Posted October 13, 2014 JUL, did you build for Android Crosswalk in XDK? I was just testing my apk now and sound seemed fine. The game is pretty simple though sound wise: music plus just one or two SFX firing at any given time. Link to comment Share on other sites More sharing options...
valueerror Posted October 13, 2014 Share Posted October 13, 2014 i have no problems with sound and crosswalk at all.. with cocoonjs the sound "jumps" on the first note.. with crosswalk i can play several long songs over each other and it works flawlessly.. one tip for crosswalk: use WEBGL for crosswalk not canvas.. (with cocoonjs it is the other way around) - it will be faster Link to comment Share on other sites More sharing options...
ashes999 Posted October 13, 2014 Author Share Posted October 13, 2014 I tried: - Phaser 2.0.7 (no effect)- CANVAS mode (big performance boost)It's still super slow. I'll have to come back to this later. I still need to try: - PhoneGap + CrossWalk app- Removing text- Removing some logic Thanks all. Link to comment Share on other sites More sharing options...
ashes999 Posted November 6, 2014 Author Share Posted November 6, 2014 Removing the text seems to give me around 40FPS on BlueStacks, but only around 10FPS on my phone. Odd. Maybe trying to render an 800x600 game onto a 320x240 device is the reason why. 10FPS is pretty much unplayable. I'm stuck for now. Link to comment Share on other sites More sharing options...
Recommended Posts