ElectricalAge
ElectricalAge copied to clipboard
Visuals get out of sync on low-TPS server
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.
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...
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.