Alrecenk / JSTimelineSync

A quick and dirty prototype for testing generalized rollback networking.
MIT License
5 stars 1 forks source link

improve clock sync #12

Closed Alrecenk closed 2 years ago

Alrecenk commented 2 years ago

Change clock sync by update to consider latency, and add a gradual synchronization mechanism to reduce visible snapping when clocks aren't staying aligned (which is all the time apparently).

Move time measurements into timeline, so timeline.run with no interval argument will run on real time.

Switch chat ChatClient to run on animation frame instead of setInterval. Not noticeable in Chrome but gets a more consistent frame-rate in Firefox.