Improving Performance Through Images

VmlwebVmlweb Member Posts: 427
edited November -1 in Working with GS (Mac)
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

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Vmlweb, I'd hazard a guess that it's your background images sizes. i'm not sure how it runs at all, as it's recommended to limit individual images to a maximum of 1024 x 1024. There's info here n the wiki:

    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

  • VmlwebVmlweb Member Posts: 427
    You misunderstood

    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?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Vmlweb said:
    You misunderstood

    I often do that...
    Vmlweb said:
    I am creating a TapTap style vertical scroller where levels are around 10000px, yes 10000px high and the background images are 1024px high

    Still unsure what you mean; however, if you mean that you've a 1024 x 1024 image that scrolls to a maximum of around 10000, x or y, that still might have something to do with it, then again it might be the amount/type of rules, actors, etc. Sorry I can't be any more help than that.

    ---------------------------------------------------------------
    Spiral Gyro Games

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • PhoticsPhotics Member Posts: 4,172
    Vmlweb said:
    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?

    I'm finding that large images cripple GameSalad. My next project is incredibly light on image/audio files and I reuse what I can. This has resulted in excellent performance... less than 3 second loading times, quick scene changes, 200+ particles on the screen.

    Also, I try to use PNG-8 over PNG-24.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Images eat up your RAM.

    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.
Sign In or Register to comment.