Box2d: We need MOAR Physics.

Discussion and feedback on Construct 2

Post » Mon Dec 22, 2014 4:51 am

Hey everyone,

I am reviving this post, because the physics behavior has been updated (no new features yet, but a new build of ams.js came out). This is important, because it makes the adding of box2d features much more feasible and eliminates many of the reasons why we don't have these features.

A fellow user of c2 described the physics behavior as a simple box2d demo. I believe this is a apt analogy and a major letdown of c2. Construct 2 is an amazing game creator. But honestly, in the world of collision detection and resolution, the backbone of any action game, Construct 2 falls helplessly short of amazing. You can only achieve average with construct 2. The moment you want more, is the moment you realize there is no longer a good reason to use construct. This is BIG problem. Construct 2 provides speed, and ease of use. If you can't make something out of the box, right out of the box, then the advantages start to disappear.

I can list a number of things that you flat out CAN'T do with construct 2 and physics, only because those physics features haven't been exposed in the behavior. I can also tell you that a number of those features can be added in a few hours. I know because I have exposed them for my self. But the more I expose, the more I risk as any update to the behavior means alot of editor time work, or a lot of patching the behavior.

I don't think Ashley understands the importance of just a few of the missing features. They aren't optional, or fancy perks, they are absolute necessities. The only way this can be shown is by volume of response.

If you know physics isn't sufficient as it is then make this a hot topic.

On the other hand, maybe Ashley is right, and the construct 2 community needs nothing more out of physics.

But think about the following:
Have you ever wanted to apply a tangent force to an object? Have you ever wanted to know what the angle of the surface you are colliding with is? Have you ever wanted to make one way platforms easily with physics? Have you ever wanted sliding doors, or elevators? Have you ever needed moving platforms? Have you wanted to know the force of impact that one object imparts to another? Have you ever needed to stop a collision from happening on a frame by frame basis? Have you ever wanted arrows shot from a bow to stick into the wall? have you ever wanted that arrow to partially penetrate the surface it strikes? Have you ever found yourself upset that ghost collisions occur on tilemaps?

Enjoy hacking around the problem.


---------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOP list of things I need and use. I look forward to seeing what else other people use and or need.

1.a - Collision Filtering! It sure would be nice to say, hey these objects only can collide with these and so on allowing for easy environment manipulation and complex behaviors.

1. Kinematic bodies - kinematic bodies cannot be moved by other objects but can still move themselves. This is very useful for moving platforms, elevators, physics objects that need to be moved but only in contrived ways...etc. I have this working in my own fork of box2d asm.js with no bugs.

2. Prismatic Joints. - These joints are sliding joints. They can be constrained in a variety of ways but can be used for doors, pistons, and more. Personally I think they are more useful than revolute joints.

3. ChainShapes and edgeShapes - These guys have no mass but provide a static collision surface. Instead of having to build your world out of dozens, if not 100s, of immovable physics objects, you can draw a series of points that act as an immovable solid. No object can pass across the line. MOST IMPORTANTLY, they eliminate ghost vertices responsible for internal collisions. Anyone who has worked with physics in complex ways understands the importance of this. It is necessary, not optional.

4a. Weld Joints - I just want to stick things to somethings and have them stay.

4. Box2d Ray tracing. its like lasers and math had mutant offspring. but better.

5. Contacts. Information about the collision, from delta velocity at time of impact to the forces applied to the objects. I think surface normals are also included.
Last edited by ruskul on Mon Feb 09, 2015 4:18 am, edited 2 times in total.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,173

Post » Mon Dec 22, 2014 9:05 am

I would like to +1 all of the above. Its been a real bugbear of mine for ages that we dont have access to some of these important features in physics. There seems to be a real reticence to impliment them by @Ashley
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

Post » Mon Dec 22, 2014 9:46 am

I wonder how the asm.js "Disable Collisions" thing is coming along. I vaguely remember why it wasn't implemented, remember that it wasn't Scirra's fault, it was a bug or oversight or something from the developers of asm.js. Who knows. :P
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Mon Dec 22, 2014 10:01 am

There should at least be an option to use the Box2d features and disable asm.js or have a limited feature set for that version.
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

Post » Mon Dec 22, 2014 2:04 pm

OK, I thought I would put together another one of my nerdy tests to see which was best - Box 2D Web or asm.js physics.

Here's the test:
physics demo.capx


And here are screen shots of the results, run on Chrome stable Version 39.0.2171.95 m, W8.1 x64.

Box2D physics.png


asm js physics.png


On Firefox, both asm.js and Box 2D Web topped out at 701 objects / 52 FPS.

Is it just me, or does asm.js seem to offer no discernible improvement over Box 2D Web (at least for this bouncing ball test)? Subjectively, there was no difference between how each test appeared to run on my laptop. There might be situations where asm.js offers better performance and I would be interested to learn what these might be, but I don't see any evidence of that in practice.

In light of these test results and the apparent stagnation in asm.js physics development, is it worth dropping asm.js and then implementing full Box 2D physics?

Edit to tag @Ashley and to say +1 to all of the suggestions above.
You do not have the required permissions to view the files attached to this post.
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,287
Reputation: 47,558

Post » Mon Dec 22, 2014 2:15 pm

I had always assumed asm.js was included for mobile devices? As i have no interest in that area i have never tried it. I would be happy to see it removed completely in favour of the full set of Box2d features.
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

Post » Mon Dec 22, 2014 2:51 pm

@spongehammer - you might be right, although the blog talks about asm.js being slower on iOS... so it's an android only optimization. Same for me regarding target area - although I used to be interested in developing for mobile, C2 is really much better for desktop.

I thought asm.js might also help on lower-end desktop hardware as well ("...close to native speeds, even on mobile...." from the blog), but since any sort of C2 browser based physics game kills my Nexus 5 anyway, I am not convinced that physics on mobile is going to be viable for a good while yet.
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,287
Reputation: 47,558

Post » Mon Dec 22, 2014 7:53 pm

I've often wanted those features while working with physics in C2. Would be great to have.
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Tue Dec 23, 2014 6:28 am

@Colludium - @spongehammer - I thought asm.js was supposed to run javascript box2d at near native speeds. Now I may have to break out a test and see if Colludium is right using my laptop. I switched to asm.js because I thought it was supposed to be significantly better (I get 1000ish objects active at once, but I have never tested it in comparison).

I made a custom sleeper system that allows me to have up to 10,000 objects bouncing around in a layout (but I still can only have 1000 on screen. I have enabled some features, but I am hesitant to use the edited version of physics in my major project in case Ashley does release an update with more features than I have added... Then I would be stuck tediously replacing behaviors.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,173

Post » Tue Dec 23, 2014 10:07 am

For me the missing features are more important than the number of objects on the screen at any one time. And although its nice to create particle type systems with physics they are not a priority
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests