Skip to content

Interpolate captions, Untie captions from resolution

This merge request improves some aspects of #900 (closed). It fixes the pop-in animation being affected by frame rate, adds linear interpolation to the pop-in between tics, and ties the pop-in to the timescale console variable to accomplish that.

Additionally, it fixes the pop-in animation's "strength" being affected by the game resolution/GUI scale. Previously, the pop-in would start 2 GUI pixels (2 real pixels) above the resting position at 320x200, but 12 GUI pixels (72 real pixels) above it at 1920x1200. I've settled on 8 GUI pixels across all resolutions, matching the previous behaviour at 1280x800.

To explain specific coding decisions...
- closedcaptions[set].b = 2; // bob was changed to closedcaptions[set].b = 3; // bob because that v2.2.10 "checks and then decrements" the bobbing value while this merge request "decrements and then checks" (because that the "decrement" can only happen at the start of a tic, not the end, and with interpolation, we now see more frames after the start of a tic; we don't want to decrement "mid-tic" between frames).
- INT32 basey = BASEVIDHEIGHT; was changed to INT32 basey = BASEVIDHEIGHT - 20; so that y = basey-((i + 2)*10); could be simplified to y = basey-(i*10); within the loop. This is a free optimisation at no cost (but the compiler might already have optimised this anyway).
- With "T" being the current tic, most things in the game are interpolated from T-1 to T, but captions are interpolated from T to T+1. This is because that sounds (and captions) happen at the start of a tic, not the end, and I didn't want to make captions' pop-in last longer than v2.2.10's two tics total.

-

TL;DR:
- Interpolated captions
- Captions are now equally aggressive at any resolution

Edited by Zwip-Zwap Zapony

Merge request reports