Skip to content

Conversation

@gonpombo8
Copy link
Contributor

@gonpombo8 gonpombo8 commented May 15, 2025

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

3. Add PBNetworkEntity (ID: 1078)

Introduces a new component that marks entities for network synchronization:

  • Provides unique identification for networked entities using both entity_id and network_id
  • Enables proper entity resolution in networked environments
  • Supports both fixed (initialization-time) and dynamic (runtime) entities

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.

@gonpombo8 gonpombo8 changed the base branch from main to experimental May 15, 2025 21:11
@github-actions
Copy link

github-actions bot commented May 15, 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-15215825454.commit-e04bbc1.tgz"

@gonpombo8 gonpombo8 force-pushed the feat/sync-clocks-experimenta branch 5 times, most recently from 6702b5d to 02ec474 Compare May 20, 2025 19:54
@gonpombo8 gonpombo8 force-pushed the feat/sync-clocks-experimenta branch from 02ec474 to c8a97f3 Compare May 20, 2025 19:55
@gonpombo8 gonpombo8 changed the title [Experimental] Feat sync clocks experimenta [Experimental] Feat sync clocks experimental May 21, 2025
@gonpombo8 gonpombo8 force-pushed the feat/sync-clocks-experimenta branch from 5c180bc to b5c0b7c Compare May 21, 2025 14:30
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