Johan Peitz - Let's make SOMETHING

13Jul/115

Flash on iOS Devices

Any game developer who hasn't been hiding under a rock the for the last few weeks or so should know that with the latest Air SDK and Flash Builder you can now package your flash games for iOS, Android and Playbook. It has been possible for some time, but it is a lot more streamlined now and with Air 2.7 it is also a lot faster once it's on the phone. It took a while to figure out how apple wants the keys, certificates and whatnots configured when working on Windows, but thanks to google, other blogs and the adobe forum, it eventually worked.

Getting the display list to work as I wanted  with the GPU was a bit of a hassle but now I have a pretty nice pipeline. I can do pretty much anything I want (within reasonable limits) on the iPhone at 30 fps and on the iPad 2 I gat 60 fps. So, lots of performance!

First I wanted to test hop many sprites I could have on screen at the same time so I dusted of my old shooter 194x and ported parts of it. It works really smooth using touch to move the plane to the desired position. And autofire is constantly on. :)

 

Second prototype uses tilemaps and platform physics and for this I used an even older concept only known as "Hodja". I guess the idea behind Hodja is at least 6-7 years old but I never got around implementing it for real. Hodja as some nice history that I might tell in another post. :) Anyway, again really good performance.

For both 194x and Hodja I wanted upscaled pixel graphics.  Scaling bitmaps on the GPU on iOS devices adds a blur which looks like crap when applied to pixelated graphics. I tried and tested many solutions to this but none worked. The current version of the engine scales the graphics up when it is loaded and then moves around it in set increments of pixels, thereby circumventing the blurring completely. There seems to be a small performance cost to this as to traditional blitting, but it is very small.

I hope to finish the Hodja game over the summer. It has a really nice vibe to it.

And some credits: The pixel art for the shooter was created by Arvid Wessman who also helped some with the pixel art for the platformer.

 

Comments (5) Trackbacks (0)
  1. This sounds like a problem with the native code generated by the AIR packager for iPad.
    It’s well possible to change the texture interpolation parameter from LINEAR to NEAREST for OpenGL but I haven’t found any Adobe documentation on how to do that from within the Flash VM.

    • Yeah, that was our impression too. The tech people at adobe’s forum don’t know how to work around it either so I guess I’m stuck with scaling the graphics for now.

  2. Do you have any experience yet with Native Extensions? I’ve been having trouble getting information on the release pipeline on that. I’ve read that that is supposed to theoretically allow things like iOS in-app purchases, GameCenter, and other iOS native code to be exposed to ActionScript. That is the big thing I’d be waiting on. I use Flash CS5.5 currently and have enjoyed building for PlayBook. Too bad the market wasn’t better for PlayBook games. I ported 6 of mine over incredibly easy and have enjoyed using the tablet to play them. Thanks for the info on your experience. Would love to see more details about how you’ve setup your pipeline.

    • I’m afraid I haven’t ventured into extension land yet. I’m hoping someone else will do some great extensions and release them for others to use. At best I don’t want to touch any native code at all.

      But yes, it is a big hurdle. You need all those proper iOS things in your game.

  3. Hey thanks for the response. Yeah that would definitely be nice if there is something released that I could just integrate with. I fear Adobe might lose a bunch of us Flash diehards to Unity if they can’t address this Web/iOS/Android thing soon.


Leave a comment

No trackbacks yet.