• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Blitting is slow on the iOS!

Guest
Dec 23, 2010 Dec 23, 2010

Copy link to clipboard

Copied

We decided to go on full scale developing a high quality phone game with Air for phones, after air behaved greatly on the android.

bought an iPod touch 4 (which is similar to iphone 4G except the ram part) to test the engine, being excited to see the boost in performance as flash is running as a byte code on the iOS, I was shocked that it's really slow, slow to the point that it's useless, even with only 10 renders the fps is bad!

I am running this same demo which runs at 30 fps on the android while in iOS it's sliding between 10 - 30.

this is funny after I played infinity blade which has graphics comparable to the PS3!!

I removed ever single variable declaration inside the game loop just in case the garbage collection is doing this, but it still slow.

tried different methods of clearing the drawing canvas even not clearing it but also didn't work.

both gpu and cpu are slow.

so any ideas about this?

don't bother with the graphics in the video, what we're making is something like this which is going to be a great demonstration for Air, and we'll proudly state that we used Air for development, so please help me on this Adobe!

so should try changing the method for rendering (scraping everything I've done for the engine including a world editor), or have faith and keep testing on the android until a faster update for the iOS is released?

even being an android fan boy, iOS is more important than android as google doesn't support publishing/buying on the android market from my region while apple happily does, a release for blackberry playbook is also planned that's in case we don't end up using unity3D which I don't really wanna do.

TOPICS
Development

Views

8.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 10, 2011 Jan 10, 2011

Copy link to clipboard

Copied

Thirded.

I have a Flash game in the AppStore, but feel like I can't consider Flash going forward based on how difficult is was to achieve even baseline performance. Not to mention Retina display support and Game Center integration.

Knowing if/when/how the product might improve would be essential me making a decision to stick with Flash.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

How difficult it really is?

Yesterday I did some performance tests on iPhone 3G and currently I have achieved to have five individually moving and animating sprites (20 frames each) running smoothly and I achieved this in less than two hours. The code is still readable and easy to use and there's only about hundred lines of it...

I can come up with thousands of ideas for games that don't require more than five animated/moving sprites at the same time (for example: almost any puzzle game that doesn't use physics). If you think about best (selling) games for iPhone, you may notice that many of them are rather slow-paced and definetely don't have hundreds of monsters running on the (scrolling) screen all the time.

I agree that there's something really really wrong with the current version of PFI (instead of steadily slowing down with more moving objects - that I would understand - I'm rather facing issues with weird twitching), but still you can create complete games in matter of days and release them for Android, iPhone and web by just simply changing the size of graphics. OR forget about the Flash and program your games with objective c then port it to Java and then port it to html 5.

If you still think that the first option could be better here's few performance tips:

- Start extending Bitmap class (and completely forget Sprites and MovieClips) by creating an animation system based on swapping Bitmapdata (create some method to break down bitmap sheets containing animation to individual frames and store them to Vector as BitmapData objects then pass this vector to your extended bitmap and use bitmapData = myBMDVector[frameN])

- In your extended Bitmap class don't use any event listeners to do animation or anything else, instead use only one enter frame event in your project and let that handle animation, movement and collision detection of your game objects

- If you want to use your extended bitmap as button, create click or tap event handler to your main game logic class and in your extended bitmap class create method that uses hitTestPoint to find out if user clicked your button.

- Generally write optimized code, if you don't know how, here's few tips (check out other links in the article too): http://www.nbilyk.com/optimizing-actionscript-3

- Avoid creating new instances or removing old ones on the fly (instead use object pooling if needed)

- Avoid using lots of event listeners

- scrollRect is too slow, don't use that

Still I agree that there's something really messed up in the current version of PFI and I sincerely hope that people on Adobe are doing their best to fix this as soon as possbile, but in the meanwhile - instead of whining - I hope that people would experiment with PFI and  share their discoveries so that we can start making games now instead of  waiting for something better to come in uncertain future.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

Again writing elaborate workarounds, extending the bitmap class etc are all well and good, but they are what they are, workarounds! You are swimming against the tide!

Of course you can come up with simpler apps, but more often than not most Flash to Iphone conversions are going to be Online games Ported to the Iphone, with an existing gameplay and set of graphics..

like your game: http://www.pandarampage.com/

- its rather unlikely that any workaround you can do on any versions of the Iphone would make our game work...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

I'd recommend you guys apply to join the AIR pre-release program, it sounds life both sides could benefit from the tests you are running:

https://www.adobe.com/cfusion/mmform/index.cfm?name=prerelease_interest

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 20, 2011 Jan 20, 2011

Copy link to clipboard

Copied

Greetings fellow Flash Developers!

My name is Ross Przybylski, manager of D20Studios, LLC and creator of the Flash multiplayer game Hero Mages.  Currently I am working to port my game to mobile platforms including Android, iPhone, and iPad and have been working the past 3 months to discover the best cross-platform technique for rendering sprite animations on these platforms.

I wanted to invite all of you to join in our conversation on Kirupa forums: http://www.kirupa.com/forum/showthread.php?p=2594775&posted=1#post2594775 where we are discussing this issue as well.

In particular, I'd love to hear more from Ammar about the solution he's been working on.  If I gather correctly, you are storing your animation frames as bitmapData and then using bitmap.bitmapData = frameBitmapData to blit the model animation, while the actual sprites are contained in clips and moved upon the stage using regular x/y properties.  How are initially storing your model as bitmapData?  Do you have a single sprite sheet or is it a movieclip vector timeline animation that you precache in an array or object at runtime?  If you have an example FLA I could take a look at, that would be extremlely helpful!

Again, I encourage others to join us on Kirupa.  Another forum user, tbo, posted some simple code experiments to test the rendering methods and I have posted these as ZIPs as well as the results for Android and iPad devices.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines