[BEHAVIOR] Chipmunk Physics

From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • I'm trying to use this plugin for my top-down game. I found a tutorial that shows how to do this, but I need to be able to change the "maxBias" property of a joint. I can't seem to find a way to do this- is there one? Thanks.

  • what is the best way to stop bridge vibration (I attached capx file)?

    https://www.dropbox.com/s/9ludf1q1ne148 ... .capx?dl=0

    I have a few possible solutions:

    1) if both joint impulses are great than some limit than set object's max speed to zero;

    2) compensate object's velocity by space damping;

    3) setting damping velocity manually by tracking Y velocity of object.

    R0J0hound, could you help, please?

  • Hey R0jo, I'm still battling that one issue I encountered earlier, and it is quite weird since it only happens in certain levels.

    I have had some difficulty in pinpointing the problem, but now I will scrap rest of my game and try to gather just bare bones version for demonstrating the error.. it happens when you make joints between sprites, and then one sprite's frame has been changed on the fly and it undergoes several collisions. Attached below is what I get in the console:

    Uncaught TypeError: Cannot read property 'parent' of undefined

    subtreeRemove rojoChipmunkBeta_behavior.js:2378

    BBTree.remove rojoChipmunkBeta_behavior.js:2519

    Space.removeStaticShape rojoChipmunkBeta_behavior.js:3961

    Space.removeShape rojoChipmunkBeta_behavior.js:3912

    behinstProto.updateShape rojoChipmunkBeta_behavior.js:6710

    behinstProto.changeShapeCheck rojoChipmunkBeta_behavior.js:7016

    behinstProto.tick rojoChipmunkBeta_behavior.js:7056

    Runtime.logic preview.js:2303

    Runtime.tick preview.js:2056tickFunc

    .capx to be followed as soon as I manage to strip it =)

  • Fizzick

    There currently isn't a way to access that property.

    Valex

    You might be able to set the joints max force to limit the impulses of the joints. Another thing you could try is lowering the fixed time step from1/30 to 1/60.

    Thanks for the bug report, I'll look into it when I have a chance.

  • So I'm late to the party and don't have hours to search through these 30 + pages, how does this work on Mobile devices if anyone has tried? I have my Pixel Golf game running through with Cordova export and it runs quite well on my iOS devices but the physics options are so limited that this would be great if it works well.

    I might just have to try later today for myself, but are there any active examples around of this being implemented for me to see how it runs?

  • I haven't exported with Cordova at all, but from my Moto G's Chrome for mobile, my lil test project seemed to run better than the engine(s) packaged with C2.

  • DatapawWolf

    It's not using the object's origin, it's just using the center of the object regardless of where the origin is. It was an oversight to not take into account the center of a polygon shape. I'll be taking a look into it.

    Dont want to seem pushy but how is this coming along.

    Thanks

  • Hi,

    I'm wondering if this plugin can handle the complex apparatus I'm attempting to build, mentioned here in another post a few days ago?: https://www.scirra.com/forum/how-do-i-slide-pivot-catapult-from-a-movable-platform_t129971

    I've read through all 31 pages here, and numerous tutorials, but so far I haven't been able to pick out (or recognize) the correct combination of material and/or examples that would help me get this built. The previous post contained a capx based on the Physics-Catapult template. This is as far as I've gotten with the Chipmunk2D addon:

    http://www.webmagi.com/media/uploads/scirra/Slide-Pivot-Catapult-2.capx

    Can this be done with Construct2?

    Thx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Pin joints aren't like the pin behavior. They are a rod connecting two objects. So when you add the joint the distance between the anchor points are kept. See the js demo of it here:

    https://dl.dropboxusercontent.com/u/249 ... oints.html

    R0J0hound

    Are there examples of these joints used in Construct2?

  • spongehammer

    Haven't started working on it yet.

    WebMagi

    This behavior would be useful for the simulation part of what you're doing. Adding the joints should be as easy as using one of the add joint actions and specifying the two objects and stuff like where the joint should be.

    To make the object manipulable with the mouse you can use something like the drag n drop behavior as a base. To move other objects when dragging one you would need to move them by the same amount, the pin behavior could be used for it.

  • R0J0hound

    Thanks for the info, and your time.

    In the capx I provided above, you can see that I've already added a gear and pivot joint to the Base and Pivot sprites, and a touch event for the Slide sprite. What I am lacking in are examples or documentation of the type of mechanism I'm trying to build. Mine is ridiculously inadequate. I contacted support hoping they could direct me to such examples or documentation, and was told: "it's absolutely unclear what exactly you are trying to achieve". So it's very likely that I have been too vague with my descriptions. To help clarify, I made a short video covering the functionality I am hoping to achieve.

    Please know that I am not asking for anyone to do the hard work for me, I am only asking for working examples and/or documentation that could possibly aid in my efforts to build what appears to be a one-of-a-kind Consturct2 compound structure.

    Here is the video: https://youtu.be/jaLWHBlhSmQ

  • WebMagi

    I can't think of any examples off hand, but a search for "angry birds" on the forum will give examples of a slingshot which is similar.

  • R0J0hound

    Sure, the "Template-PhysicsCatapult.capx" that comes with Construct 2 is a knockoff of angry birds. And originally I started with that template, but their whole approach does not seem conducive to what I'm trying to build. I've opened and reviewed hundreds of capx files, but so far I'm not finding a lever attached to a pivot, which acts like a tension spring when pulled backwards. Actually, the hardest thing seems to be creating a lever attached to a pivot, which slides along the top (and acts like a tension spring when pulled backwards), while also being able to pull up or push down on the pivot at every point along its entire length. So this has never been done?

    I've searched the forum for catapult, which is closer to my contraption than a slingshot, but I have not come across the right combination of examples.

    Your Chipmunk2D addon seems to offer greater flexibility than the default Construct2 physics, and the Joints demo: https://dl.dropboxusercontent.com/u/2494815/demo/Joints.html looks like the right place to start. So there are no examples of these joints being used in Construct 2?

    My apologies for being such a pain.

  • WebMagi

    It's just a matter of using joints to link it together. Then to manipulate it with just physics you can use a dummy object that's moved by the mouse that you connect and disconnect from objects. Here's an example of a possible way to set it up.

    https://dl.dropboxusercontent.com/u/542 ... aunch.capx

  • R0J0hound

    You are absolutely brilliant! This example should come standard with Construct 2. I'm assuming I can use a Touch object in place of the Mouse object? Freaking awesome!!!

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