vietnam mobile day 2012 multi platform development - game loft

31

Upload: quang-anh

Post on 31-Aug-2014

1.351 views

Category:

Technology


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Vietnam mobile day 2012   multi platform development - game loft
Page 2: Vietnam mobile day 2012   multi platform development - game loft

Who am I

Nguyen Huy Dung, Team Leader at Gameloft HAN studio

Love to exchange knowledge and passion. Had several seminars and trainings in Hanoi-Aptech, GameLoft, Universities.

Page 3: Vietnam mobile day 2012   multi platform development - game loft

Agenda

Gameloft IntroductionGameloft’s approach to Multi-

Platform developmentTips, tricks and examplesQuestions and Answers

Page 4: Vietnam mobile day 2012   multi platform development - game loft

Gameloft: Leading developer and publisher

Founded in 1999, to develop from mobiles & smart phones

to cross-platform digital distribution

MobileConsole

Iphone, Ipod, Ipad

Android

Page 5: Vietnam mobile day 2012   multi platform development - game loft

Gameloft: Leading developer and publisher

Presence in over 80 countries

Agreements with over 200 carriers

~400,000 games sold per day

Page 6: Vietnam mobile day 2012   multi platform development - game loft

Gameloft: Leading developer and publisher

5125 talented people

Production studios in 12 countries

Page 7: Vietnam mobile day 2012   multi platform development - game loft

New York, San Francisco, Seattle,

Montreal, Mexico, Buenos Aires, Paris,

London, Cologne, Milan, Madrid,

Copenhagen, Warsaw, New Delhi, Seoul,

Beijing, Hong Kong, Tokyo, Sydney...

The BIGGEST Gameloft Studio WorldwideMore than 1000 talented staff

Gameloft Vietnam is The BIGGEST Gameloft Studio Worldwide

More than 1700 talented staff

Page 8: Vietnam mobile day 2012   multi platform development - game loft

SAI 1e-Town 2 Building - 7Fl., 364 Cong Hoa, Tan Binh Dist., HCMC

SAI 218A Cong Hoa, Tan Binh Dist., HCMCSince Aug-2008

DAD74 Bach Dang, Hai Chau Dist., Danang CitySince Mar-2010

HAN3rd&4th floor – Lilama 10Le Van Luong, HanoiSince June-2011

Gameloft keeps on growing fast in Vietnam

Page 9: Vietnam mobile day 2012   multi platform development - game loft

Multi-platform developmentGameloft’s approach to

Page 10: Vietnam mobile day 2012   multi platform development - game loft

Our games are running on

iOSAndroidPS3Windows Phone 7badaWebOSJava embed….

Page 11: Vietnam mobile day 2012   multi platform development - game loft

Our games are running on

iOSAndroidPS3Windows Phone 7badaWebOSJava embed…

Page 12: Vietnam mobile day 2012   multi platform development - game loft

How could we accomplished that?

Page 13: Vietnam mobile day 2012   multi platform development - game loft

How could we accomplished that?Different codebases for each platform?

Page 14: Vietnam mobile day 2012   multi platform development - game loft

Different codebases for each platform?Yes.

Page 15: Vietnam mobile day 2012   multi platform development - game loft

Different codebases for each platform?Yes. And No

Page 16: Vietnam mobile day 2012   multi platform development - game loft

Android Game

Platform-

specific UI

Platform-

specific Feature

s

Platform API

Wrapper

iOS Game

Platform-

specific UI

Platform-

specific Feature

s

Platform API

Wrapper

Windows Game

Page 17: Vietnam mobile day 2012   multi platform development - game loft

Windows Game

Built with C++, contains almost everything:UI Design

Game-LogicGame Rendering

SoundMultiplayer

Page 18: Vietnam mobile day 2012   multi platform development - game loft

Windows Game

Platform API

Wrapper

Platform API

Wrapper

•Android NDK•Java wrapper: Activity, View, Intent, Receiver

•C++ auto-compat•UIWindow, UIViewController, UIView, UIApplicationDelegate

Android Game iOS Game

Page 19: Vietnam mobile day 2012   multi platform development - game loft

Windows Game

Platform-

specific Feature

s

Platform API

Wrapper

Platform-

specific Feature

s

Platform API

Wrapper

•Advertising•In-App Billing•Beam

•iAd•In-App Purchase•Music Player

Android Game iOS Game

Page 20: Vietnam mobile day 2012   multi platform development - game loft

Windows Game

Platform-

specific Feature

s

Platform API

Wrapper

Platform-

specific Feature

s

Platform API

Wrapper

•Push Notification toggle•Kindle Fire Volume•Color Correction

•iOS is normally the role-model

Platform-

specific UI

Platform-

specific UI

Android Game iOS Game

Page 21: Vietnam mobile day 2012   multi platform development - game loft

Android Game

Platform-

specific UI

Platform-

specific Feature

s

Platform API

Wrapper

iOS Game

Platform-

specific UI

Platform-

specific Feature

s

Platform API

Wrapper

Windows Game

PORTING

Page 22: Vietnam mobile day 2012   multi platform development - game loft

Advantages of Porting

Big common code base: less bugs, less maintainance effort, less human resource

Only the things that really platform-specific are needed to be separated

Page 23: Vietnam mobile day 2012   multi platform development - game loft

How?

We built:Our own 3D engines and libraries

(Networking, Sound, UI, Debugger…) which already support multi-platform

Online System to centralize the services: User profiles, Billing, Data downloading, Multi player….

Core Packages for general features in each platform

Page 24: Vietnam mobile day 2012   multi platform development - game loft

plan ahead, not fix laterMulti-platform support

Page 25: Vietnam mobile day 2012   multi platform development - game loft

Tips and tricks

Try to build your game without a real device first

Graphics: Use OpenGL ES 2.0Don’t hard-code. Do things explicitly.

Have separated Configuration files. Prepare your data wiselyPreprocessing is not only for C++Keep an abstract macros/classes/library

of code that using platform-specific API or behave differently on each platform

Page 26: Vietnam mobile day 2012   multi platform development - game loft

Examples – Defines/Configuration#ifdef OS_ANDROID

#define KEYCODE_BACK (4)#define KEYCODE_UP (19)#define KEYCODE_DOWN (20)#define KEYCODE_LEFT (21)#define KEYCODE_RIGHT (22)

#elif defined(WIN32) #define KEYCODE_BACK (27)

#define KEYCODE_UP (38)#define KEYCODE_DOWN (40)#define KEYCODE_LEFT (37)#define KEYCODE_RIGHT (39)

#endif

Page 27: Vietnam mobile day 2012   multi platform development - game loft

Examples – simple macro#define PLATFORM_WIN32 1#define PLATFORM_ANDROID 2#define CONFIG_PLATFORM PLATFORM_WIN32#if CONFIG_PLATFORM==PLATFORM_ANDROID#include <android/log.h>#define Log(...) __android_log_print(ANDROID_LOG_INFO, “GLGame",__VA_ARGS__)

#elif CONFIG_PLATFORM==PLATFORM_WIN32#define Log(...) printf(__VA_ARGS__);printf("\n")

#else#define Log(...)

#endif

Page 28: Vietnam mobile day 2012   multi platform development - game loft

Examples – Abstract Libraryclass TouchScreenBase { ... }class TouchScreenMobile : public TouchScreenBase { ... }class TouchScreenWin32 : public TouchScreenBase{ ... }#ifdef OS_ANDROIDtypedef TouchScreen TouchScreenMobile

#elif defined(WIN32)typedef TouchScreen TouchScreenWin32

#endif

//Usage: Just use TouchScreen Class

Page 29: Vietnam mobile day 2012   multi platform development - game loft

Examples – Abstract Library (2)class TouchScreenBase { ... }class TouchScreenMobile : public TouchScreenBase { ... }class TouchScreenWin32 : public TouchScreenBase{ ... }

//Usage: Cast to TouchScreenBase Class#ifdef OS_ANDROID TouchScreenBase* TS = new TouchScreenMobile()

#elif defined(WIN32) TouchScreenBase* TS = new TouchScreenWin32()

#endif

Page 30: Vietnam mobile day 2012   multi platform development - game loft

plan ahead, not fix laterMulti-platform support

Page 31: Vietnam mobile day 2012   multi platform development - game loft

Questions and AnswersThanks for your attention! Contact me: [email protected]