Jump to content

Android Browser speed up tricks for dynamic backgrounds?


Recommended Posts

Hi all,  


I'm making a TinyWings-like game with Box2D.


The Box2D portion of it works fine, and it renders barely OK on Android. However, I want to see if there are ways to optimize it!


At the moment I'm using the draw functions of Cocos2d-html5,  that basically extend the canvas API to draw some polys.


I'm thinking a way to make it more optimized is to use a bunch of sprites with different slopes, and put them together dynamically.



Does anyone else have better ideas?  Is it too much to ask for the stock Android Browser to re-draw dynamic backgrounds like this?




Link to comment
Share on other sites

Hmm that's an interesting challenge. I think you've two choices as I see it:


1) Forget about low-end browsers/devices and just go with what works. It excludes old phones but depending on what you want this game for, that may not matter?


2) Ditch the native canvas drawing operations in favour of bitmaps for sure. Unless I'm mistaken you'll get next to no GPU benefit from canvas draw ops. There may be ways to combine the two - like use image strips/sprites to do the texture and then use draw calls just to lay down the smooth tops of the hills? Definitely worth experimenting though.

Link to comment
Share on other sites

Thanks Rich!

Yeah i might go with the hybrid approach, and dump the dynamic part or just fake it by swapping out tiles.

I'm thinking standard tilemap level with an Object layer detailing the hill key points for Box2D segment bodies.


Link to comment
Share on other sites

From my experience, all current mobile browsers suck have very bad performance.


None of them can deliver 60 FPS animations. Javascript performance is terrible (20x slower than native apps). Binding to GPU is even worse. Calling WebGL routines is about 100x slower than calling OpenGL ES from native apps. 


Maybe it is because of needless complexity of Webkit. Maybe it's because of high-level programming to support many CPU architectures. I still can not believe, that there was no progress during the last 5 years. I have had the best experience with Dolphin Beta https://play.google.com/store/apps/details?id=com.dolphin.browser.lab.en&hl=cs but it has several bugs. Maybe browser developers don't have much money. I hope there will come some new browser that will "show how to do it", like Chrome did on desktops few years ago.

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.

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.


  • Recently Browsing   0 members

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