An Update to the VW Sandbox
The Virtual World (VW) Sandbox allows users to collaborate on developing, designing, and playing simulations. While this is a great benefit, one of the biggest challenges in writing the VW Sandbox platform is maintaining synchronization of the world between multiple clients (i.e., synchronizing the system from one computer to another).
Why is this such a challenge?
The backbone of the VW Sandbox is the Virtual World Framework (VWF), which previously required that all simulation logic be deterministic—sometimes referred to as "deterministic lockstep simulation"—to maintain synchronization.
This is extremely difficult because:
- Minor coding errors can cause worlds to completely diverge.
- All clients must execute the entire simulation in lockstep. If clients are using two types of devices with different levels of processing power (e.g., desktop v. mobile), this is nearly impossible because of timing delays.
How are we solving this challenge?
We are moving the VW Sandbox simulation model away from deterministic lockstep simulation and modifying the programming interface and APIs in a number of notable ways.
As a result:
- The server will now elect a given client to be the authoritative simulator for each object in the scene.
- All properties will be timestamped with real world time, and the server will notify clients of changing data 20 times per second.
- When clients join or leave a world, the workload will be redistributed.
While this change requires additional bandwidth and increases the complexity of several under-the-hood systems, we feel that the benefit of providing a smooth, responsive real-time experience far outweighs the cost.