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

Report Construct 2 bugs here.

Post » Tue Feb 03, 2015 5:01 pm

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

Attach a Capx
1.capx

2.capx


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
You do not have the required permissions to view the files attached to this post.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Tue Feb 03, 2015 5:59 pm

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.
Last edited by Sisyphus on Fri Feb 06, 2015 7:56 pm, edited 2 times in total.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Fri Feb 06, 2015 12:39 am

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.
B
11
S
2
G
1
Posts: 40
Reputation: 1,750

Post » Fri Feb 06, 2015 11:32 am

moostrodamus wrote: 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.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Sat Feb 21, 2015 12:34 am

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.
B
7
S
1
Posts: 20
Reputation: 686

Post » Mon Feb 23, 2015 2:29 pm

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?
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Mon Feb 23, 2015 3:44 pm

Ashley wrote: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.
1.capx
- box2dweb
2.capx
- asm.js
You do not have the required permissions to view the files attached to this post.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Wed Jul 01, 2015 2:21 pm

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
B
22
S
9
G
7
Posts: 421
Reputation: 6,543


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests