OGDC 2014: Cross Platform Mobile Game Application Development

Preview:

Citation preview

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

Cross Platform Mobile Game Application Development

Markku Kero / Eqela

July 2014 / OGDC

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

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

Cross platform development tools

One codebase; target multiple platforms

Many existing tools on the market

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

“Cross platform tools do not work. Writing

native code is the only way.”

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

Commonly encountered issues

Large installer size

Excessive memory use

Low performance

Limited API access

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

ANOTHER COMMON SENTIMENT

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

WHY?

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”

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

Operating system

Language interpreter / runtime

APIs and libraries Application code

A common cross platform toolArchitecture

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

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

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

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

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

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

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

Commonly encountered issues

Large installer size

Excessive memory use

Low performance

Limited API access

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

The C/C++ approach

C++application

code

Tool

C++ classlibrary

SWIFT

BROWSER

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

C++ / bytecode combination

C++ code

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

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

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

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

THE APPROACH CAN BE

IMPROVED

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

HOW?

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

Programming language conversion

(Source code)

Small Installers Optimal memory useNo API access limitationsNative performance

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

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

Programming LanguageTranslator

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

2D / 3D GAMESMOBILE APPLICATIONS

BUSINESS SYSTEMSWEBSITES / WEB APPLICATIONS

BACKEND SERVERSDESKTOP TOOLS / UTILITIES

AUTOMATED QUALITY ASSURANCE

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

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)

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

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

SpriteKit

Sprite Engine R3D

→ NO TECHNOLOGY LOCK-IN

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

Thank you

markku.kero@jobandesther.com

www.eqela.com

Recommended