Improving Performance Through Images
Vmlweb
Member Posts: 427
Hey,
I'm working on a game and I'm having a few lag problems
The levels are 9000px-12000px height because the game scrolls upwards
At the moment when actors go out of view below the camera they delete themselves to improve performance but it's still lagging too much
Would it work if I set every objects image to nothing, then when the camera passes them they change to whatever they're suppose to be, then when the camera moves past it they delete themselves
Would this improve the performance or is it only the number of actors that make it lag?
Thanks,
Vmlweb
I'm working on a game and I'm having a few lag problems
The levels are 9000px-12000px height because the game scrolls upwards
At the moment when actors go out of view below the camera they delete themselves to improve performance but it's still lagging too much
Would it work if I set every objects image to nothing, then when the camera passes them they change to whatever they're suppose to be, then when the camera moves past it they delete themselves
Would this improve the performance or is it only the number of actors that make it lag?
Thanks,
Vmlweb
Comments
http://gamesalad.com/wiki/faqs:game_elements#how_big_can_i_make_my_images
I'm guessing that this refers to iPhone only, and for iPad, the images can be much wider; I'd be surprised if that wasn't the case.
So if you wanted your scrolling background to be 12000 pixels high, it's advisable to split it into 12 images, with Rules to scroll them when needed. Of course though, your max. width would be only 1024, so you're talking about 96 tiles images to make up the background...
Then again if it's a vertical scroller, 9000 pixels background seems extraordinarily wide. I'm wondering if there was a slip of the keyboard here, and you meant 900 (and possibly even 1200?)
---------------------------------------------------------------
Spiral Gyro Games
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I am creating a TapTap style vertical scroller where levels are around 10000px, yes 10000px high and the background images are 1024px high
I needed to know whether images make a big difference to the performance, so if I only tell actors to display their image when the camera is over them would that improve performance?
---------------------------------------------------------------
Spiral Gyro Games
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Also, I try to use PNG-8 over PNG-24.
A 1024x1024 image uses 3MB of RAM to display it.
If you have a stack of 10 1024x1024 images, that's 30MB right there.
Once you add audio, Rules, physics, etc... You're in serious danger of crashing the device.
Plus the engine takes up a huge chunk.
To achieve what you want, you're going to need to do some tricks. Try things like making a smaller set of graphics and using the tiling capabilities of the actors.
Or only use two images and when the camera moves past the bottom one, move it up to the top.
You simply cannot stack that many graphics like that. It isn't a limitation with Gamesalad, but rather the amount of RAM on the device.
Like photics says, you should definitely be saving those images as PNG8, which will decrease the file size, but unfortunately won't reduce the RAM usage.