Real-time Collaboration
Yugma supports real-time multi-user collaboration powered by Firebase Realtime Database.
How It Works
Connection Flow
- User opens a project in the Studio
- The collaboration service connects to a Firebase RTDB session path
- User presence is registered (cursor position, display info)
- Scene changes are broadcast as deltas to all connected users
Delta Synchronization
When a user modifies the scene (moves an object, changes a material), the change is broadcast as a delta — a minimal diff describing what changed:
{
"type": "update_object",
"objectId": "abc123",
"changes": {
"transform": {
"position": [1, 2, 3]
}
},
"timestamp": 1234567890,
"userId": "user_xyz"
}
Cursor Sharing
Each user's 3D cursor position is shared in real-time, allowing collaborators to see where others are working in the scene.
Architecture
Firebase Realtime Database Paths
/sessions/{projectId}/
/presence/{userId} — User online status + cursor
/deltas/{deltaId} — Scene change deltas
/meta — Session metadata
Conflict Resolution
Yugma uses a last-write-wins strategy for conflicting edits. If two users modify the same object property simultaneously, the last delta received is applied. Future versions will support operational transforms for more sophisticated conflict resolution.
Limitations
- Maximum recommended collaborators per session: 8
- Delta history is ephemeral — only the latest state persists in the project save
- Cursor sharing updates at ~10fps to limit bandwidth