# [r60] PhysicObjects go mad after exporting

Bugs will be moved here once resolved.

### » Fri Sep 30, 2011 9:04 am

In this html, a ball will drop on a pile of squares.

The ball's Density: 1
The Square's Density: 100

http://dl.dropbox.com/u/31590694/PhysicsTest/index.html

We can see the pile collapses in about 10 seconds.
if the squares' density are lower, it collapses sooner like all the squares become mad.

However, you can open the capx below, run it's layout;
it won't ever collapse in capx.
http://dl.dropbox.com/u/31590694/PhysicsTest/PhysicBuildingTest.capx

So if you made something like the buildings in "Angry Bird",
you'd think you did a great job in capx's layout running,
and found all the buildings collapsed in exported html because of a tiny touch.
gonzdevour2011-09-30 09:06:43
B
127
S
33
G
9
Posts: 217
Reputation: 14,166

### » Fri Sep 30, 2011 1:33 pm

Have you read the Physics basics tutorial?

[quote]Things like incredibly heavy objects piled on a stack of really light boxes, huge piles of objects, or very fast moving heavy objects tend to cause instability. Try to keep everything in your game at reasonable proportions.[/quote]

I would expect a density ratio of 100:1 is too much for the physics simulation to handle. You should keep things far more reasonable otherwise you can't expect realistic results - I'd say 10:1 is more reasonable for densities.
Scirra Founder
B
413
S
244
G
92
Posts: 25,089
Reputation: 199,786

### » Fri Sep 30, 2011 2:00 pm

100:1 is just an extreme value for test.
Actually, they collapse in reasonable proportion like 5:1

I've remade the examples, try the 2 links again.
Thanks for reply.gonzdevour2011-09-30 14:02:33
B
127
S
33
G
9
Posts: 217
Reputation: 14,166

### » Fri Sep 30, 2011 3:52 pm

Ah, I guess gonzdevour means that the performance in preview (it won't ever collapse in capx) is different to export (it collapses sooner) at physic behavior.
Goodbye
B
113
S
30
G
295
Posts: 4,549
Reputation: 164,483

### » Fri Sep 30, 2011 4:16 pm

[QUOTE=rexrainbow] Ah, I guess gonzdevour means that the performance in preview (it won't ever collapse in capx) is different to export (it collapses sooner) at physic behavior.[/QUOTE]

Yes, that's it. Thanks.

The pile of physic objects stay stable in capx,
but go mad in html. That what I mean.gonzdevour2011-09-30 16:22:20
B
127
S
33
G
9
Posts: 217
Reputation: 14,166

### » Fri Sep 30, 2011 4:25 pm

Well, that's odd! If you don't minify the script, it works OK. If you minify it, it changes the behavior. It must be something the minifier is doing. I'll look in to it.
Scirra Founder
B
413
S
244
G
92
Posts: 25,089
Reputation: 199,786

### » Mon Nov 21, 2011 10:05 am

r68 - the problem is still here. I just want to minify my script. Is there a hope?
B
111
S
6
G
6
Posts: 14
Reputation: 7,392

### » Sat Dec 03, 2011 7:12 pm

r70 just discoverd this bug also, only on minified versions, hope it can be fixed

edit:

if you put all step accuracy to zero it has somewhat of thesame behavior, jelly like, but with minifier it also adds somewhat of a motion

a temp solution could also be to disable minifier on the parts of physic engine but not on the rest of the game? if that is possible.vtrix2011-12-04 23:49:51
B
72
S
22
G
7
Posts: 830
Reputation: 10,214