Upload
gavin-ferguson
View
219
Download
5
Embed Size (px)
Citation preview
Applying Real-time Simulation to Real-time Collaboration
Bart Miller
Overview
• Motivation
• Real-time multiplayer simulation
• Real-time collaboration
• GroupDraw Application
• GroupDraw Protocol
• Demo/Questions
Motivation
• Multiplayer action games provide responsive, fair simulations across unreliable networks
• User experience critical for adoption of real-time collaboration
• Can I apply techniques taken from simulation to collaboration?
Real-time Multiplayer Simulation
• Create a shared environment
• Environment affected by user input
• User expects to provide input and see the result of that input rendered onto screen
Real-time Multiplayer Simulation
• Entitieso Player vs. non-playero Set of metrics (Position, Health, Ammo)
• Ruleso Movemento Damage
• Divide time into discrete intervals, Ticks
• World State, Client State
• Action
Real-time Multiplayer Simulation
• Client-server design (Synchronous model)o Client simulation loop
1. Gather input, Send input as Actions2. Receive World State information from
server3. Update Client State4. Graphically Render World State
o Server simulation loop1. Receive Actions from Clients2. Consolidate Actions from Clients
• Conflict resolution
3. Simulate world (generates World State)4. Send World State snapshot to each Client
Real-time Multiplayer Simulation
• Problems with Synchronous Modelo Network interface is the constraining resource
Bandwidth, latencyo Latency is unpredictable
Unfair
• Solutiono Buffer input and network traffico Loop becomes a set of timers
Network send (lowest frequency) Poll input (in-between) Simulate (highest frequency)
Real-time Multiplayer Simulation
Real-time Collaboration
• Allows multiple users to edit a single file simultaneously
• Manage access to the file using a Journal Storage Systemo Server becomes Journal Storage Manager
Log version history of the file• Set of Actions
Commitment process resolves conflicts
• Text datao Series of fixed-length character valueso Action data contains location, character buffer
GroupDraw Application
• Client-server program
• Written in C#
• Clients share a common canvas
• Action containso Player Ido Tick Numbero Point Data (X,Y)
• Timer Periodso Send: 50mso Input: 33mso Simulate: 15ms (~67TPS)
GroupDraw Protocol
• Hybrid Protocolo TCP for reliability, latency independent
informationo UDP for data stream, lowest latency
Reliability, ordering handled by the application, snapshot data acknowledged by the client
No fragmentation
• TCP Methodso Connect, Disconnecto Join, Leave
• UDP Methodso AddData, ReceiveData, FullUpdate
Demo/Questions
• Any Questions?