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 | ![]() |
![]() |
OpenGL | ![]() |
![]() |
-
TL;DR:
- Fixed some interpolation artefacts
- Overlays (level end signs, Extra Life monitors, and some shields) now support splitscreen properly
Merge request reports
Activity
[...] Actually, I do have to wonder why you're not just using
P_SpawnMobjFromMobj
here, it'd probably be alot cleaner.Does that function exist? :earless:
Looking atP_SpawnMobjFromMobj
now, I'm worried that the fact that it handles other things too could break something with old replays and/or Lua scripts. But, I can still make it useP_SpawnMobjFromMobj
instead if it's worth the "risk"?
Edit:Of course, some or all of those things are already handled byEdit 2: Never mind, I was looking at something else. I don't think that it's safe to switch toP_SpawnGhostMobj
,P_SpawnMobjFromMobj
here for a patch.Edited by Zwip-Zwap Zapony
added Uncapped label
added 64 commits
-
bdec380a...37223f13 - 63 commits from branch
STJr:next
- e2e6e5c5 - Copy interpolation to shields and overlays
-
bdec380a...37223f13 - 63 commits from branch
This merge request previously just copied player interpolation to shields when spawning shields. Now, it has been heavily changed to copy player/target interpolation to shields and
MT_OVERLAY
s on every tic, and fixMT_OVERLAY
offsets in splitscreen. The previous comments relate to the previous implementation.added 281 commits
-
e2e6e5c5...3fbdaa61 - 280 commits from branch
STJr:next
- 8f6bedf8 - Copy interpolation to shields and overlays
-
e2e6e5c5...3fbdaa61 - 280 commits from branch
added 86 commits
-
d5f6f8fc...b5232a4c - 85 commits from branch
STJr:next
- e5fdfadc - Copy interpolation to shields and overlays
-
d5f6f8fc...b5232a4c - 85 commits from branch
added 237 commits
-
e5fdfadc...a68440c4 - 236 commits from branch
STJr:next
- 9b137435 - Merge branch SRB2:next into interpolate-shield-spawning
-
e5fdfadc...a68440c4 - 236 commits from branch
added 347 commits
-
9b137435...106a98ce - 346 commits from branch
STJr:next
- 38dec322 - Merge branch SRB2:next into interpolate-shield-spawning
-
9b137435...106a98ce - 346 commits from branch
mentioned in commit 0182973b