Skip to content

Copy Interpolation to Shields and Overlays, Splitscreen Overlays

Copies interpolation variables from the target player/object to shield orbs/MT_OVERLAY objects.
Fixes shields/overlays interpolating instead of "snapping" when the target teleports (or changes height, e.g. when curling up/uncurling), fixes shields/overlays possibly being a tic ahead when first spawned (fixes #997 (closed)).

Caveat: If an overlay intentionally changes its vertical offset through state variables, this is no longer interpolated. (This may be a good thing if it does so because of the sprite animation "snapping".)
Caveat: Lua can no longer override the offset in a PostThinkFrame hook (but it can be manually offset in the opposite direction, or the overlay can be set to target an invisible overlay with an opposite offset).

(This does not apply to Tails' tails; there are many more variables at play there where interpolation matters much, so they may be better handled in a separate merge request.)

-

MT_OVERLAY now supports splitscreen. Before, MT_OVERLAY was offset slightly towards the camera during mobj ticking (leading to different X/Y coordinates for online players), but not in splitscreen due to there being two cameras. Now, MT_OVERLAY keeps its target's position (making it net-safe for Lua to do something based on MT_OVERLAY positions), and is instead offset towards the camera during rendering, which also allows it to be offset per-player in splitscreen.
Fixes Z-fighting/-sorting with overlays in splitscreen (even affects the software renderer; note the Armageddon Shield's translucency sorting below), fixes overlay offsets not "snapping" towards the camera if the camera "snaps", fixes order-of-operations issues/"latency" if earlier-spawned overlays follow later-spawned overlays.

(This was done because that now that MT_OVERLAY copies the target's old position, I would have needed to offset it towards the camera's old position in mobj ticking, which isn't easily accessible.)

Before After
Software image image
OpenGL image image


-

TL;DR:
- Fixed some interpolation artefacts - Overlays (level end signs, Extra Life monitors, and some shields) now support splitscreen properly

Edited by Zwip-Zwap Zapony

Merge request reports