PHYSICS: Less bounce against Immovable object?

Discussion and feedback on Construct 2

Post » Tue Jun 04, 2013 6:11 pm

Hi.

Simple question really.

Using the Physics behavior on 2 objects. Object1 is in the air, Object2 is on the ground.
Object1 falls towards Object2 and collides with it.

If Object2 is set to "Immovable", Object1 bounces off a lot less than if "Movable".

Why is that?Xionor2013-06-04 18:15:11
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Tue Jun 04, 2013 6:35 pm

Ok

I tried this myself and made a small capx:
https://dl.dropboxusercontent.com/u/89517854/physicsthingy.capx

by changing the immovable option on sprite two you can see a difference in the max Y after the first bounce.

My guess is :

When the object is immovable it doesn't bounce itself, so it's not like an action from Object 1 causes an reaction on Object 2.

When the Object 2 is not immovable it will make a bounce after recieving energy from object 1 and after hitting ground (since you have to hava some sort of ground, else everything will fall to infinity) it will give a small amount of energy back to the Object 1, hence make it bounce higher.


rock on,
Michael
B
16
S
6
G
3
Posts: 23
Reputation: 2,758

Post » Tue Jun 04, 2013 7:21 pm

Hmm, I'd not noticed this before! The difference seems to be fairly small though. It must be a quirk of the Box2D engine.

I suppose when an object is movable, some of the impact speed is transmitted in to the reaction of the movable object. If it's immovable I'd have expected it to bounce higher, because none of the energy is lost in the object it collided with. However it seems the opposite is the case, which is a little odd.
Scirra Founder
B
397
S
236
G
88
Posts: 24,408
Reputation: 194,496

Post » Tue Jun 04, 2013 7:35 pm

I imagine it more like a trampoline since the moveable object is not really "resting" all the time it inherits some "bounciness" all the time.

rock on,
Michael

EDIT: Some physicist could help Grave2013-06-04 19:36:50
B
16
S
6
G
3
Posts: 23
Reputation: 2,758

Post » Tue Jun 04, 2013 7:47 pm

When "Immovable" is on, it seems to disable(set to 0) all properties of the object - Elasticity, Friction, etc.

When "Movable" is on, the equation seems to combine both the elasticity of Object1 and Object2 to calculate the bounce, amongst others.

The Manual says only Density is set to 0 with Immovable on.

Thus you should be able to manually choose elasticity for an Immovable object, no? One wall should be bouncier than the other, for example.

Immovable completely disabling all physics properties does seem to cancel that possibility.

This makes having, for example, different types of surfaces on the same Layout quite difficult, no?Xionor2013-06-04 19:53:30
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Tue Jun 04, 2013 7:58 pm

In general I must say physics engines are not something to base your core gameplay on. Try to avoid using mechanics you can't control.

Sorry if I can't be of more help here.

rock on,
Michael
B
16
S
6
G
3
Posts: 23
Reputation: 2,758

Post » Tue Jun 04, 2013 8:55 pm

It's a very controllable mechanic - the effect is reproducible every single time.

What bothered me is that the Scirra Manual doesn't reflect this or even mention it. Thus not sure if it's a feature or a bug.Xionor2013-06-04 21:02:01
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Tue Jun 04, 2013 11:58 pm

Is it possible to get a confirmation on if this is intended functionality or bug?
B
10
S
3
Posts: 233
Reputation: 1,537


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests