[BEHAVIOR] Chipmunk Physics

  • Hi,

    On my capx, standard phycic behavior seems to be more accurate than chipmunk regarding collisions. What did I do wrong ?

    http://canapin.com/construct/tests/physicstiles/

    [attachment=0:2zggrgmn]physicstile.png[/attachment:2zggrgmn]

    [attachment=1:2zggrgmn]physicstile.capx[/attachment:2zggrgmn]

  • Chipmunks collision response is just spongier than box2d as best I can tell.

  • Crudemik - great stuff, but you can move development back from unity now we have better physics

    R0J0hound does the javascript port of chipmunk have the autogeometry feature?

  • mattb

    No it doesn't. It's part of the now free chipmunk2d pro version which isn't really portable like the normal chipmunk2d api.

  • outside position updating is worst then web.js for collision games (as pool ) nothing much different...

  • So much goodness here. Thank you oh great R0j0Hound. If I make what I'm intending to make, you get a BILLION free copies!!

  • [quote:180no4fa]outside position updating is worst then web.js for collision games (as pool ) nothing much different...

    I do not understand.

    damjancd and everyone else with encouraging words to say, Thanks, I'm glad this is useful.

  • R0J0hound

    I am unsure what the max force for a joint setting is for. If i do a test based on the return of Jointimpulse then i can break the joint when i want, regardless of whether max force is set to infinity or not. Where would i use max force ?

    Thanks

  • spongehammer

    Max force limits the amount of force a joint can exert. One possible use is to limit motor force. Also it can be used for situations where a things bind up. Without a max force the objects can break free at a high rate of speed once they're no longer bound up.

  • R0J0hound

    Ah thanks I will have to mess about with it so really see what it does .

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound I may have encountered a bug/feature.... when you have a global sprite with Chipmunk applied to it, it works normally but there is a javascript error generated in case you switch the animation of the sprite ( even if you disable the chipmunk physics and then change the animation, the error continues to be generated ).

  • R0J0hound

    Hi , there seems to be a bug with the motor joint. See attached capx. For me anything under 50x50px stops rotating almost straight away.

  • I have a random question. Should we be using dt whenever we apply a force? I'm confused if physics is at a fixed timestep. If timestep is 1/30, that means if fps is 60fps, it would update twice per frame(120 physics cycles)? if it is 30fps, it would still update twice per frame(60 physics cycles)?..

    hm.. If that's the case, then apply dt to forces is necessary, unless I'm not understanding it correctly.

    edit: also, if that's the case, then gravity would change based on fps?

  • striimix

    I can't reproduce it. Can you provide a capx that gives that error?

    spongehammer

    That's just a case of over aggressive sleeping. Disabling sleeping fixes it. Although it is odd that size has anything to do with it.

    Prominent

    You shouldn't need to use dt anywhere. A fixed timestep of 1/30 is the timestep used per frame. So if the game is running at 60fps then after 60 frames the physics will be 2 seconds along compared to the actual 1 second.

    You can specify a variable timestep but that isn't so good with physics, so a fixed timestep is recommended. The drawback is the physics can run faster/slower depending on the screen refresh rate, aka it's not framerate independent. That said you could detect the fps of the game when it starts and set the timestep based on that.

  • Sleeping ! i can hear it snoring

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