Adobe AIR and iOS Mobile Games 2016

48
AIR & iOS Mobile Games

Transcript of Adobe AIR and iOS Mobile Games 2016

Page 1: Adobe AIR and iOS Mobile Games 2016

AIR & iOS Mobile Games

Page 2: Adobe AIR and iOS Mobile Games 2016

Overview

A little about meMemory saving tipsPerformance bottlenecksDevelopment bottlenecksANEs and what you need to knowApplication XMLQ&A

Page 3: Adobe AIR and iOS Mobile Games 2016

About me

Page 4: Adobe AIR and iOS Mobile Games 2016

About me

Currently:Principal Programmer at MovieStarPlanetBased in Copenhagen, Denmark

Previously:Worked on PC, Nintendo DS and PlayStation 2 games

Page 5: Adobe AIR and iOS Mobile Games 2016

About this talk

Familiar with Stage3D

Familiar with Adobe Scout

Somewhat familiar with iTunesConnect

Page 6: Adobe AIR and iOS Mobile Games 2016

Memory Saving Tips

Page 7: Adobe AIR and iOS Mobile Games 2016

Object Pooling

Memory allocation in iOS is very slow

The problem is that it doesn’t show up during PC development

Page 8: Adobe AIR and iOS Mobile Games 2016

Object Pooling

DragonBones on Mobile

Page 9: Adobe AIR and iOS Mobile Games 2016

Object Pooling

169 ms in garbage collection

Page 11: Adobe AIR and iOS Mobile Games 2016

Object Pooling2,897ms down to 695ms

GC No longer #1 concern!

Page 13: Adobe AIR and iOS Mobile Games 2016

Memory Saving Tips

Stay away from “new” in your game update loop or places that get called every frame

Page 14: Adobe AIR and iOS Mobile Games 2016

Memory Saving Tips

At look through Scout

Page 15: Adobe AIR and iOS Mobile Games 2016

Memory Saving Tips

Looking at the code (Main::CheckCollisions)

Page 16: Adobe AIR and iOS Mobile Games 2016

Memory Saving Tips

Page 17: Adobe AIR and iOS Mobile Games 2016

Memory Saving Tips

No more allocations :) (sort of)

Page 18: Adobe AIR and iOS Mobile Games 2016

Memory Saving tips

Using out paramsShows library cares about memory usage

Prevents unnecessary allocations

If you’re writing an API, keep this in mind

Page 19: Adobe AIR and iOS Mobile Games 2016

Memory Saving tips

Sprite sheetsGood for custom move sets

Good for low resolution devices

Great for performance, UV updates only

Does not scale well with hundreds of animations

Page 20: Adobe AIR and iOS Mobile Games 2016

Memory Saving Tips

Frameworks such as DragonBones are here to help you

Page 21: Adobe AIR and iOS Mobile Games 2016

Performance Bottlenecks

Page 22: Adobe AIR and iOS Mobile Games 2016

Performance Bottlenecks

Bitmap fonts and breaking a draw call

Further reading

Page 23: Adobe AIR and iOS Mobile Games 2016

Performance Bottlenecks

Bitmap fonts and breaking a draw call

Bitmap fonts are stored in a texture

Your spritesheet is in another texture

Page 24: Adobe AIR and iOS Mobile Games 2016

Performance Bottlenecks

Same draw call

Potential draw back is limited character set

Page 25: Adobe AIR and iOS Mobile Games 2016

Performance Bottlenecks

Using TexturePacker, create your SpriteSheet

Use a SubTexture to grab the Font Texture

Pass that into Starling’s TextField.registerBitmapFont()

Page 27: Adobe AIR and iOS Mobile Games 2016

Development Bottlenecks

Page 28: Adobe AIR and iOS Mobile Games 2016

Uploading Builds

Building to device

Build Types

Provisioning Profiles

Page 29: Adobe AIR and iOS Mobile Games 2016

Can take a few minutes to compile

Building to deviceNeed to compile ad-hoc builds (from FlashDevelop)

Depending on AIR SDK, no automatic installation on device -> Need additional tools

Page 30: Adobe AIR and iOS Mobile Games 2016

idb.exe

Can be found at:AIRSDK\lib\aot\bin\iOSBin

You can upload builds directly to your iOS device using this (and other useful things)

Page 31: Adobe AIR and iOS Mobile Games 2016

Interpreter, Ad-Hoc & App Store builds

Interpreter : Very fast to build, runs slow on device

Ad-hoc : Slow to build, for development only (with device UUIDs registered on Apple Developer account)

App Store Build : Final build submitted to Apple via Application Loader

Pro tip: Build to Android first, much faster iteration times!

Page 32: Adobe AIR and iOS Mobile Games 2016

Provisioning Profiles

What they do:

Ad Hoc: Install on registered devices

Debug profile: Allows you to use Test Flight

Generating that p12 key

App Store: Profile which app is built to be submitted to App Store

Page 33: Adobe AIR and iOS Mobile Games 2016

Get an iPad AIR

Runs interpreter builds at an acceptable rate

Bonus: interpreter-debug builds can be debugged if on same Local Area Network! Great for finding exceptions!

Page 34: Adobe AIR and iOS Mobile Games 2016

ANEs

Page 35: Adobe AIR and iOS Mobile Games 2016

ANEs and what you need to know

iOS and 64-bit

Recommended ANE makers

In App Purchases

Page 36: Adobe AIR and iOS Mobile Games 2016

ANEs and what you need to know

iOS and 64-bit

Page 37: Adobe AIR and iOS Mobile Games 2016

64 bit iOS builds

Your app’s code is duplicated

Found at 0x00DF19D0 and at 0x020CAF80

About 19MB apart in this case.

Page 38: Adobe AIR and iOS Mobile Games 2016

64 bit iOS builds

Need to be careful with embedded assets, since they will be duplicated in your code

Page 39: Adobe AIR and iOS Mobile Games 2016

ANEs and what you need to knowWhat does this mean for developers?

Additional libraries needed

Backwards compatibility makes your IPA grow in size (possibly double)

Need to keep up with the platform requirements (Android & iOS)

Highly recommend AIRNativeExtensions by Distriqt

Page 40: Adobe AIR and iOS Mobile Games 2016

ANEs and what you need to know

In App purchases

Page 42: Adobe AIR and iOS Mobile Games 2016

ANEs

Low Memory ANE:https://github.com/distriqt/ANE-Memory

Page 43: Adobe AIR and iOS Mobile Games 2016

Application XML

Page 44: Adobe AIR and iOS Mobile Games 2016

Application XML

Various compilation parameters

Test Flight on iTunes Connect

AppStore review

Page 45: Adobe AIR and iOS Mobile Games 2016

Application XML

Various compilation parameters

rendermode : direct

depthAndStencil: true

Page 46: Adobe AIR and iOS Mobile Games 2016

Application XMLTest Flight on iTunesConnect

No longer need device UUIDs

Can potentially test on hundreds of Beta testers

Additional application.xml parameters needed

More info here

Page 47: Adobe AIR and iOS Mobile Games 2016

AppStore review

http://appreviewtimes.com/

Updating your app

iOS versions with AIR SDK versions & some examples of what could go wrong

Page 48: Adobe AIR and iOS Mobile Games 2016

Questions?@jav_dev