OGDC 2014: Cross Platform Mobile Game Application Development

31
Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved. Cross Platform Mobile Game Application Development Markku Kero / Eqela July 2014 / OGDC

Transcript of OGDC 2014: Cross Platform Mobile Game Application Development

Page 1: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Cross Platform Mobile Game Application Development

Markku Kero / Eqela

July 2014 / OGDC

Page 2: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Page 3: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Cross platform development tools

One codebase; target multiple platforms

Many existing tools on the market

Page 4: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

“Cross platform tools do not work. Writing

native code is the only way.”

Page 5: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Commonly encountered issues

Large installer size

Excessive memory use

Low performance

Limited API access

Page 6: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

ANOTHER COMMON SENTIMENT

Page 7: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

WHY?

Page 8: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Source codetargeting a

specificplatform

Tool

Source / bytecode and

interpreter orVM for iOS

Source / bytecode and

interpreter orVM for Android

Runtime /Virtual

machine

(Java, JavaScript,Lua, Ruby, C#, ..)

A common cross platform tool

BROWSER

“virtual machine”

Page 9: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Operating system

Language interpreter / runtime

APIs and libraries Application code

A common cross platform toolArchitecture

Page 10: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

A common cross platform toolArchitecture

Operating system

Language interpreter / runtime

APIs and libraries Application code Makes applicationinstallers bigger

Increases memoryusage

Reduces runtimeperformance

Applications can onlyaccess selected

parts of the native API

= INCREASED BATTERY USAGE

Page 11: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

(Source: http://docs.xamarin.com/Android/Guides/Advanced_Topics/Architecture)

Page 12: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Page 13: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Page 14: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Another popular architecture

SourceCode in

HTML, CSS,JavaScript

Tool

C codeThat opens aBrowser andDisplays the

program

Java codeThat opens aBrowser andDisplays the

program

AndroidSDK

iOSSDK

“embed a web browser”

BROWSER

Page 15: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Commonly encountered issues

Large installer size

Excessive memory use

Low performance

Limited API access

Page 16: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

The C/C++ approach

C++application

code

Tool

C++ classlibrary

SWIFT

BROWSER

Page 17: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

C++ / bytecode combination

C++ code

Page 18: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Page 19: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Page 20: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Page 21: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

THE APPROACH CAN BE

IMPROVED

Page 22: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

HOW?

Page 23: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Programming language conversion

(Source code)

Small Installers Optimal memory useNo API access limitationsNative performance

Page 24: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Comparison: A “hello world” application

First approach (virtual machine / interpreter)Appcelerator: 8MB installer

Xamarin / Mono (Unity): 4MB installer

The “embed a web browser” approach:Phonegap / Cordova: ~300KB installer

The “source code conversion” approach:96KB installer

Page 25: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Programming LanguageTranslator

Page 26: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

2D / 3D GAMESMOBILE APPLICATIONS

BUSINESS SYSTEMSWEBSITES / WEB APPLICATIONS

BACKEND SERVERSDESKTOP TOOLS / UTILITIES

AUTOMATED QUALITY ASSURANCE

Page 27: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

class Main : LayerWidget{ public void initialize() { base.initialize(); add(LabelWidget.instance().set_text(“Hello World”)); }}

EqelaCompiler

LayerWidgetLabelWidget

Main.javaLayerWidget.javaLabelWidget.java

AndroidSDK

A sample Eqela application

Main.eq

Page 28: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

class Main : LayerWidget{ public void initialize() { base.initialize(); add(LabelWidget.instance().set_text(“Hello World”)); }}

package mk.test;public class Main extends eq.gui.LayerWidget{

@Overridepublic void initialize() {

super.initialize();((eq.gui.ContainerWidget)this).add(((eq.gui.Widget)eq.widget.LabelWidget.eq_widget_LabelWidget_instance().set_text(eq.api.StringStatic.eq_api_StringStatic_for_strptr("Hello world"))));

}

public Main() {}

}

(EQELA)

(JAVA)

Page 29: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

class AndroidHTTPGet{

public static bool execute(String url) {embed “java” {{{

org.apache.http.client.methods.HttpUriRequest hur =new org.apache.http.client.methods.HttpGet(url.to_strptr());

android.net.http.AndroidHttpClient hc =android.net.http.AndroidHttpClient.newInstance(“testing”);

org.apache.http.HttpResponse resp = hc.execute(hur);if(resp == null) {

return(false);}

}}}return(true);

}}

→ All platform specific features / APIsare accessible

Embedding other languages

Page 30: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

SpriteKit

Sprite Engine R3D

→ NO TECHNOLOGY LOCK-IN

Page 31: OGDC 2014: Cross Platform Mobile Game Application Development

Copyright (c) 2014 Eqela Pte Ltd. All Rights reserved.

Thank you

[email protected]

www.eqela.com