Skip to content

Conversation

@gonpombo8
Copy link
Contributor

Time Synchronization Components

This PR implements time synchronization capabilities for Decentraland scenes, enabling precise coordination of time-based events across all clients.

Changes

1. Add PBTimeComponent (ID: 1077)

Introduces a new component that provides synchronized time information across all clients:

  • Centralized timestamp management based on NTP-style synchronization
  • Status tracking for synchronization state

2. Enhance PBTween with Start Timestamp

Added a start_timestamp field to the existing PBTween component:

  • Enables deterministic animation playback across all clients
  • Ensures visual consistency for all users viewing the same animation

Use Cases

These components enable several key capabilities:

  • Synchronized clocks visible to all users (e.g., world clocks, countdowns)
  • Precisely timed animations that start simultaneously for all viewers
  • Time-based game mechanics that behave consistently for all participants

Implementation Notes

The TimeComponent serves as the authoritative time source, while individual components like Tween can reference this synchronized time to coordinate their own behaviors. This approach establishes a foundation for deterministic time-based operations throughout the platform.

@github-actions
Copy link

github-actions bot commented May 12, 2025

Test this pull request

  • The @dcl/protocol package can be tested in scenes by running
    npm install "https://sdk-team-cdn.decentraland.org/@dcl/protocol/branch//dcl-protocol-1.0.0-15164949061.commit-f76ef48.tgz"

@gonpombo8 gonpombo8 changed the title feat: implement timestamp synchronization components [Main] Feat sync clocks experimental May 21, 2025
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.

2 participants