Box2d: We need MOAR Physics.

0 favourites
From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • 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.

  • 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

  • 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.

  • 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.

  • 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: [attachment=2:35dl1rrj][/attachment:35dl1rrj]

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

    [attachment=1:35dl1rrj][/attachment:35dl1rrj]

    [attachment=0:35dl1rrj][/attachment:35dl1rrj]

    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.

  • 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.

  • 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.

  • I've often wanted those features while working with physics in C2. Would be great to have.

  • 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.

  • 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

  • If you're interested in another physics behavior I've been working on one based on chipmunk2d here:

    It already has more features than the bundled physics behavior, although I'm unsure how it compares performance wise. It's beta but I've fixed every bug I've found so far, however it just needs more testing.

    Comparing it to your list it gets about half of them right now.

    1a It currently has collision groups and layers

    1 not currently, but it's a simple change to get it working.

    2 It has every joint chipmunk2d has to offer.

    3 Not currently. I can add segments with a radius as another collision shape so you can just use objects. Other than that I'm not sure of a good workflow, but I'm open to ideas.

    4a not directly but a pivot and gear joint together should work. It is possible to give bodies multiple shapes in chipmunk.js but I haven't come up with a good workflow, so only one shape is used.

    4 It can do ray tracing with line segment queries currently.

    5 Not yet. I'll add it to my todo.

  • R0J0hound

    I had forgotten all about this. Thanks

  • R0J0hound, that's an awesome plugin - thanks for putting the work in! I repeated my performance test using your plugin - the performance of Chipmunk was identical to the stock Box 2D Web plugin.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Colludium

    That's pretty cool it performs that good. It's better than I expected.

    A bit of an update with supporting things in the list.

    1. This is kind of doable now. You can cancel the acceleration from gravity by applying force -mass*gravity in the "pre step" trigger

    5. You can get collision info now with the "on post collide" trigger.

  • spongehammer - I agree, more features is way more important than more objects on screen.

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