ElectricalAge icon indicating copy to clipboard operation
ElectricalAge copied to clipboard

Visuals get out of sync on low-TPS server

Open Baughn opened this issue 7 years ago • 2 comments

For instance, the timer may display itself as having finished running while the server is still counting down.

The best solution is probably to introduce a global sync packet, then adjust the time passed into the rendering classes' update functions to 'catch up' on delays as they happen. This will need to be done carefully, as so far all such calls have always used a constant 0.05 as the time-elapsed parameter.

Baughn avatar Oct 13 '17 18:10 Baughn

This is a widespread problem plaguing many major mods-- so we'd be in good company by doing nothing at all. e.g. Thermalilies have the same problem.

Sync packets seem the wrong approach here; better to have the client track the tick that the animation starts and when it should stop. Then it can adjust without needing any additional packets at all, I think.

Heh. We could make a time dilation sensor chip too...

lashtear avatar Dec 04 '17 20:12 lashtear

We might be in good company, but in Eln's case the fix should be relatively simple. So we might as well, right? :)

Animations happen client-side and aren't usually triggered by the server, except implicitly; it's in the -Render classes. The update method of those, just like everything else, takes a time parameter -- currently that's always 0.05 seconds, but I don't think there'd be a problem making it variable. If we introduce NTP-like clock skew to make it approximately match the server clock then the problem should be fixed.

Baughn avatar Dec 06 '17 23:12 Baughn