Crosswalk performance advise?

Get help using Construct 2

Post » Sun Feb 08, 2015 10:23 am

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,
TheWyrm
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Sun Feb 08, 2015 11:37 am

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?
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Sun Feb 08, 2015 12:43 pm

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)?
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836

Post » Sun Feb 08, 2015 5:43 pm

@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?
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Sun Feb 08, 2015 7:09 pm

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...
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836

Post » Sun Feb 08, 2015 7:39 pm

@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.
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Sun Feb 08, 2015 7:47 pm

bullet does not really use the physics object, its more like the custom movement behavior
Read this:
yeah, i really like to say that you should "Read this:"
B
12
S
5
Posts: 138
Reputation: 1,490

Post » Sun Feb 08, 2015 7:57 pm

@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.
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Sun Feb 08, 2015 8:15 pm

Bullet + bounce off solid sounds like a good option. Fingers crossed....
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836

Post » Mon Feb 09, 2015 1:06 pm

@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.
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Next

Return to How do I....?

Who is online

Users browsing this forum: blue visionary, Google [Bot], OBLIVION, tarek2 and 16 guests