Reliving the history of multi player games @phuesler @rirei At - - PowerPoint PPT Presentation

reliving the history of multi player games
SMART_READER_LITE
LIVE PREVIEW

Reliving the history of multi player games @phuesler @rirei At - - PowerPoint PPT Presentation

Reliving the history of multi player games @phuesler @rirei At Wooga Evolution is driven by teams Technologies Architecture Platforms User interaction Level 1: Read-only interaction High score Pacman read-only access Client Client


slide-1
SLIDE 1

Reliving the history of multi player games

@phuesler @rirei

slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6

At Wooga

Evolution

is driven by teams

slide-7
SLIDE 7

Technologies

slide-8
SLIDE 8

Architecture

slide-9
SLIDE 9

Platforms

slide-10
SLIDE 10

User interaction

slide-11
SLIDE 11

Level 1:

Read-only

interaction

slide-12
SLIDE 12

High score

Pacman

slide-13
SLIDE 13
slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16

read-only access

Client Score DB Client

slide-17
SLIDE 17

Level 2:

Inbox

interaction

slide-18
SLIDE 18

Turn based

Empire Civilization

slide-19
SLIDE 19
slide-20
SLIDE 20

inbox

Client Inbox Client DB

slide-21
SLIDE 21

Inbox interaction

Client Inbox App Client

slide-22
SLIDE 22

woo.ga/backend

slide-23
SLIDE 23

Level 3:

Real

interaction

slide-24
SLIDE 24

Real interaction

MUD World of Warcraft

slide-25
SLIDE 25
slide-26
SLIDE 26
slide-27
SLIDE 27

Real interaction

Client Usr Usr Loc App Client

slide-28
SLIDE 28
slide-29
SLIDE 29

Handling conflicts

Client Usr Usr Loc App Log Log Client

slide-30
SLIDE 30
slide-31
SLIDE 31

woo.ga/backend

slide-32
SLIDE 32

Level 4:

Real time

interaction

slide-33
SLIDE 33

Real time interaction

Super Mario Kart Starcraft

slide-34
SLIDE 34

Player 1 Player 2 Server

slide-35
SLIDE 35

Player 1 Player 2 Server

slide-36
SLIDE 36

Player 1 Player 2 Server

slide-37
SLIDE 37

Sources of inspiration

slide-38
SLIDE 38
  • good throughput
  • low latency
  • low packet loss
  • no jitter

We depend on

slide-39
SLIDE 39

Level 4:

Real time

interaction on mobile

slide-40
SLIDE 40

3G Internet

slide-41
SLIDE 41

Bandwidth

0.73 Mbps

1.2 Mbps

3G

https://de.wikipedia.org/wiki/High_Speed_Uplink_Packet_Access https://de.wikipedia.org/wiki/High_Speed_Downlink_Packet_Access
slide-42
SLIDE 42

Added Latency (RTT) *

3G

70 - 180 ms

http://202.194.20.8/proc/VTC09Spring/DATA/09-18-19.PDF * HSDPA/HSUPA
slide-43
SLIDE 43

Packet loss

slide-44
SLIDE 44

Latency Jitter

75 150 225 300

RTT ms

slide-45
SLIDE 45

Let’s do

Bomberman

slide-46
SLIDE 46
slide-47
SLIDE 47

Client Prediction

Extrapolation Interpolation

Lag Compensation

Latency

Object Replication

Quality of Service Physics

Collision Detection

TCP

UDP

Real Time

Match Making

Packet Loss

Synchronization

Peer-To-Peer

Lockstep

Protocol

slide-48
SLIDE 48
slide-49
SLIDE 49

1

slide-50
SLIDE 50

Architecture

C1 C2 Server

move :up c1 moved :up place bomb c2 placed bomb bomb exploded bomb exploded game over game over

slide-51
SLIDE 51

TCP JSON

EASY!!!

slide-52
SLIDE 52

Works on Wifi

: )

slide-53
SLIDE 53

game doesn’t work on 3G

: (

slide-54
SLIDE 54

Jitter

slide-55
SLIDE 55

Dropped packets

slide-56
SLIDE 56

TCP Packet Ordering and Resend

slide-57
SLIDE 57

TCP Flow and Congestion Control

slide-58
SLIDE 58

Warping

no update no update no update 4 updates at once

slide-59
SLIDE 59
  • r

WORSE

: (

slide-60
SLIDE 60

2

slide-61
SLIDE 61

Architecture

move :up

C1 C2 Server

c1 moved :up place bomb c2 placed bomb bomb exploded bomb exploded game over game over

slide-62
SLIDE 62

UDP

3G

Will it work?

slide-63
SLIDE 63

Poor man’s TCP

User Id Local Seq No Remote Seq No Ack bitfield

JSON P N Payload ad

  • http://gafferongames.com/networking-for-game-programmers/reliability-and-flow-control/
slide-64
SLIDE 64

Poor man’s TCP

Ordering Acknowledge Packets Resending Packets Flow Control Congestion Control

✔ ✔ X X X

slide-65
SLIDE 65

UDP

3G

Tested with a few providers in Germany, Switzerland and Netherlands
slide-66
SLIDE 66

game barely works on Wifi

: |

slide-67
SLIDE 67

game doesn’t work at all on 3G!!!

: (

slide-68
SLIDE 68

Packet Loss

slide-69
SLIDE 69

No synchronization

slide-70
SLIDE 70

3

slide-71
SLIDE 71

UDP JSON

State updates

slide-72
SLIDE 72

Send full state

Full State Full State Full State Full State

slide-73
SLIDE 73

MTU

Ethernet 1500 bytes PPPoE 1492 bytes Edge 1440 bytes

https://en.wikipedia.org/wiki/Maximum_transmission_unit http://ipixcel.org/EDGE_Capabilities,_Technology,_and_Applications_PDF.pdf
slide-74
SLIDE 74

Architecture

C1 C2 Server

move :up state update state update state update state update game over game over move :down

slide-75
SLIDE 75

10 msg/second

slide-76
SLIDE 76

100 ms walking speed

slide-77
SLIDE 77

Game works on 3G

: )

slide-78
SLIDE 78

Highscores and Matchmaking are

BROKEN!

: (

slide-79
SLIDE 79

4

slide-80
SLIDE 80

Architecture

C1 C2 Server

move :up state update state update state update state update game over game over move :down

slide-81
SLIDE 81

Different Concerns

Game Play

Matchmaking Highscores Login/Logout User Data

Reliable Unreliable

slide-82
SLIDE 82

Different Concerns

Game Play

Matchmaking Highscores Login/Logout User Data

HTTP UDP

slide-83
SLIDE 83

Server architecture

Lobby Server HTTP Service User Registry Matchmaking Logic Game Server UDP Service User Registry Game Logic RPC

Database

slide-84
SLIDE 84

UDP Binary

slide-85
SLIDE 85

Binary protocol

64 bit 32bit 32bit 8bit 8bit Rest User Id SeqNr Ack Bitfield Command Payload

144 bits 944 bits 118 bytes 18 bytes

slide-86
SLIDE 86

2 Player State update

~ 136 bytes

slide-87
SLIDE 87

56K Modem 7 KBps 10 msg/second 1.420 KBps ✔

slide-88
SLIDE 88

Improved Gameplay

: )

slide-89
SLIDE 89

5

slide-90
SLIDE 90

FIFO with timers

slide-91
SLIDE 91

Casual Matchmaking

Skill Time 4 Players Match

slide-92
SLIDE 92

Hierarchical Clustering

slide-93
SLIDE 93

Better Matchmaking

1 2 3 4 5 6 7

Queueing

=10 10 10 10

Start Game

1 2 3 4 5 6 7

Find Matches

=1

Reschedule

2 3 4 6 10 10 10 =1
slide-94
SLIDE 94

Better

Matchmaking

: )

slide-95
SLIDE 95

Geo Matching

slide-96
SLIDE 96

Play

Locally

: )

slide-97
SLIDE 97

Debugging

slide-98
SLIDE 98

Terminal Client

slide-99
SLIDE 99

Bots

slide-100
SLIDE 100

Network Link Conditioner

slide-101
SLIDE 101

Erlang tools

erlscript WX Widgets Remote Shell Hot Code Reload

slide-102
SLIDE 102

Level 4:

Finished

mobile multi player

slide-103
SLIDE 103

User interaction

slide-104
SLIDE 104

Questions?

@phuesler @jrirei http://wooga.com/jobs