#Opinions on delta counting vs Time.get_ticks_msec for stopwatch/time tracker?

1 messages · Page 1 of 1 (latest)

cedar lotus
#

I'm looking at the options (and existing addons) for stopwatch nodes and time tracking, and they seem pretty split between counting delta or using Time.get_ticks_usec/msec to compare real time. (And the built in timer node can't count up, only down). I understand the advantages of Time tick is you track real time, not affected by framerate or any slowdowns in the game, it will always be the actual time passed outside of your game, and also you don't need to run it every frame in process if you dont need to, only when you check it. Delta counting on the other hand can be affected by game slowdowns at very low framerates, modified Engine.time_scale, lag spikes, loading times, and so on, so may often be shorter than real time elapsed, but that could be bad or good depending, by excluding those things it might potentially be a more fair/consistent comparison between players? But whether real time or delta's more subjective time is better to use is a matter of opinion and use case and I'd like some opinions on which method I should go with. In my game it will be used for tracking elapsed total play time to display on your save file, and displayed on an optional (hidden by default) on screen speedrun timer. I'd especially like to hear from anyone that does speedrunning on whether you prefer subjective game time or a timer locked to real time. Also should I pause the time when you pause the game, or open inventory/map/other menus? (I can do that easy enough with either method) I think I should, but I don't want to assume.

quaint light
#

I don't really do speedrunning, but there are sometimes (e.g. in Minecraft) two timers, one for real time and one for in-game time.
To track in-game time you have to count up by delta every frame (since Time.get_ticks_msec can't be paused), so if your game needs in-game time, use delta counting.
Otherwise, I think it's actually just a matter if opinion and you can do whatever feels more elegant to you. Counting delta might be faster (by a negligible amount), but it requires a constantly changing global variable which I personally think is a little bit icky

cedar lotus