Top Banner
Cross-platform Game Development for Mobile & Web CODY NGUYEN Mobile Game Developer Vinova Pte Ltd [email protected]
39

OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

May 13, 2015

Download

ogdc

Presentation in OGDC 2013 organized by VNG Corp.
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: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Cross-platform Game Development for Mobile & Web

CODY NGUYEN

Mobile Game DeveloperVinova Pte Ltd

[email protected]

Page 2: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

cross-platformwrite once, run on multiple platforms

Page 3: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Benefits of

cross-platform game development

Page 4: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Less skills required

• Native game development for different devices requires different skill sets.

• Less skills means more focused & efficient

Page 5: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

More gaming devices, less code

• Gaming devices are more and more diverse

• More devices means more audience

Page 6: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Fast development & maintenance

• Game requirements change every day

• One effort covers all platforms

Page 7: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

An overview of

video gaming platforms

Page 8: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Video gaming platforms

• PlayStation• XBOX• Wii

• Native game clients

• iOS• Android• Windows

Phone

• Flash• Native Client

(Chrome Only)

• HTML5

Web Mobile

Console

Desktop

Page 9: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Video gaming platforms

• Flash• Native Client

(Chrome Only)• HTML5

• iOS• Android• Windows

Phone

• PlayStation• XBOX• Wii

• Native game clients

Web Mobile

ConsoleDesktop

Page 10: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Why

WEB & MOBILE ?

Page 11: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Web & Mobileis

ONE

Page 12: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

cross-platform game

approaches

Page 13: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

HTML5

• Run on PC & mobile browsers

• Run as wrapper apps on mobile

Native Mobile

• Write in C/C++ for mobile, compile to JS to run on browsers

• Write JS bindings for mobile and browsers

Page 14: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Browsers are improving

• 2D & 3D rendering• WebSocket• Web workers• Audio

Page 15: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

JavaScript is improving

• Race among JS engines (V8, SpiderMonkey, Nitro) is good for JS performance

• JS runs large code faster

Page 16: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

JavaScript meets C/C++

• Compile C/C++ to JS with Emscripten• Compiled code is faster than

handwritten code

Page 17: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Even faster with asm.js

• Strict subset of JS, optimized for compiled code

• Without asm.js, 10x slower than native C/C++

• With asm.js, half as fast (comparable to Java, C#)

• Will get even faster

Page 18: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Even faster with asm.js

Source: http://kripken.github.io/mloc_emscripten_talk/#/28

Page 19: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1
Page 20: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

HTML5 is an

observable trend

Page 21: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Everybody is shifting to HTML5

• Google, Microsoft, Apple & Mozilla are pushing for HTML5

• Game pioneers (Epic & Unity3D) too

Page 22: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Native mobile

Page 23: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Cross-platform game engines

and more

Page 24: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Why 2D?

• Target mobile devices• 3D camera is not effective on small

screens• Reduced development effort & time.

Page 25: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

The Cocos2D Ecosystem

Page 26: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Cocos2D

• 2D game ecosystem• Open source (MIT lisence)• Great community

Page 27: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

What’s in there

Page 28: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

What’s in there

Page 29: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Who’s in there

Page 30: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1
Page 31: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Why is Cocos2D good for cross-platform game

development?

Page 32: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Cocos2D-x / -iphone• C++ / ObjC API• JavaScript bindings• Runs on iOS &

Android

Cocos2D-html5• JavaScript API• Runs on WebGL-

enabled browsers

JavaScript = common language

Page 33: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

The 2 approaches

Page 34: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

1. Start with Cocos2D-html5

• Write JS code, for browsers• Re-use JS code as JS bindings, for mobile

Re-use as JS bindings for C/C++ API

JS code access Cocos2D-html5 API

Page 35: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

2. Start with Cocos2D-x

• Write C/C++ code, for mobile• Compile to JS, for browsers

C/C++ code for mobile first

Compile to JS via Emscripten & asm.js

Page 36: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Emscripten in Cocos2D-x is new

• Audio is not supported yet• Cocos2D-x lib is not yet validated with

asm.js• Screen resolution need to be hardcoded

for now

Page 37: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

It’s getting better everyday

• The Cocos2D-x team are improving Emscripten support

• Mozilla, Unity3D are working on asm.js & Emscripten improvement

Page 38: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

To sum up

Page 39: OGDC2013_ Cross platform game development for mobile & web_ Mr Cody nguyen1

Thank you