Is there going to be a feature update in physics?

Discussion and feedback on Construct 2

Post » Tue Jan 20, 2015 1:18 am

@Colludium - Well, to be fair, It is impossible to make the perfect tool that does everything perfectly. And I must admit that construct 2 has amazing features... I just feel that physics in particular needs a boost. I also think that in general construct 2 is more suitable for smaller projects due to the lack of pre fabs, compound object mangers, etc... so adding in physics features that someone making a really simple game can live with out may not be worth the time...

Priorities

either way, Ashley will be generous...

Of course, if I was making construct 2, it would have been in xna, only export to desktop machines, etc... But then I would get alot of complaints about other things. and it wouldn't have been construct 2. It would have been much crappier for everything other than want I wanted at the moment... lol
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Tue Jan 20, 2015 1:50 pm

The physics engine is difficult. I want to go with only the asm.js physics engine, but at the time the asm.js version was built it lacked the ability to disable collisions. That's pretty much the only reason it's not the default, since right now any project using that feature will be broken by switching across to asm.js.

Adding that feature to the asm.js build has become very complicated since Emscripten subsequently got a bunch of updates and broke backwards compatibility. So despite the asm.js physics being open source, it's no longer useful since it does not build with Emscripten any more. I contacted the original developer on a couple of occasions, and they say they are too busy to update it. Besides people are now asking for features like certain types of joints that aren't supported by the (now fairly old) version of box2d that the asm.js version was built against. So to get that one last feature for asm.js and make it the default, the entire asm.js port of box2d needs to basically be rewritten from scratch. That is a pretty complicated project, and the end result may not even be backwards compatible with what we have now either (even just a slight change in the way floating point calculations are rounded can have a cascade effect with results like a tower of objects falling in a different direction with significant change to the gameplay).

Since as ever we get a constant stream of feature requests and we could never have time to deal with them all, we prioritise the easy ones, or the really important ones. This is not easy, and I see the existing situation as acceptable (there is the high-performance option with a single missing feature, or the slower box2dweb which has collision disabling). So weighing it up with the amount of work vs. benefit to be gained, I see it as not ranking very high. That doesn't mean we won't do it, it's just more likely to fall behind other things (like the requests we get for the image editor, and 'open external editor' is a good example of something easy which can bring a lot of benefit).

Box2d and Emscripten are both free open source projects, so in theory anyone could come along and do this work, and then we should easily be able to integrate it back in to the behavior. But with all the other demands other customers are making it's hard to justify ourselves doing that. So if you know how to do it yourself or have any other developers handy, building the latest Box2D with Emscripten and writing the bindings is 90% of the job.

I don't know what tests you guys are running but asm.js typically comes out 3-4x faster than box2dweb for me. I just ran another stress test to confirm: 2700 objects at 30 FPS with asm.js, and 850 at 30 FPS with box2dweb, making asm.js over 3x faster, and that's in Chrome which doesn't yet specifically compile asm.js code like Firefox does.
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448

Post » Tue Jan 20, 2015 2:46 pm

@Ashley - thanks for the update, I completely understand your reasons for not rushing into such a project.

Just for your info, the throttle testing capx I used before and referenced above can be found in this thread. It throttles to approx 50 fps and, across a variety of platforms, I can see no difference in performance between asm.js and box 2d (bouncing balls on screen). It may be that asm.js performs better under stress, but the two have similar limits when used in what I would describe as a more representative project where the intent is to avoid max-ing out the engine.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Wed Jan 21, 2015 2:00 am

@Ashley - Thanks, that's exactly what I needed to know. I think I am going to try and tackle this... I would rather ams.js so I'll see about getting a build done (research first)...

As for the test I just swapped out ams.js with regular box2dweb in a moderate physics game and then watched cpu - nothing fancy and not a real stress test... but I didn't see a big difference in cpu use. I didn't try a max load test.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Wed Jan 21, 2015 2:02 am

My biggest fear would be to do work that could be outdated by an update in construct... So... if you could, if you do hear anything or priorities change, could you please let me know, if you think of it...
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Wed Jan 21, 2015 4:05 am

@Ashley - What version of ams.js is being used by construct? I found a recent build featuring the most recent version of box2d. It seems like a completely automatic build using emscripten. The bindings are also auto generated.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Wed Jan 21, 2015 11:14 am

It's based on https://github.com/kripken/box2d.js/, but funnily enough, it looks like it got an update a few weeks ago! I hadn't realised. I'll look in to what's changed for the next beta cycle.
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: WealthyKing and 15 guests