Skip to content

feat: Add SynchronizedTimer - #663

Open
CardboardCarl wants to merge 1 commit into
foxssake:mainfrom
CardboardCarl:synchronized_timer
Open

CardboardCarl wants to merge 1 commit into
foxssake:mainfrom
CardboardCarl:synchronized_timer

Conversation

@CardboardCarl

@CardboardCarl CardboardCarl commented Oct 15, 2026 •

Copy link
Copy Markdown

This PR adds SynchronizedTimer, an extension of Godot's default Timer node that takes advantage of netfox's rollback system to synchronize the timers across multiple clients/servers.

How to use

You can use SynchronizedTimer just like a regular Timer node! Keep in mind, though, that start() will only start the timer locally. Once the authority calls start_remote.rpc(), all clients should automatically start the timer and keep in sync.

You can also adjust the sync interval, as well as a threshold for the maximum time drift allowed between the client and authority before forcing a synchronization.

Caveats

  • It is not recommended that autostart be enabled for SynchronizedTimer nodes, as it may not allow the nodes to sync properly due to one node being added to the scene before the other.

  • At this time, SynchronizedTimer has only been tested thoroughly with one_shot enabled, but I hope to test it further in the future. In my opinion, it's not a huge deal to be without this option for the moment, as the most likely use case will be with one-shot timers anyways (round/game start, countdowns, etc.).

Future Additions

  • Compatibility with one_shot disabled

  • alternate signals for reporting a server-confirmed timeout vs a local timeout signal

  • (possibly) investigate ways to send less data with RPCs, such as by using NetworkEvents or something similar

Code 100% human-made, with some comments generated and human-edited. Happy to change anything if there's an issue.

@CardboardCarl CardboardCarl changed the title Add SynchronizedTimer feat: Add SynchronizedTimer Oct 15, 2026

This branch has not been deployed

No deployments
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.

1 participant