Crosswalk performance advise?

0 favourites
  • 12 posts
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • Hi guys,

    I made a relatively simple game and built an android version in the IDK using crosswalk. After disabling pretty much everything (It only spawns a single 64x64 pixel sprite) it runs at about 35 fps on a Nexus 4 (Lollipop).

    Do people have any tips and tricks on getting more out of it? or is this as good as it gets?

    FYI I tried cranberrygames WebViewPlus plugin (Not much of a difference) and changed crossalk versions (stable, 7 and 10).

    Thanks in advance,


  • So after a bit more digging I found that sprite had a physics behavior. So it seems you loose about 25fps by just having one moving physics object.

    Any ideas how or if this can be optimized?

  • I can only think that maybe it's worth trying cocoonjs physics. Then again, if you only have one physics object, why use physics at all? Unless you mean one movable object and a few fixed objects for it to bump into, which ups the object count. I gave up trying physics on mobile after doing some perf tests to compare Corona SDK (lua - native) with wrapped JavaScript on a Samsung S2 - there was no comparison...

    So, to answer your question, is there a way to emulate physics behaviour for your one object (make it fall - use bullet behaviour or just move it using events)?

  • Colludium Nah, I use many physics objects bumping into each other (think asteroid field) and I was getting only 10fps on my first attempt. I just stripped out everything to find the performance culprit. It ended up being two things.

    1. Adjust HSL web effect on asteroids. I can replace this with extra graphics and it bring performance up to 35 fps.

    2. Having any physics objects moving. Having one knocks off about 25fps. Having more than one doesn't impact much more dramatically within reason. So I assume what I'm seeing is the overhead of the phsyics engine when its active.

    However, saying that I have tried swapping asm.js and implemented WebViewPlus. Supposedly asm.js is better for chrome and I'm hoping the nitro js engine speeds it up. So I'll see what happens with my tests.

    I also thought that perhaps I could reduce the intensity of the physics by changing the stepping?

  • Sorry, dude, I don't know of any way to optimize it to make it work in C2. Using Corona SDK I could get a couple of hundred physics objects all bouncing around at 60 fps on my samsung s2, so I think your only option would be either to go native or to wait a few years...

  • Colludium not so smiley face.

    So I guess I could use bullet with bounce off solids on to replicate the physics. However, does this not still use the physics engine?

    Corona could be an option, but a last one as I don't really want to have to start from scratch.

  • bullet does not really use the physics object, its more like the custom movement behavior

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • EyeForcz Righto, I'll give it a whirl then as it shouldnt take long to convert. Although I will loose the gravitational pull.

    Colludium and EyeForcz thanks guys. You're legends.

  • Bullet + bounce off solid sounds like a good option. Fingers crossed....

  • Colludium

    So from my tests of 60 physics objects I get;

    • Box2d web = 32 FPS
    • Box2d asm.js = 35 FPS
    • Box2d chipmunk = 34 FPS

    So yeah, I wouldn't say I can see any massive performance hike for asm.js.

    Then for my bullet test I get 35 FPS. So I assume it uses the assigned physics engine OR it's a complete coincidence.

  • Boooo! Sorry to hear that! Perhaps if you specify quad core / nexus 5 level of handset...? I know though - hardly inspiring.

  • Colludium I spent most of the day tinkering and I have got to the point where I get a stable 55 fps with 60 physics objects using asm.js. I'll keep you posted but I believe it maybe caused by something else in the project conflicting with the physics engine. Essentially I am rebuilding my game from scratch and testing it on device regularly to find out what is that something.

    So looking promising...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)