gdd 2011 - how to build kick ass video games for the cloud
DESCRIPTION
This is the Google Developer Day 2011 "How to build kick ass games in the cloud" presentation that was given in Sao Paulo and Buenos Aires. (The title is in Spanish since it was last given in Argentina - the content is the same as Sao Paulo though) It was given by Google Developer Advocate, Chris Schalk in Sept 2011. @cschalkTRANSCRIPT
![Page 1: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/1.jpg)
Creación de video juegos en la nube(How to Build Kick Ass Games in the Cloud)
Chris SchalkGoogle Developer Advocate
![Page 2: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/2.jpg)
Let's start with a Demo!
![Page 3: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/3.jpg)
Introducing PlayN!An abstraction layer for games (Formerly ForPlay)
● A small API for building fast cross-platform games
● Core game code can be platform agnostic
● Develop games in Java○ Familiar language/toolset
● Is compatible with GWT○ Compiles to JS/HTML5, (among other platforms)
● Free and Open Source (alpha)○ http://code.google.com/p/playn
![Page 4: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/4.jpg)
Introducing PlayN!A GWT abstraction layer for games
Implementations for Java, HTML5(GWT/JS), Android, Flash
PlayN API
![Page 5: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/5.jpg)
Components of PlayN!
Fully generic gaming components. Core game logic is fully platform independent!
Implements core.Game PlayN.*
![Page 6: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/6.jpg)
Components of PlayN!
Just implement PlayN.core.Game
![Page 7: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/7.jpg)
Components of PlayN!
Easy to write code to handle common input devices
public void OnKeyDown( keyboard.Event event ) {
public void OnPointerEnd( Pointer.Event event ) {
public void OnPointerMove( Pointer.Event event ) {
![Page 8: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/8.jpg)
Components of PlayN!
Images are handled via the PlayN Layering system
![Page 9: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/9.jpg)
Components of PlayN!
Game resources are preloaded using the assetManager
![Page 10: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/10.jpg)
Time for some more demos!
![Page 11: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/11.jpg)
PlayN Cross Platform Magic
● Game uses core PlayN abstractions, is unaware of which platform is running
● The only platform-specific code is in the entry point for each platform:
PlayN.run(new MyGame()); PlayN.run(new MyGame());
![Page 12: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/12.jpg)
Other PlayN Benefits
● Built-in physics engine based on proven OpenSource technologies
● Box2D○ C++ 2D Physics engine by Erin Catto
● JBox2D○ A port of Box2D from C++ to Java
● GWTBox2D○ A port of JBox2D from Java to JavaScript
![Page 13: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/13.jpg)
Benefits of GWT Abstraction
● GWT Compiler optimizes code for size○ Removes unused code○ Evaluates when possible at compile time○ Inlines functions○ Heavily obfuscated result code
● Smaller compiled code - faster load time● Optimized caching, avoids unnecessary network IO
![Page 14: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/14.jpg)
Benefits of HTML5 for Games
● New HTML elements○ 2D canvas○ Audio, Video
● Application Cache
● 3D Canvas (WebGL)○ Open GL ES 2.0 made JavaScript friendly
● CSS3○ Supports hardware accelerated transforms
![Page 15: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/15.jpg)
More demos● Building your own games
○ Introducing "App Engine: Cloud Warrior"
![Page 16: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/16.jpg)
App Engine Cloud Warrior Architecture
Google Storage
Game Assets(images/sounds)
Game ScoresProfile Data
App EngineDatastore
Game Play (PlayN)
![Page 17: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/17.jpg)
PlayN Summary
● Open source, cross-platform game abstraction layer○ Core game logic is platform agnostic
● ForPlay abstracts away the core components of a game○ The game loop, I/O system, and asset management
● Write in familiar Java, get performance on multiple platforms
○ Superior Java development/debug○ GWT allows compilation to fast JavaScript/HTML5
● Your assignment:○ Download PlayN and build a game! ○ http://code.google.com/p/playn/
![Page 18: GDD 2011 - How to build kick ass video games for the cloud](https://reader034.vdocuments.net/reader034/viewer/2022051818/54bf0b544a795933508b4615/html5/thumbnails/18.jpg)
Q&A@cschalk