r210 physics: asm.js joint flaw

Bugs will be moved here once resolved.

Post » Tue Aug 04, 2015 2:06 am

Problem Description
Edited. I did some experimenting and it appears that asm.js is not very good!! When joints are created and played in box2d the joints behave properly. If the physics is changed to asm.js then the joints become a springy and somewhat unpredictable mess - they do not behave correctly.

Attach a Capx
capx

Description of Capx
One layout with 2 types of physics objects. One type is fixed (sprite) and the other is not (sprite2). When you run the layout, a family is used to pick the movable objects and join them together using limited revolute joints. The imagepoint(0) is top left and imagepoint(1) is top right of these objects; the objective is to joint the adjacent top corners of the objects using limited revolute joints. This semi-rigid jointed chain/platform is then attached to an immovable object via a revolute joint on the right so the whole assembly can pivot and rotate/fall anti-clockwise until the left segment strikes a ground object. The movement of that left object is of interest here.

Steps to Reproduce Bug
  • Run the layout.
  • Observe.
  • Run the layout after selecting box2d web physics engine and observe.

Observed Result
In asm.js, when the 3 joined objects rotate down and strike the floor, the left-most object behaves incorrectly in 3 ways:

1. It appears that the joint pivot is in the wrong place.
2. It appears that the joint does not behave like a limited revolute joint because the object's angular range of movement exceeds the desired +/- 3 degrees declared in the event sheet.
3. The motion appears springy - which is incorrect for this type of joint. This could be because the 3 degree limit is being exceeded, even though there is so little stress (ie this point and point 2 are symptoms of the joint being excessively flexible).

NB The joint behaves correctly if box2d web physics engine is selected.

Expected Result
Joints that are created using asm.js physics engine should behave in a similar way to the box2d web joints..

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

Operating System and Service Pack
W8.1 x64

Construct 2 Version ID
r210 64 bit
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,284
Reputation: 47,552

Post » Wed Aug 05, 2015 2:10 pm

I reported something like this about a half-year ago, dunno why Ashley can't fix it.
Link to report
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Wed Aug 05, 2015 3:09 pm

@Sisyphus - I remember!! Although asm.js promises some performance dividends, I think it's still very much in beta as these bugs indicate. I also suspect that any gains it offers now over the standard box2d engine might become unnecessary due to browser and hardware improvements. Time will tell!
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,284
Reputation: 47,552

Post » Wed Aug 05, 2015 5:32 pm

Colludium wrote:@Sisyphus - I remember!! Although asm.js promises some performance dividends, I think it's still very much in beta as these bugs indicate. I also suspect that any gains it offers now over the standard box2d engine might become unnecessary due to browser and hardware improvements. Time will tell!

Yeah, also these tiny performance improvements is nothing if the physics engine is half-working.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Thu Aug 06, 2015 3:42 pm

Closing as duplicate of https://www.scirra.com/forum/r196-2-asm-js-revolute-joints-aren-t-strong-enough_t124164.

I'm afraid I have no idea why this is. I didn't write either the box2dweb or asm.js versions of Physics, and the asm.js version is a non-human-readable build based from the original C++ sources, so I have no idea where any major differences could come from.
Scirra Founder
B
402
S
238
G
89
Posts: 24,628
Reputation: 196,023

Post » Thu Aug 06, 2015 5:40 pm

Understood - seems odd that only one joint didn't form properly...
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,284
Reputation: 47,552


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest