Skip to content

add SyncClock component#1121

Draft
gonpombo8 wants to merge 5 commits intomainfrom
feat/sync-time
Draft

add SyncClock component#1121
gonpombo8 wants to merge 5 commits intomainfrom
feat/sync-time

Conversation

@gonpombo8
Copy link
Copy Markdown
Contributor

@gonpombo8 gonpombo8 commented May 15, 2025

Tween Synchronization

  • Added a new startSyncedTimestamp field to the PBTween interface
  • Implemented a new tween synchronization system that ensures tweens are properly synchronized across the network
  • Created createTweenSyncSystem to manage tween synchronization using the global SyncedClock
  • Fixed backwards tween handling to properly reset sync timestamps

Network Entity Updates

  • Deprecated NetworkEntity component (renamed to NetworkEntity__deprecated) in favor of the new protobuf component

Technical Details

The main improvement is the introduction of synchronized tweens using a global clock. The system:

  • Tracks tween start times using startSyncedTimestamp
  • Calculates proper start times for in-progress tweens
  • Only processes tweens when the clock is synchronized and network communications are initialized
  • Handles both new and existing tweens appropriately

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented May 15, 2025

Deploying js-sdk-toolchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: db1339d
Status: ✅  Deploy successful!
Preview URL: https://4a907151.js-sdk-toolchain.pages.dev
Branch Preview URL: https://feat-sync-time.js-sdk-toolchain.pages.dev

View logs

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 15, 2025

Test this pull request

  • The @dcl/sdk package can be tested in scenes by running

    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/feat/sync-time/dcl-sdk-7.8.10-15323969967.commit-6cdc35d.tgz"
  • To test with npx init

    export SDK_COMMANDS="https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/feat/sync-time/dcl-sdk-commands-7.8.10-15323969967.commit-6cdc35d.tgz"
    npx $SDK_COMMANDS init
  • The @dcl/inspector package can be tested by visiting this url

    • Or by installing it via NPM
    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/feat/sync-time/@dcl/inspector/dcl-inspector-7.8.10-15323969967.commit-6cdc35d.tgz"
  • The /changerealm command to test test in-world

    /changerealm https://sdk-team-cdn.decentraland.org/ipfs/feat/sync-time-e2e
    
  • You can preview this build entering:
    https://playground.decentraland.org/?sdk-branch=feat/sync-time

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