Partial Teleport / Fixed Offsets for TickSmoothers #970
belplaton
started this conversation in
Feature Request
Replies: 1 comment
-
|
I have solved this problem with tick-smoothers for elevators (and same things). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goal:
Implement per-tick smoothing where externally provided offsets (e.g., elevator/conveyor/cutscene) are not interpolated but applied rigidly within the same tick. Only the remaining “allowed” displacement is fed into the interpolation.
Terms:
External offsets (fixed offsets) — explicit displacement vectors supplied by outside systems for a specific GameObject and tick; these must not be interpolated.
Rules:
For each tick and target, we have:
Total displacement D_total (authoritative per tick).
A set of external vectors {d_i}.
The summed external offset D_fixed = Σ d_i is applied as a teleport within the tick (no interpolation).
Interpolation uses only the remainder:
D_smooth = D_total − clamp_axiswise(D_fixed, D_total),
where clamp_axiswise limits each axis of the fixed offset so it does not flip the sign nor exceed the magnitude of the corresponding D_total component. If D_total is zero on an axis or has opposite sign, that fixed axis component is ignored.
All TickSmoothers targeting the same GameObject accumulate external offsets for the tick, then:
snap by D_fixed_clamped,
interpolate over D_smooth.
Example:
Given:
D_total = (5, 28, 9),
d_elevator = (0, 20, 0),
Then:
D_fixed = (0, 20, 0),
D_fixed_clamped = (0, 20, 0) (within axis bounds and same sign),
snap by + (0, 20, 0),
interpolate only D_smooth = (5, 8, 9) via the standard smoothing pipeline.
Why?
Why might this be useful? If you look at the screenshot, then you will see that player graphical object is below the root of the player himself (his target).
This is caused by interframe smoothing, which exists to smooth the player's movement, but smoothing in its current state cannot take into account the fact that the player can be moved by external forces.
Beta Was this translation helpful? Give feedback.
All reactions