adobe air and ios mobile games 2016
TRANSCRIPT
AIR & iOS Mobile Games
Overview
A little about meMemory saving tipsPerformance bottlenecksDevelopment bottlenecksANEs and what you need to knowApplication XMLQ&A
About me
About me
Currently:Principal Programmer at MovieStarPlanetBased in Copenhagen, Denmark
Previously:Worked on PC, Nintendo DS and PlayStation 2 games
About this talk
Familiar with Stage3D
Familiar with Adobe Scout
Somewhat familiar with iTunesConnect
Memory Saving Tips
Object Pooling
Memory allocation in iOS is very slow
The problem is that it doesn’t show up during PC development
Object Pooling
DragonBones on Mobile
Object Pooling
169 ms in garbage collection
Object Pooling
Use ObjectPooling to prevent garbage collection
Richard Lord’s Object Pooling classGary Paluk’s Object Pooling class
Object Pooling2,897ms down to 695ms
GC No longer #1 concern!
Problems with Built in functions
Array.sort()Array.sortOn()Matrix3D.decompose()
Sergey Gonchar’s implementation
Vector.splice()Adobe’s update with insertAt() & removeAt() in AIRSDK 19
Memory Saving Tips
Stay away from “new” in your game update loop or places that get called every frame
Memory Saving Tips
At look through Scout
Memory Saving Tips
Looking at the code (Main::CheckCollisions)
Memory Saving Tips
Memory Saving Tips
No more allocations :) (sort of)
Memory Saving tips
Using out paramsShows library cares about memory usage
Prevents unnecessary allocations
If you’re writing an API, keep this in mind
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
Memory Saving Tips
Frameworks such as DragonBones are here to help you
Performance Bottlenecks
Performance Bottlenecks
Bitmap fonts and breaking a draw call
Further reading
Performance Bottlenecks
Bitmap fonts and breaking a draw call
Bitmap fonts are stored in a texture
Your spritesheet is in another texture
Performance Bottlenecks
Same draw call
Potential draw back is limited character set
Performance Bottlenecks
Using TexturePacker, create your SpriteSheet
Use a SubTexture to grab the Font Texture
Pass that into Starling’s TextField.registerBitmapFont()
Performance Bottlenecks
Further reading:Batch, Batch, Batch!
Development Bottlenecks
Uploading Builds
Building to device
Build Types
Provisioning Profiles
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
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)
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!
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
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!
ANEs
ANEs and what you need to know
iOS and 64-bit
Recommended ANE makers
In App Purchases
ANEs and what you need to know
iOS and 64-bit
64 bit iOS builds
Your app’s code is duplicated
Found at 0x00DF19D0 and at 0x020CAF80
About 19MB apart in this case.
64 bit iOS builds
Need to be careful with embedded assets, since they will be duplicated in your code
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
ANEs and what you need to know
In App purchases
ANEs
Low Memory Warnings
ANEs
Low Memory ANE:https://github.com/distriqt/ANE-Memory
Application XML
Application XML
Various compilation parameters
Test Flight on iTunes Connect
AppStore review
Application XML
Various compilation parameters
rendermode : direct
depthAndStencil: true
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
AppStore review
http://appreviewtimes.com/
Updating your app
iOS versions with AIR SDK versions & some examples of what could go wrong
Questions?@jav_dev