Problems gave me a solution - Animation optimisation.

mataruamatarua Auckland, New ZealandMember Posts: 854
So with iOS7 my working on it 'current' app was crashing on iOS 7 in the viewer and adhoc. I was doing some stage animations - 4 of them and they had 27 frames each.

The frames were 320 square. So 108 frames at 640 x 640 retina display resolution - that made a whopping 350MB of memory usage with png24, came down to 230MB with png8.

They are simple images not more than a few KB each. Complete image library only 900 kb on disk.

230MB was still too much memory use and causing frame rate issues.

Solution was to cut 75% frames. Not really happy. But game is running fine at 60FPS at around 70MB memory use.

Keep in mind it runs fine on iOS6 with everything in there, 108 frames, and best retina quality. With iOS7 it does not. I have logged this with GameSalad.

So...

I had an idea to crop the images perhaps, and see if the animation would place them centered. It did not, it scaled them.

So I played with options and saw 'fixed' meant that the image goes pixel for pixel size - ignores retina display type scaling - ah, I thought. So I halved all the images and bam - I could go back to the full 108 frames going smoothly with this method and it only takes up less than 30MB of memory now. 10% of what it was originally.

It's lower resolution for the frames but they animate fast anyway and it is not that noticeable over the high res version. I am very pedantic about graphic quality so if it was bad I would not go there. It worked perfectly for my simple graphics. But more detailed things might have issues. So users call on this.

A win out of a lot of crashes and testing I think. Faster load. Less memory load.

Thought I would share. I am sure a lot know this already but it's a way to optimise for smaller animations.

Cheers, M@

Comments

  • 1LuVP4nc4k3S1LuVP4nc4k3S Member Posts: 62
    Hi there. I literally just posted a question about optimising my game - this may help me a lot, who knows!

    Just want to understand it properly first. Are you saying that you kept all the frames you had originally (108 frames) but what do you mean you halved them? Do you mean you halved the resolution size? So instead of 320 square you went for 160 square?
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    @1LuVP4nc4k3S Yep - kept all 108 frames - first images size 320 to 160 square - then I cropped all the dead space of the 26 frames leaving the 27th frame full size. I could do this because my animation is a zooming animation like this > .oO (centered of course) - so I end up with images that are all different sizes but they are centered in the animation and play smoothly. It worked for me and saved me 90% memory usage.

    Not sure if it will work for your situation but my testing last night was a great success :)
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    @1LuVP4nc4k3S here is what it looks like from a screen capture - retina display outside and the low def version which is animating inside. It moves pretty fast zooming so you don't really notice it too much. It would not be suitable for everything but definitely smooth things like glows or clouds or mist it would be fine.

    image

    Cheers, M@
  • Ali_WoodAli_Wood Member Posts: 52
    Sorry i may be a little dense here but where did you find this "centered" option?! Was this in Photoshop or in GameSalad itself?? This could prove really useful
Sign In or Register to comment.