html5: the new ui library for games - twvideo01.ubm...

37
HTML5: The New UI Library For Games Chad Austin Technical Director, IMVU

Upload: ngokhanh

Post on 12-Feb-2018

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

HTML5: The New UI Library For Games > Chad Austin >  Technical Director, IMVU

Page 2: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

HTML IS WINNING

Page 3: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,
Page 4: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Browser wars are hotter than ever >  Features like canvas, SVG, CSS3,

becoming standard > GPU accelerated compositing &

rasterization >  Tracing JITs

Page 5: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Terminology

> HTML = markup + CSS + JS + Canvas + sockets + etc.

> Mozilla = Firefox = Gecko

Page 6: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

HISTORY OF IMVU’S UI

Page 7: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

2004-2007: C++ & OpenGL

Page 8: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

C++, GL, Win32

> Cons > Hard to find talent > Hard to maintain > Long recompiles and iteration times >  Inflexible

Page 9: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

2007-2009: Flash

Page 10: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Flash, Flex

>  Pros >  Able to iterate >  Easy animation, video

> Cons >  High memory usage, address space leaks >  Looong mxmlc compile times >  Buggy

Page 11: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

2009+: HTML

Page 12: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Pros!

> Very fast iteration > Matched intended design to the pixel >  Performance was fantastic > Render to texture and composite in 3D

scene

Page 13: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

2009+: HTML

Page 14: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

2009+: HTML

Page 15: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

2009+: HTML

Page 16: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

BENEFITS OF HTML

Page 17: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Lingua Franca

Page 18: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Hot Reloading, Firebug

Page 19: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

jQuery, YUI

Page 20: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Advertising

Page 21: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

DEMO

Page 22: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

PERFORMANCE?

Page 23: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

If your browser can handle this…

Page 24: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Performance

> Not a bottleneck for us >  Even 3D overlays! > <1 MB per Gecko document loaded

> 1000s of friends, inventory items

Page 25: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Performance (Friends)

Some DOM ops are O(n), use b-tree

Page 26: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Performance (Inventory)

Be careful to release image elements when scrolled out of view

Page 27: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Today’s Drawbacks

>  Elaborate animation still easier in Flash than SVG/Canvas/JS

>  3D: WebGL not prime time yet >  Tracing JITs hungrier than Lua/C++

Page 28: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

WHO ELSE USES HTML FOR UI?

Page 29: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Wolfire – Overgrowth

Page 30: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Wolfire – Overgrowth (con’t)

Page 31: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Electronic Arts – Skate 3

Page 32: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Netflix on PlayStation 3

Page 33: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

In-game Browsers

> Second Life > CCP – EVE Online >  Funcom – Anarchy Online, Age of Conan > ArenaNet – Guild Wars 2

Page 34: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Getting Started >  WebKit http://webkit.org/ vs. Gecko

https://developer.mozilla.org/en/Gecko >  We chose Gecko, most use WebKit (EA’s PS3

port: http://gpl.ea.com/skate3.html) >  Leverage entire stack: stream pixels from HTTP

into texture

Page 35: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Wrappers >  http://ubrowser.com/ >  http://wiki.secondlife.com/wiki/LlMozLib >  http://wiki.secondlife.com/wiki/LLQtWebKit >  http://www.khrona.com/products/awesomium/ >  http://berkelium.org/

Page 36: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Recap

> HTML and web technologies are advancing quickly

> Already suitable for in-game UIs > Rapid development and iteration > Worked for us, may work for you!

Page 37: HTML5: The New UI Library For Games - twvideo01.ubm …twvideo01.ubm-us.net/o1/vault/gdc2011/slides/Chad_Austin... · Browser wars are hotter than ever ! Features like canvas, SVG,

Questions?

[email protected] http://engineering.imvu.com

We’re hiring!