The source code is filled with all kinds of timers, which are backed with a field of type float.
Duration each update, the field is decremented by Engine.DeltaTime, which is usually 1/60.
The timer is considered completed when its value <=0.
Won't there be a floating-point error? Like the timer is expected to be 0, but actually >0, so there will be a one-frame difference?
#Celeste source code using float as timer
6 messages · Page 1 of 1 (latest)
#code_modding may be more active
as you see with spinner freezing, it is very possible to wait for about 118 hours and the float timer will no longer increase, breaking some behavior
at some point, Engine.DeltaTime is too small to jump to the next float value
I'm concerned with a more common case. For example, you have a 0.1s timer for a buffer time. It is supposed to be 0 after 6 frames, but actually it may be slightly more than 0. Is this what happens?
Also, I found that the input buffer for jump and dash are 0.08s (which is not divisible by 1/60, so providing a consistent 5 frames of input buffer), while that for QuickRestart is 0.1s. Can I say that QuickStart may actually have 7 frames of input buffer?