Optimising for iPhone 3GS
Hey everyone,
My app is almost finished, but I'm noticing that when I test the game through the GS Viewer it will lag, both when connected to GameSalad (fps jumps all one the place, usually 60fps to 30fps, but sometimes down to 19fps) and when played from Recent Games. My project size is 4.0MB and Memory Usage starts at 70MB but creeps up to 80MB. Images are about 30MB.
In the game you control an avatar left to right avoiding falling objects which when they leave the screen are destroyed until you eventually die. I guess maybe one of the things is that everything happens in one scene, but when something isn't needed (the menus) they are destroyed and then respawned when needed.
So yeah, any advice for getting this to run better? I realise that the 3GS is a little weak, but it seems like something aint right. There are a couple of constrain attributes, but I did try and use change attribute behaviours when I could.
My app is almost finished, but I'm noticing that when I test the game through the GS Viewer it will lag, both when connected to GameSalad (fps jumps all one the place, usually 60fps to 30fps, but sometimes down to 19fps) and when played from Recent Games. My project size is 4.0MB and Memory Usage starts at 70MB but creeps up to 80MB. Images are about 30MB.
In the game you control an avatar left to right avoiding falling objects which when they leave the screen are destroyed until you eventually die. I guess maybe one of the things is that everything happens in one scene, but when something isn't needed (the menus) they are destroyed and then respawned when needed.
So yeah, any advice for getting this to run better? I realise that the 3GS is a little weak, but it seems like something aint right. There are a couple of constrain attributes, but I did try and use change attribute behaviours when I could.
Best Answer
-
v00d0 Posts: 143
i'm creating something similar to your project, and on 3gs i reach 30MB, no more. the biggest problem were the animations, now i've max 10 frames for actor and with this i solved the fps problem. then i found, for example, better to divide the background to smaller images; i had a background with buildings; i created three groups of buildings and divided them into 3 images and i saved around 10 MB. then i switched all change image attribute (for scores and things) with change attribute, this save a lot of memory. then try to pass your IMAGES into PNG-Inspector, u can download it for free on the deep blue apps web site.
Answers
My background is just one block image at at 640 x 960, though only 0.02MB in size, but I did want it to animate slightly once or twice a minute so I'll try breaking it up.
PNG-Inspector seems to be a-ok with all my images.
There can be up to 20 objects to avoid on screen at once if that makes a difference. But they don't animate and just head downwards with the move behaviour.
Maybe there is a way that they don't have an image until 450 and that will be better?
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
I'll get on that now and see what happens, but I'm open to any other suggestions on how to trim my app's fat.
I'll try an ad hoc version and breaking up the retina sized background tomorrow to see if that helps.
Looks like I still need some work arounds though.
Darren.
If I make an image at 300 x 300, but then use it on an actor that is 30 x 30 and never make that actor larger am I throwing away RAM? Or is GameSalad smart enough to not do that?
Below is an image of my memory usage. Anything out of the ordinary? What is other?