-
-
Notifications
You must be signed in to change notification settings - Fork 242
Description
I think I'm here to advocate for a breaking change.
There are three conceptual ways to implement Z
s "rate" parameter:
- step interval: how many steps it will advance per frame
- actual rate: how quickly the steps will advance (step size undefined and we can't do sub-frame timing, if we assume steps size of 1 we can't go any faster than unit increment per frame)
- duration: how quickly (in frames) it takes to get to the target value
Currently it's (1) but I believe (3) would make more sense.
- It's more useful in performance context (at least to me, I'm more interested in when it will reach the target rather than what size the individual steps will be)
- It combines functionality of both (1) and (2) and offers more possibilities than either of them (if I'm not mistaken, it covers all possible values of (1) and half those of (2) — with current Z any nZm where n>m is equivalent to nZn)
Assume we're starting with:
.Z.
.1.
case | current Z |
new Z |
---|---|---|
1 step in 1 frame | 1Z1 |
1Z1 |
z steps in 1 frame | zZz |
1Zz |
z steps in z frames | 1Zz |
zZz |
f steps in 8 frames | 2Zf |
8Zf |
f steps in 7 frames | nope | 7Zf |
5 steps in z frames | nope | zZ5 |
In other words, it can go as fast as current Z, as slow as current Z, and slower than current Z can. It always takes the same number of frames regardless of the target value and allows more non-integer relationships between duration and target.
Pretty sure it's possible to implement duration-based Z with the current step-based Z but only for a subset of possible cases, because of the aforementioned limitations.
@neauoire if you would consider accepting a PR, I'm happy to attempt one. As described above It's less trivial to implement then a step-based Z because it needs to store additional state, either on the grid or elsewhere.