ChronoCam (Tech of Planetary Annihilation)
Created on 2023-11-01T20:08:39-05:00
Replication of game state requires sending values to clients when something changes.
Since network frames are much slower than rendering, it becomes necessary to predict state between network frames.
Prediction systems can include some basic information like direction and velocity and assume an entity in motion will remain in motion until stopped otherwise.
"ChronoCam" instead stores "curves" of parameter changes over time. So instead of dense polylines (this value at this time) changes in state are stored as curves stretched over time but fit to whatever the equivalent polyline would have been.
Servers can then send the entire movement of a variable (ex. factory progress over time) and clients can accurately predict a position between network frames with arbitrary precision.
Curves have a start and stop time to control their width, and a curve type to control what happens between those times.
Linear: linear interpolate from a start to end time over the width of the segment.
Step: static value the entire time.
Pulse: a singular event with no duration.
In practice the curves are just straight lines but the server is allowed to put multiple "keyframes" down. The server doesn't do curvefitting of anything fancy.
The author says there is not much time to optimize curves while running sims; there might be for optimizing replays, but that he hadn't worked/commented on it.