[BEHAVIOR] Chipmunk Physics

From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • doh, been having a bad debugging day. thanks <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> here's the fixed setup for anyone that's interested: https://dl.dropboxusercontent.com/u/523 ... Fixed.capx

  • Is anyone else having problems with the built-in save/load system, the physics seem to lag behind a fair bit.


  • MiniHulk

    That's interesting it pauses for a bit, no idea why it does that. The behavior actually has nothing in place to support save/load currently.

  • Just wanted to report that the newest beta version of Construct 2 r217 causes 10% increase in CPU usage, not sure why. Box2D seems to be significantly stronger in processing large amounts of collisions. I dont remember this being the case before. But perhaps it was.

  • Try Construct 3

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

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

    Nothing's changed with the plugin of even c2's runtime that should effect the performance as far as i know.

    One reason why a large amount of collisions would be slower than with the physics behavior is the pre and post collide triggers i imagine.

  • Quick feedback, specifficaly for android mobiles, through cordova on Intel Xdk. The chipmunk physics has nearly 80% better performance than the default physics behavior. Almost no lagging, more fluid movement and gravity reactions.

    Tested with same game contraptions at the same mobiles, with apk made with Intel Xdk crosswalk android. I'm not in pc right now but when i do, i can send details if you want.

  • Hey R0J0hound

    I just want you to ask if there is a possibility to make a kinematic body with chipmunk.

    Not like the previous examples mattb give (the one with the platforms) i mean is there a chance to add to this behavior set physics bodies kinematic and do the trick. i am asking that because I am working with box2d and Ruskul managed to add set body kinematic to box2d .js file and you can apply other behaviors to kinematic body like sine and works pretty well specially if there is other physics bodies with joints on it (they dont break and acts like it should be) But Box2d is very slow and has a lot of limitations compared to chipmunk .

    Is there a chance to see something new on chipmunk? Or this chapter is close for you.

    Great behavior by the way .Thanx .

  • Chipmunk2d doesn't really have kinematic bodies like box2d.

    Wouldn't setting the collision to none, giving the object a high mass, and canceling the gravity like below work?

    sprite: chipmunk: on pre step

    sprite: chipmunk: apply force rect(0,-self.chipmunk.gravity*self.chipmunk.mass)

    I realize it doesn't match box2d's defination exactly...

    [quote:23aut8md]A kinematic body moves under simulation according to its velocity. Kinematic bodies do not respond to forces. They can be moved manually by the user, but normally a kinematic body is moved by setting its velocity. A kinematic body behaves as if it has infinite mass, however, Box2D stores zero for the mass and the inverse mass. Kinematic bodies do not collide with other static or kinematic bodies.

    Namely, not responding to forces. You can set the mass to be infinite with events but there is a NaN issue with the library when doing that so a very high mass is better.

  • , also in addition to what r0j0hound said, if you need to move it, you can use a separate object to position the other one that shouldn't be affected by forces. r0j0hound helped me with this in the past, here is a snapshot of how I handle it:

    the two use different layering groups so they don't collide with each other, and I turn rotation off on the object that follows the other, and give it a high mass value too. Works perfectly.

  • Hey R0J0hound and Prominent

    Really really nice approach of the Kinematic.

    It works really smooth specially with the sine behavior .

  • youtube.com/watch

    Hi, I need help on the joints. As you can see in the screenshots, I create something like microorganism fluid forms. At this stage, I ran into a problem: the cells repel each other and do not want to live together as a single substance. What additional commands should be used? How can I do to cells could be added, the body grow, and being lived in one form? In principle, it does not matter, it will be liquid or not, the main thing - is that growth is on the cells, as well as destruction.

    Still I am trying to make sure that they are not repelled by each other like mad, but do not pass through each other. Any idea how to do it?

    Sorry for my English, I myself am from Russia.

  • I'm having trouble adding the ability to drag an object. I have it so that when mouse down to position an object and have it with a joint to another object that will be dragged, but when I drag it through a wall, the joint gets repositioned so that the objects become separated(joined from a distance), even when I move the mouse back out of the wall.

    Any ideas on how to fix?

  • Prominent

    It's hard to say without a capx. It would be odd if the joint got offset but I suppose it would depend on the joint type.

    Is the dragging similar to this? (from the first post)

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

  • ahhh! I think I know what is the issue. Seems like when the pointer object(object being positioned to the mouse) is not set to immovable(in the physics), then the joint position gets altered when trying to drag through an object.. But if I set the pointer to immovable, then the joint stays in correct position even if I drag stuff into an object.

    Not sure why the difference occurs depending on that setting, but I might be able to work with this now.

    So to recap, yeah- I had been doing it like that example, but I didn't have the pointer set to immovable. Having it movable produces weird results when dragging stuff through immovable objects.

  • Now I'm having another issue.. Seems when I try to join objects together using a gear joint and a pivot, one of the objects turns 360 degrees before it settles back to the position it should be in.

    Not sure what I'm doing wrong.. It doesn't happen all the time, but seems to depend on orientation of the objects. Is there anything I need to keep in mind when doing this? like should the angles be between 0-360, or -180-180?

    edit: here's an exmaple: http://1drv.ms/1YvddfG

    Seems like setting the angle before joining will mess it up. Any way to get around this?

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