You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A strategy game that can be sped up on command by the player. Engine.time_scale is updated in conjunction with Engine.physics_ticks_per_second to maintain a constant in-game simulation speed while the game speeds up/slows down in real life.
Describe the problem or limitation you are having in your project
Most things are affected by changing Engine.time_scale, which is desirable - such as in-game animations changing speed to match the rest of the game. However many elements, notably UI, need to maintain a "constant" real life speed and ignore Engine.time_scale.
Tweens are fantastic for dynamically animating UI elements, but are affected by Engine.time_scale. While the tween speed can be "normalized" by setting its own speed scale to 1.0 / Engine.time_scale, this doesn't account for changes to Engine.time_scale after it has been created. In a game with lots of UI where game speed is constantly being adjusted by the player, this is very noticeable.
SceneTreeTimer is a "set and forget" object similar to tweens, and it already has an option to ignore Engine.time_scale when created, allowing it to be used for constant time delays no matter the game speed.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add a Tween.set_ignore_time_scale(ignore: bool) option that will allow it to ignore Engine.time_scale, which will be disabled by default (tween is affected by the time scale). This would allow use of tweens for constant time animations no matter the game speed.
I'm prepared to implement this feature if it's received positively.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I'd expect Tween.set_ignore_time_scale(ignore: bool) to work similarly to set_speed_scale(speed: float) where it would affect all appended tweeners and can be changed during the tween's lifetime. The two functions would work in conjunction with one another.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Working around this is very clunky, requiring keeping a reference to the tween around, signalling whenever Engine.time_scale is updated, have the signal trigger an update function that will re-normalize the tween speed, and then clean up once the tween is finished or it won't be automatically freed. Very much goes against "set and forget" usage of tweens.
Is there a reason why this should be core and not an add-on in the asset library?
Tweens are core
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
A strategy game that can be sped up on command by the player.
Engine.time_scale
is updated in conjunction withEngine.physics_ticks_per_second
to maintain a constant in-game simulation speed while the game speeds up/slows down in real life.Describe the problem or limitation you are having in your project
Most things are affected by changing
Engine.time_scale
, which is desirable - such as in-game animations changing speed to match the rest of the game. However many elements, notably UI, need to maintain a "constant" real life speed and ignoreEngine.time_scale
.Tweens are fantastic for dynamically animating UI elements, but are affected by
Engine.time_scale
. While the tween speed can be "normalized" by setting its own speed scale to1.0 / Engine.time_scale
, this doesn't account for changes toEngine.time_scale
after it has been created. In a game with lots of UI where game speed is constantly being adjusted by the player, this is very noticeable.SceneTreeTimer
is a "set and forget" object similar to tweens, and it already has an option to ignoreEngine.time_scale
when created, allowing it to be used for constant time delays no matter the game speed.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add a
Tween.set_ignore_time_scale(ignore: bool)
option that will allow it to ignoreEngine.time_scale
, which will be disabled by default (tween is affected by the time scale). This would allow use of tweens for constant time animations no matter the game speed.I'm prepared to implement this feature if it's received positively.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I'd expect
Tween.set_ignore_time_scale(ignore: bool)
to work similarly toset_speed_scale(speed: float)
where it would affect all appended tweeners and can be changed during the tween's lifetime. The two functions would work in conjunction with one another.If this enhancement will not be used often, can it be worked around with a few lines of script?
Working around this is very clunky, requiring keeping a reference to the tween around, signalling whenever
Engine.time_scale
is updated, have the signal trigger an update function that will re-normalize the tween speed, and then clean up once the tween is finished or it won't be automatically freed. Very much goes against "set and forget" usage of tweens.Is there a reason why this should be core and not an add-on in the asset library?
Tweens are core
The text was updated successfully, but these errors were encountered: