Skip to content

feat: Nudge Time Process#314

Merged
elementbound merged 31 commits intomainfrom
feat/nudge-time-sync
Nov 8, 2024
Merged

feat: Nudge Time Process#314
elementbound merged 31 commits intomainfrom
feat/nudge-time-sync

Conversation

@elementbound
Copy link
Copy Markdown
Contributor

@elementbound elementbound commented Oct 22, 2024

Implements a time-sync algorithm inspired by NTPv4 to get a reliable idea of the current time at the host. Based on the host's clock, an internal reference clock is kept and adjusted to stay in sync. A separate, simulation clock is used to drive the network tick loop. The simulation clock is constantly sped up / slowed down slightly, to stay in sync with the reference clock, and by extension, with the host's clock.

This also deprecates some settings and properties, including the three separate tick concepts ( remote tick, local tick, tick ) along with their time counterparts. With this new system, only tick and time exists, since they're kept in sync with the host at all times.

Closes #176

@elementbound
Copy link
Copy Markdown
Contributor Author

The docs site still needs to be updated, but the feature implementation itself is pretty much done. Opening this up for reviews.

@elementbound elementbound marked this pull request as ready for review October 22, 2024 13:40
@TheYellowArchitect
Copy link
Copy Markdown
Contributor

TheYellowArchitect commented Oct 23, 2024

Tested it with 4.1, both 0ms and 200ms delay (3 players as usual)
Works perfectly. May I add it even feels snappier than default forest brawl (e.g. see how a player's movement syncs right after he presses Join)

@elementbound elementbound merged commit 95d7298 into main Nov 8, 2024
@elementbound elementbound deleted the feat/nudge-time-sync branch November 8, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Time synchronisation

2 participants