Problems gave me a solution - Animation optimisation.
matarua
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@
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
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?
Not sure if it will work for your situation but my testing last night was a great success
Cheers, M@