Alternate physics behaviors for C3?

0 favourites
  • 11 posts
From the Asset Store
Physics Block Puzzle game template for Construct 3
  • I didn't know where else to post this. I've been searching for so long for some alternative to Box2D, but I haven't found a thing. I heard about ROJOhound's port of Chipmunk2D, but that isn't being updated anymore. Anyone have anything? I can't find any results on the web, and I'm starting to lose hope. Please? I'm starting to go insane over this.

  • If there isn’t one for c3 on the asset store there probably isn’t one. If you like dealing with JavaScript then with scripting it could be possible to use some js physics library.

    Anything in particular you’re wanting to do physics wise? I have no interest in JavaScript in C3 or the c3 plug-in sdk but I do like event based physics.

  • Funnily enough, I've recently been searching for an alternative to the current Box2D physics, as I have hit a few roadblocks due to 1 major limitation in the current physics behaviour - collision filtering.

    I keep wondering if collision filtering is simply not possible with Box2D, and perhaps something else such as chipmunk, or Matter.JS, could give us collision filtering. On C2, I literally couldn't have made a specific project I was doing if it weren't for R0j0's amazing chipmunk physics plugin (so much appreciation for that, R0j0!)

    A very basic example of why collision filtering is important - say you make a multiplayer platformer game using physics only, and you want to have "jump thru" platforms - If Player 1 is travelling down and needs to land on the jump-thru, whilst Player 2 is jumping from below the jump-thru, you would want to enable collisions between Player 1 and the jump-thru, and disable collisions between Player 2 and the jump-thru.

    You cannot achieve this, as once you disable collisions for Player 2, then ALL players will have their collisions disabled, meaning Player 1 falls right through the jump-thru.

    There are likely workarounds, one I saw was to have a 2nd type of player object attached to the main player object, and then enable/disable the physics behaviour depending on whether they need to travel up or down, but that is quite tricky and fiddly to deal with. I did test a hopeful workaround which was adding 2 physics behaviours to 1 object, but from my tests, I think Box2D goes by UID, so if you disabled collisions with the jump-thru on the 2nd physics behaviour, it disables collisions for the 1st physics behaviour too. Arrgh!

    On a project I'm working on, I wanted to have physics cars to drive through sonic-style loop-de-loops, which involves enabling and disabling collisions as you reach different segments of the loop. Very doable with solids or pure events, but I cannot find a way to do this with physics, and I really don't want to have to clone every vehicle part and make sure to match their physics properties and collision polygon every time I want to make a change - I can imagine it being even more complicated when dealing with switching to the cloned vehicle parts when a vehicle is made up of physics wheel joints and such.

    Definitely something for the suggestions platform, but need to write it all up neatly!

  • I should point out that the limits of the physics behavior have nothing to do with box2d. The behavior only uses a subset of box2d and some of the quirks of the physics behavior has to do with how it interfaces between box2d and construct.

    Making the request for more filtering and pointing out how the current filtering isn’t enough may be useful. The box2d api has the same filtering available that chipmunk has available. It’s just a matter of if and how it’s exposed to the behavior.

  • There was a paid plugin Box2D+ for C2 which had collision filtering and tons of other useful features. I wish someone could port that plugin for C3.

  • Thanks you all, I'll look into all of these!

  • If there isn’t one for c3 on the asset store there probably isn’t one. If you like dealing with JavaScript then with scripting it could be possible to use some js physics library.

    Anything in particular you’re wanting to do physics wise? I have no interest in JavaScript in C3 or the c3 plug-in sdk but I do like event based physics.

    See, the problem isn't really the physics, it's the way they're simulated. I think it's OK to do what C3 does with it's physics if, you know, it actually updated every frame and worked with position setting. It just doesn't work as well as I've heard your's did, or any other behavior did. I might think about doing this in an engine that, you know, has a built in physics engine. I love C3 to death, but the lack of physics makes it really annoying to make the game I want to.

  • I’m not following what specific issue you’re having with the physics behavior. You mention something about it not working with setting position?

    Box2d, chipmunk, matterjs, and most 2d physics engines are velocity based. So joints and collision response is solved by applying impulses. It still kind of handles it when object positions are set directly, but it doesn’t usually look as good.

    The physics behavior does have a little extra where when you drag a physics object and let go it updates the velocity so it’s thrown, but that’s extra. I’m guessing that is undesired behavior for you?

    There is an alternate way physics can be simulated and that’s with position based dynamics, but there isn’t a library for that as far as I know.

    However, let’s take a step back. What kind of physics simulation are you after? What would you like it to do, and how is the physics behavior failing?

  • Jase00I just wanted to chime in quickly to say I've hit the exact same roadblock before. Collision filtering is missing from the plugin, pretty much required for certain things, and it's not about Box2D not supporting it. IT's simply not implemented inside Construct :(

    box2d.org/documentation/md__d_1__git_hub_box2d_docs_dynamics.html

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • LiquidFun library from Google is able to do a lot of things and it has several interesting particles features. I have posted again the feature request in the new 2023 thread. Please visit the page to have a look and vote again the idea!

    Click here to visit the new thread and vote!

  • Thanks for the info R0j0 and WackyToaster!

    I have now created a suggestion for collision filtering. Feel free to vote for it and write other examples you can think of:

    https://construct23.ideas.aha.io/ideas/C23-I-128

    I do think the LiquidFun library looks really cool - I have to wonder if it would be a tricky decision for Scirra to implement, I wonder if be compatible with the "Physics" behaviour, in the sense that, if someone threw in the "LiquidFun" behaviour/plugin into their project and expected their existing Physics objects to interact with LiquidFun, would that work, or does Box2D and LiquidFun exist as completely different methods of physics? No clue, but just a thought on the potential complexity of this. Regardless, I have voted because it is definitely something I'd use and assuming it's designed to be extremely performant compared to a bunch of Box2D objects simulating water, then heck yes!

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