[r196.2] asm.js Revolute joints aren't strong enough

0 favourites
  • 8 posts
  • Problem Description

    Revolute joint in asm.js connects objects with a less force then in box2dweb

    Attach a Capx

    [attachment=2:3ms22n2z][/attachment:3ms22n2z]

    [attachment=1:3ms22n2z][/attachment:3ms22n2z]

    Description of Capx

    2 Absolutely identical capx, same events, objects, the only difference is the physics engine.

    1.capx - box2dweb

    2.capx - asm.js

    Steps to Reproduce Bug

    • Open 1.capx, run preview, see everything is fine, the object (let's call it a car) hits triangle and then fall
    • Open 2.capx with asm.js, run preview, when a car falls, triangle pierces car between the wheel and the base.
    • Notice that in asm.js the revolute joint is very weak, or at least weaker than in box2dweb

    Observed Result

    Triangle pierces car between the base and the wheel, wheel moves away from the base, and my game that using revolute joints is ruined, when i hit the floor on a "car" powered by asm.js physics it's base hits the ground at full force, but it's base should never move away from wheels and must never hit the ground, sometimes other "funny" incidents happen (see attached screenshot).

    That happens only in asm.js, if i use box2dweb everything is ok.

    Expected Result

    Triangle must not pierce the car, and wheel should never move away from the base, like in box2dweb.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 7, 8.1 with updated everything

    Construct 2 Version ID

    r196 or r196.2

  • I just tried everything that comes to mind to prevent the base from moving away from wheels, set density or any other option or stepping iteration or any other available physics action or value, to higher or lower values, nothing that can be done in c2, the base and wheels and all objects with joints are always act themselves like connected by jello, no matter the settings, only in asm.js, in box2dweb nothing can move wheel from a base or base from wheels or other objects with joints. This issue is very critical if you really want to replace box2dweb with asm.js, unstable joints may break all the games that using them.

  • Hi Sisyphus,

    Similar joints problem 196.2

    On my game i use distance joints to make a suspension for a vehicle. The asm.js engine makes a very weak spring action and the vehicle bottoms out all the time. There is a big difference in performance of the joints that require radically different settings for frequency and damping ratio in order to approximate the performance of the box2dweb engine.

  • There is a big difference in performance of the joints that require radically different settings for frequency and damping ratio in order to approximate the performance of the box2dweb engine.

    Hello, only distance joints have that settings, revolute joints are not, and even if you apply some settings to distance joints, you still be able to move objects with joints too far from each other. Sad to hear that your game is broken by these joints too.

  • I am also getting this bug. It's a pretty huge one in my game and I've actually had to hold off shipping this update for a while till I can get it fixed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can't tell why this is: the box2d calls both engines make are pretty much identical, so I guess this must be something that changed in the 2.2 - > 2.3 box2d update. However it looks like there's a workaround: if you set the crossbar object (Sprite3 in this example) linear damping to 1, it acts more like a solid joint and still similarly to box2dweb. My best guess is the latest box2d version now takes in to account a body's linear damping when calculating joints.

    Does setting the linear damping work around it for your game?

  • Does setting the linear damping work around it for your game?

    Nope, and i don't think there's anything to do with linear damping, when you set it to 1 in the example, objects just starting to fall slower, and when the crossbar is touching the triangle, the force of falling is not enough to make the triangle pierce between crossbar and wheel, just apply some force to crossbar, or set gravity to higher value, and you will see that linear damping doesn't help at all.

    In all of my projects that uses physics, linear damping has no effect on joints, objects just going slower, but if they hit the ground or walls and the force is enough, they are moving from each other. Here's 2 .capx to prove, linear damping on Sprite3 is set to 1, and a little force applied on it, in box2dweb the car is like a stone, in asm.js the triangle pierces car.

    [attachment=1:1x3oqfmr][/attachment:1x3oqfmr] - box2dweb

    [attachment=0:1x3oqfmr][/attachment:1x3oqfmr] - asm.js

  • Hey Ashley, i found that if i set stepping iterations to a very high value, the physics engine will start to try to fix the weak joints, it looks messy, but, dunno, maybe it can somehow help you to fix this issue.

    CAPX here

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