12
Applying Real-time Simulation to Real- time Collaboration Bart Miller

Applying Real-time Simulation to Real-time Collaboration Bart Miller

Embed Size (px)

Citation preview

Page 1: Applying Real-time Simulation to Real-time Collaboration Bart Miller

Applying Real-time Simulation to Real-time Collaboration

Bart Miller

Page 2: 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

Page 3: Applying Real-time Simulation to Real-time Collaboration Bart Miller

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?

Page 4: Applying Real-time Simulation to Real-time Collaboration Bart Miller

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

Page 5: Applying Real-time Simulation to Real-time Collaboration Bart Miller

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

Page 6: Applying Real-time Simulation to Real-time Collaboration Bart Miller

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

Page 7: Applying Real-time Simulation to Real-time Collaboration Bart Miller

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)

Page 8: Applying Real-time Simulation to Real-time Collaboration Bart Miller

Real-time Multiplayer Simulation

Page 9: Applying Real-time Simulation to Real-time Collaboration Bart Miller

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

Page 10: Applying Real-time Simulation to Real-time Collaboration Bart Miller

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)

Page 11: Applying Real-time Simulation to Real-time Collaboration Bart Miller

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

Page 12: Applying Real-time Simulation to Real-time Collaboration Bart Miller

Demo/Questions

• Any Questions?