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
Describe the problem or limitation you are having in your project
Currently there only exists the delta value to get frame times, which is influenced by Engine.TimeScale. This is bad for things like framerate counters, which require accurate frametimes no matter the time scale.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Having an additional delta value ("Engine.unscaled_delta" for example) that isn't influenced by Engine.TimeScale would help framerate counters to maintain accuracy while manipulating time scale.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Engine.unscaled_delta could just be calculated as Engine.unscaled_delta = delta / Engine.TimeScale.
0.061551 in this example, is the frametime (delta) as it would be if timescale was set to 1 (normal speed), and as can be seen in this example the output is always as if timescale was set to nomal speed.
Alternatively, for better performance, Engine.unscaled_delta would ideally be cached before Engine.TimeScale changes delta's value, for better performance, although i'm not very familiar with how delta is calculated so i'm not completely sure how feasible this caching alternative would be to implement.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Like i demonstrated, this unscaled delta value can already be calculated with just delta and Engine.TimeScale. However having a proper value for this ("Engine.unscaled_delta" or example) would make for cleaner code, as well as make it easier for former Unity developers migrating to Godot (as Unity already contains this value in the form of "Time.unscaledDeltaTime").
Is there a reason why this should be core and not an add-on in the asset library?
It's a simple addition that leads to simpler code.
The text was updated successfully, but these errors were encountered:
This is bad for things like framerate counters, which require accurate frametimes no matter the time scale.
To create a custom FPS counter, use the difference between OS.get_ticks_usec() between the current frame and previous frame (stored in a member variable) instead.
To create a custom FPS counter, use the difference between OS.get_ticks_usec() between the current frame and previous frame (stored in a member variable) instead.
Thanks, i couldn't find that function under OS, but i did find it under Time
Describe the project you are working on
3D Racing game
Describe the problem or limitation you are having in your project
Currently there only exists the delta value to get frame times, which is influenced by Engine.TimeScale. This is bad for things like framerate counters, which require accurate frametimes no matter the time scale.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Having an additional delta value ("Engine.unscaled_delta" for example) that isn't influenced by Engine.TimeScale would help framerate counters to maintain accuracy while manipulating time scale.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Engine.unscaled_delta could just be calculated as Engine.unscaled_delta = delta / Engine.TimeScale.
e.g:
Engine.TimeScale = 1.0 | delta = 0.061551 | Engine.unscaled_delta = 0.061551 / 1 = 0.061551
Engine.TimeScale = 0.5 | delta = 0.0307755 | Engine.unscaled_delta = 0.0307755 / 0.5 = 0.061551
Engine.TimeScale = 1.5 | delta = 0.0923265 | Engine.unscaled_delta = 0.0923265 / 1.5 = 0.061551
0.061551 in this example, is the frametime (delta) as it would be if timescale was set to 1 (normal speed), and as can be seen in this example the output is always as if timescale was set to nomal speed.
Alternatively, for better performance, Engine.unscaled_delta would ideally be cached before Engine.TimeScale changes delta's value, for better performance, although i'm not very familiar with how delta is calculated so i'm not completely sure how feasible this caching alternative would be to implement.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Like i demonstrated, this unscaled delta value can already be calculated with just delta and Engine.TimeScale. However having a proper value for this ("Engine.unscaled_delta" or example) would make for cleaner code, as well as make it easier for former Unity developers migrating to Godot (as Unity already contains this value in the form of "Time.unscaledDeltaTime").
Is there a reason why this should be core and not an add-on in the asset library?
It's a simple addition that leads to simpler code.
The text was updated successfully, but these errors were encountered: