Top Banner
Outburst 3D Node Knockout 2011
21
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Outburst 3D

Outburst 3DNode Knockout 2011

Page 2: Outburst 3D

The team

Ari Þór ArnbjörnssonFlash Developer at Rovio

Eiríkur Heiðar NilssonWeb Developer at Gagnavarslan

Sveinn BjörnssonStudent at Margmiðlunarskólinn

Ægir ÞorsteinssonWeb Developer at Landsbankinn

Page 3: Outburst 3D

Our mission

Real time multiplayer game

3D in the browser

Share code between server and client

Have fun!

Page 4: Outburst 3D

DEMO

Page 5: Outburst 3D

WebGL

HTML 5 Canvas element

OpenGL ES 2.0

Shaders

No support in IE

Page 6: Outburst 3D

THREE.JShttps://github.com/mrdoob/three.js/

Page 7: Outburst 3D

Models

Maya OBJ JSON

JSON

Page 8: Outburst 3D
Page 9: Outburst 3D

MultiplayerNodeJS Server - Websocket

Page 10: Outburst 3D

Best Practices …in 48

hours

Authorative Server

Client shares server code to predict

movement

Lag compensation on server

Compression

Page 11: Outburst 3D

The packets

Client Server

Input state – 25

p/sec

World state – 25

p/sec

Inputs and gameplay are evaluated 50 times per second

Page 12: Outburst 3D

Input packet

Page 13: Outburst 3D

World packet

Page 14: Outburst 3D

Shared code

Server (NodeJS) and client (browser) run

Javascript

… or rather CoffeeScript

Page 15: Outburst 3D

Player state

New player

state

Shared code

Input state

Page 16: Outburst 3D

Lag compensation

Page 17: Outburst 3D

Packet sizes

For a single player:

Input: 137 bytes

World: 2093 bytes

25 times per second is ~50 kibi/sec

Page 18: Outburst 3D

Simple delta compression

Page 19: Outburst 3D

Compression results

World: 2093 => 691 bytes

33% of original size

Input: 137 => 35 bytes

26% of original size

Bandwidth: ~50 => ~20 kibi/sec

Page 20: Outburst 3D

Future optimizations

Round floating point numbers

Delta optimize the derivative of some

fields

Binary JSON (when browsers add

support)

Page 21: Outburst 3D

Conclusion

Web Standards are awesome

CoffeeScript on server and client is awesome

Sheep are awesome

V8 is awesome

Real time multiplayer is hard

48 hours go by FAAAST…