Consistent Game Developmentacross all Platforms
Mobile Game Developmentwith
StarlingDaniel Sperl
Daniel Sperl
Austria, 1981 Media Design, 1999
Flox, 2012 Gamua, 2009
Starling, 2011 Sparrow, 2010
Photo Play, 2004
iOS Games & Apps, 2009
Topics
• Starling 1.5
• Development for Mobile Devices:
• Performance
• Screen Resolutions
• Memory
• Outlook
What is Starling?
• A pure AS3 library for Adobe Flash
• Recreates the display list architecture ...
• ... on the GPU (through Stage3D)
• Deploy to:Browser / Desktop / iOS / Android
A very talented bird, if I may say so.
Who uses Starling?
Angry Birds (Rovio) Ruby Blast (Zynga) Incredipede
Nyrthos Infectonator:Survivors
Snailboy
Starling 1.5
Starling 1.5
• Currently Available as Release Candidate
• Includes many internal improvements
• Update highly recommended!
Starling 1.5
• Automatic Profile Selection
• More reliable Context Loss handling
• Significantly reduced Start-up Time
• Atlas Textures support Rotation
• SystemUtil class
• …
Features
Developing for Mobile
• Limited Performance (GPU + CPU)
• Multiple Resolutions
• Limited Memory
Performance
tinyurl.com/starling-performance
Screen Resolutions
tinyurl.com/starling-resolutions
Memory
• Mobile Devices have limited RAM
• Mobile Devices have huge Resolutions
• 2D Games need lots of Textures
Watch your Memory Footprint!
MemoryDo not Embed Textures
// Avoid:![Embed(source=“assets/textures/hero.png")]private static var Hero:Class;!var texture:Texture = Texture.fromBitmap(new Hero());
• Embedded Textures are in Memory twice: Class Memory + Texture Memory
• Better: use Starling's AssetManager
MemoryUse the AssetManager
var appDir:File = File.applicationDirectory;var assets:AssetManager = new AssetManager(); assets.enqueue(appDir.resolvePath("assets/textures"));assets.loadQueue(...);!var texture:Texture = assets.getTexture("hero");
• Takes care of Context Loss
• Optimized for minimal Memory Footprint
MemoryUse RectangleTextures
// init Starling like this:!... = new Starling(Game, stage, null, null, "auto", "auto");
• Standard Textures always allocate MipMaps
• RectangleTextures do not!
• Starling defaults to RectangleTextures with profiles "baseline" + "baselineExtended"
MemoryUse ATF Textures
# Usage example:png2atf -c -r -i texture.png -o texture.atf
• Stored compressed in GPU Memory
• Reduced Image Quality
• Easy to create via Adobe ATF Tools
MemoryUse Bitmap Fonts
assets.enqueue(appDir.resolvePath("assets/fonts"));assets.loadQueue(...);!var tf:TextField = new TextField(200, 80, "Hello World", "My-Font", BitmapFont.NATIVE_SIZE);
• Requires only Memory forFont Texture
• Faster to change text + render
MemoryOptimize your Texture Atlas
• Trim transparent Borders
• Activate Rotation
• Use a Tool like TexturePacker
MemoryUse Adobe Scout
• Analyzes TextureMemory Usage
• Shows every single Object Allocation
MemorySummary
• Use the AssetManager
• Use RectangleTextures (profile: auto)
• Use ATF Textures
• Use Bitmap Fonts
• Optimize your Texture Atlases
• Use Adobe Scout
Outlook
• Ongoing Support by Adobe
• Collaborating with Adoberegarding AIR Priorities
• Collaborating with the Starling Community regarding Starling Priorities
• Flash is not dead™ =)
That's it, folks!
Questions?
Top Related