1.7.5 Spring strength on resize

If you have problems installing or running Algodoo, have found a bug or need in-game help - this is it!

1.7.5 Spring strength on resize

Postby Kilinich » Tue Aug 17, 2010 1:03 pm

Hinge power fixed in 1.7.5 but same deal must be done with springs:

Springs getting weak on scale down.
[scene]45268[/scene]
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: 1.7.5 Spring strength on resize

Postby tatt61880 » Tue Aug 17, 2010 4:16 pm

Resizing spring works well with no-gravity no-air circumstance.
[scene]45274[/scene]
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
User avatar
tatt61880
[Most Helpful Person 2010]
 
Posts: 1150
Joined: Mon Aug 31, 2009 5:45 pm
Location: Tokyo, Japan

Re: 1.7.5 Spring strength on resize

Postby emilk » Tue Aug 17, 2010 5:23 pm

It's a trade-off, I guess...

Right now I scale the spring strength with the square of the resize factor. This means a 200 N/m spring scaled down to half size becomes a 50 N/m spring. This conserves its movement - the prototype and the scaled clone will move the in the same way if you offset them from equilibrium (the same amount), i.e. the angular velocity of the harmonic oscillation is conserved. This also preserves the position of objects for which the forces acting on them scale linearly as we scale the objects

However, as you have noted, an issue occur with gravity (and air resistance) - and this is because gravity doesn't scale when we scale the object. If you also scale gravity, things will work exactly the same (safe for air resistance). To keep the displacement constant (relative to size) we need to scale spring strength linearly with scale factor.

The question is: what is most important? Keeping the angular velocity of the oscillation (just like the angular velocity (rpm) of a motor is kept as it is scaled), or keep an even displacement in a gravity field?

I made the first call. Any one care to make an argument for why the other choice is better?

Try it with a car that has spring damping. The current scaling keeps the feel of the car, provided you also scale gravity.
Emil Ernerfeldt, lead developer
emilk
 
Posts: 616
Joined: Mon Aug 31, 2009 11:01 am
Location: Umeå, Sweden

Re: 1.7.5 Spring strength on resize

Postby Kilinich » Tue Aug 17, 2010 5:51 pm

IMHO choice is clear - scaled mechanism must work like original (except oscillation - it must increase freq if scaled down).
Just like in real world - small RC car jump on ramp and suspension work much "faster", so you understand it's a RC car even if look close and cant understand what scale is it.

If I pick complex mechanism with balanced springs / hinges and scale it down is must work like original. Failed in 1.7.5
[scene]45285[/scene]
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: 1.7.5 Spring strength on resize

Postby emilk » Thu Aug 19, 2010 3:45 pm

Okay, sure, I'll fix this.
Emil Ernerfeldt, lead developer
emilk
 
Posts: 616
Joined: Mon Aug 31, 2009 11:01 am
Location: Umeå, Sweden

Re: 1.7.5 Spring strength on resize

Postby emilk » Mon Sep 06, 2010 9:30 am

This is all controllable with App.scalePow* now. a scalePow of 2, for instance, means the strength of that attribute will scale with the square of the scaling factor.
Emil Ernerfeldt, lead developer
emilk
 
Posts: 616
Joined: Mon Aug 31, 2009 11:01 am
Location: Umeå, Sweden

Re: 1.7.5 Spring strength on resize

Postby tatt61880 » Mon Sep 06, 2010 9:46 am

I prefer App.scalePowMotorSpeed = 0 (currently(with v1.7.8), it is -1 as default ).
When you make a clock and scale it, it should work same speed.
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
User avatar
tatt61880
[Most Helpful Person 2010]
 
Posts: 1150
Joined: Mon Aug 31, 2009 5:45 pm
Location: Tokyo, Japan

Re: 1.7.5 Spring strength on resize

Postby emilk » Mon Sep 06, 2010 3:33 pm

tatt61880 wrote:I prefer App.scalePowMotorSpeed = 0 (currently(with v1.7.8), it is -1 as default ).
When you make a clock and scale it, it should work same speed.


And if it is spring-driven? Then it is possible, but only if it is not affected by gravitation.

Basically, there are two consistent ways to go here:

1) Scaling retains same movement (clock works the same) iff all external forces are also scaled
2) Scaling retains same movement but at a scaled speed (clock moves slower/quicker), even if external forces remain constant.

You cannot have both. And I would prefer not to have inconsistencies (e.g. motors scale by one way, and springs the other).

In 1.7.8, 2) I was aiming for 2, but I have not quite succeeded.

I'm happy to see arguments for both sides, but I have to decide one or the other, soon.

Good values for alternative 1 are:

App.scalePowHingeImpulseBreakLimit = 3;
App.scalePowMotorSpeed = 0;
App.scalePowMotorTorque = 4;
App.scalePowSpringStrength = 2;

I have not found perfect values for alternative 2 yet... and now it's coffee break.

Currently I'm leaning towards alternative 1), with the above values (after some more checking).
Emil Ernerfeldt, lead developer
emilk
 
Posts: 616
Joined: Mon Aug 31, 2009 11:01 am
Location: Umeå, Sweden

Re: 1.7.5 Spring strength on resize

Postby Kilinich » Tue Sep 07, 2010 8:29 pm

vote for 1

btw - why break limit x3?
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: 1.7.5 Spring strength on resize

Postby emilk » Wed Sep 08, 2010 8:59 am

It's not x3, its ^3, i.e. the cube of the scaling factor. So if you scale up something 2x, you get a break limit that is 2^3=8 times higher. You can think of it like this: two objects are colliding, one has a breakable hinge. If you scale everything up 2x, the incoming object will have 4x the area, and so 4x the mass, and also be traveling with twice the speed. So in total, it will have 8x the momentum, which is why we need to increase the break limit by the cube of the scaling factor.
Emil Ernerfeldt, lead developer
emilk
 
Posts: 616
Joined: Mon Aug 31, 2009 11:01 am
Location: Umeå, Sweden

Re: 1.7.5 Spring strength on resize

Postby tatt61880 » Tue Sep 14, 2010 8:15 pm

I choice alternative 1, and the next values seem to be correct.
(I checked them with my calculation and experiments.) ;)

emilk wrote:Good values for alternative 1 are:

App.scalePowHingeImpulseBreakLimit = 3;
App.scalePowMotorSpeed = 0;
App.scalePowMotorTorque = 4;
App.scalePowSpringStrength = 2;


In addition,
There may had better be next new variables.
App.scalePowAttraction = 1; //Currently, 0 (i.e. Attraction value is not changed by scaling geom with v1.7.8.)
App.scalePowControllerAcc = 1; //Currently, 0
(App.scalePowGeomSpeed = 1;)
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
User avatar
tatt61880
[Most Helpful Person 2010]
 
Posts: 1150
Joined: Mon Aug 31, 2009 5:45 pm
Location: Tokyo, Japan

Re: 1.7.5 Spring strength on resize

Postby emilk » Wed Sep 15, 2010 9:30 am

good catch - I forgot about those two!
Emil Ernerfeldt, lead developer
emilk
 
Posts: 616
Joined: Mon Aug 31, 2009 11:01 am
Location: Umeå, Sweden


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 4 guests

cron