multiplayer-sync
Installation
SKILL.md
Multiplayer Synchronization in Decentraland
Decentraland runs scenes locally in a player's instance of the explorer. By default, players are able to see each other and interact directly, but each player interacts with the environment independently. Changes in the environment aren't shared between players by default.
To sync any changes in the scene state, SDK7 uses CRDT-based synchronization.
Runtime constraint: Decentraland runs in a QuickJS sandbox. No Node.js APIs (
fs,http,path,process). Usefetch()andWebSocketfor network communication. See the scene-runtime skill for async patterns.
Sync Strategy Decision Tree
Choose the right networking approach based on what you need:
| Strategy | Use When | Persistence | Example |
|---|---|---|---|
syncEntity |
Shared state that all players see and that persists for new arrivals | Yes — state survives player join/leave, but only as long as at least one player remains in the scene. The state resets as soon as the scene is empty | Doors, switches, scoreboards, elevators |
MessageBus |
Ephemeral events that only matter in the moment | No — late joiners miss past messages | Chat messages, sound effects, particle triggers |
fetch / REST API |
Reading or writing data to an external server | Server-dependent | Leaderboards, inventory, external game state |
signedFetch |
Authenticated requests that prove player identity | Server-dependent | Claiming rewards, submitting verified scores |
WebSocket |
Real-time bidirectional communication with a server | Connection-dependent | Live game servers, real-time chat. |