Box2d and asm.js

Discussion and feedback on Construct 2

Post » Tue Sep 24, 2013 11:48 am

Here's a comparison of ports of box2d. Its an interesting read when box2dweb is compared to asm.js

click here
B
12
S
3
G
4
Posts: 57
Reputation: 3,186

Post » Tue Sep 24, 2013 12:10 pm

We've actually experimented with an asm.js-powered version of the Physics behavior already. It was a lot faster on Firefox and Chrome, but considerably slower on IE and Safari (including iOS). It's hard for us to switch to it or even provide it as an option when performance is so unpredictable. Hopefully in future asm.js will be more widely supported and we'll be able to make the switch without making anything slower.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Tue Sep 24, 2013 4:46 pm

@Ashley - it was faster on chrome? Does that mean chrome supports asm.js now?

Again I feel that such things could be useful for those of us not targeting the open web, but rather nodewebkit and possibly cocoonjs specifically.
Moderator
B
94
S
33
G
33
Posts: 3,006
Reputation: 27,749

Post » Wed Sep 25, 2013 10:05 am

@Arima - Chrome have announced the intention to support asm.js, but in the mean time they've made the ordinary V8 engine better at handling it, so it's still quite fast.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Fri Oct 11, 2013 9:38 pm

@Ashley

Glad to hear you're trying out ASM.JS for some improvements.

Widespread ASM.JS support won't be here for a while because of the update schedule of many browsers don't have it as a priority, however I was wondering if in the future there could be an project option to use ASM.JS versions of plugins rather than the default ones.

Sort of how you can enable/disable WebGL for a project, but for ASM.JS. With Chromium's improvement and Firefox support it should cover a large enough user base, along with potentially making Node-Webkit run even faster. Faster NW support means people can do more and make games with speeds even closer to native languages. (would love to see a ASM.JS optimized benchmark with the C2 engine on Node-webkit :3)
B
21
S
8
G
6
Posts: 346
Reputation: 4,891

Post » Sat Oct 12, 2013 2:10 am

Yeah - we can already select either the accelerated or non-accelerated version of physics for cocoonjs - so could it be made that c2 automatically uses the asm.js version when exporting to node webkit, or having an option somewhere so we could decide for ourselves? Or perhaps include both in the exported game, and automatically use the asm.js version if it's a browser that supports it, and otherwise revert to the previous version?
Moderator
B
94
S
33
G
33
Posts: 3,006
Reputation: 27,749

Post » Sun Oct 13, 2013 11:45 pm

Well it could be used more than just the Physics plugin as well.
B
21
S
8
G
6
Posts: 346
Reputation: 4,891

Post » Sun Feb 16, 2014 11:34 am


Is ASM.JS physics meant to work with Node-Webkit export? Becos when I export an .EXE and i double-click and nothing happens, my game EXE doesn't run or open.

But when I switch back to the old Box2D physics then Node-Webkit export works just fine and my game EXE runs and plays.

My issue with the old Box2D physics is that I get irregular pauses and freezes in my game that can stop for a few seconds, but in Chrome preview with ASM.JS I played my game for a long time and while it had some mild occasional stutters, it never stopped for a few seconds.

Please Help!

-----------------------------

OK I figured it out!! So guys you need to turn off "Minify Script" if you want to use the newer ASM.JS Physics with Node-Webkit desktop export.

P.S. I'm guessing becos asm.js is almost like assembly/machine code, then minifying that would turn crunch it into nonfunctional noise.

(this may not be the case in future versions but for r161 it's what has worked for me)

EddyDingDongs2014-02-16 11:47:11
B
34
S
5
G
1
Posts: 78
Reputation: 3,397

Post » Sun Feb 16, 2014 1:35 pm

@EddyDingDongs - asm.js physics should work even when minified. Please post a bug report if you have trouble with that.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Sun Feb 16, 2014 5:47 pm

@Ashley

Exactly the same here too.
B
48
S
16
G
9
Posts: 1,097
Reputation: 11,195

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Eraserhead and 6 guests