adobe air for mobile games

14
AIR for a 2D mobile startup James Wrightson Flash Online Conference #11 www.introvertstudios.com

Upload: james-wrightson

Post on 15-Jul-2015

2.029 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Adobe AIR for mobile games

AIR for a 2D mobile startup

James WrightsonFlash Online Conference #11

www.introvertstudios.com

Page 2: Adobe AIR for mobile games

30fps > 60fps

• Always provide the best experience you can offer! 60fps feels better even in puzzle games :)

Page 3: Adobe AIR for mobile games

Who am I?

• James Wrightson, Developer and Technical Director of Introvert Studios

• Using AIR professionally for ~1 year

• Released multiple web & mobile games (Zombie Showdown, Lambi, Invaders…)

Page 4: Adobe AIR for mobile games

Why AIR?• Spoilt for choice

• Stage3D

• Supports the two major platforms I target (Android and iOS)

• AS3 is a good language, not too high, not too low…

• …yet native interfacing via ANE’s!

• Great community and tools

• Rapid release iterations due to the ADB debugger and rapid device deployment

Page 5: Adobe AIR for mobile games

Lambi

Page 6: Adobe AIR for mobile games

whosthatjumpysheep.com

Page 7: Adobe AIR for mobile games

Problems to solve…

Page 8: Adobe AIR for mobile games

CPU/Memory• The AVM2 (that thing that runs your code) has slow memory read/write

• Intrusive Linked lists > Vector.<T> for frame iterative solutions

• Stay away from Math.random(), cache instead (be careful of distribution)

• Inline math operations (such as Vector2D.Normalise)

• Use optimised Sin/Cos functions (2x faster)

• Stay away from virtual calls AT ALL COST

• Pool everything that can be instantiated in game

• [Inline] functions and properties can make it nearly as fast as local access!

Page 9: Adobe AIR for mobile games

GPU• Texture Atlases for everything and plan your

layering ahead of time

• Bake alpha changes into textures and reduce alpha changes (reduces filtrate etc)

• Be aware of over-draw and how to reduce it

• Blend modes…

• Be aware that low draw calls != good performance

Page 10: Adobe AIR for mobile games

Resolution Independence

• Use a Virtual AND Screen viewport

• It is all about the aspect ratio

• Use anchoring to take advantage of wider/narrower screens

Page 11: Adobe AIR for mobile games

Assets• Make asset importing effortless

• Write system scripts to send your assets into the correct folder, clean things you don’t need, zip things up automagically…

• Although ATF’s reduce memory usage (and possibly gain performance), I still choose PNG files due to problems on some Android devices

• MP3 tracks have silence at the start and prevent seamless loops. I use MP3Loop to remove it.

Page 12: Adobe AIR for mobile games

Scene/Levels• Flash CC as a scene editor

A JSFL script to convert all bitmaps into MovieClip linked instances (very important for workflow)

An AS3 script to export the scene into JSON or whatever you like

Code on the client side to parse the scene data and turn it into Stage3D rendered bliss

Page 13: Adobe AIR for mobile games

Conclusion

• AIR is powerful for 2D mobile games

• We need a 2D editor to test changes rapidly

• We need more CPU performance as it’s lagging behind

• Our community is strong and flash is certainly NOT DEAD

Page 14: Adobe AIR for mobile games

• Also please play my game Lambi! http://whosthatjumpysheep.com/ Thank you for listening!