Large Background - Best Practice For Performance

insertcodeinsertcode Member Posts: 8
edited November -1 in Working with GS (Mac)
Hi all.

I'm designing a side landscape iPhone scrolling platform game and I need some advice regarding background image size.

My scene size is 5760 x 960 and I have made one large background image in Photoshop for this. This large image holds all the platforms, pits, etc but will only be used as a non-interactive background. The actual platforms will use invisible actors set to unmovable.

I know that the largest image that you can use in GS is 1024 x 1024 so what would be the most memory efficient way of cutting this image up?

Should I stick with the 1024 x 960 and cut into 6-7 large pieces, or should i cut into many more small pieces that fit exactly into the power of two dimensions? This may mean cutting into 40 pieces or so but if it means a big difference in performance then that's what I'll do. But would more actors used in doing this reduce performance anyway?

I saw in one post that 'firemaplegames' commented on he mentioned that a 1024 x 768 image requires 2.3 MB to display (regardless of its file size). Is there a table somewhere that it shows what memory the other size dimensions require?

Also, should I create one 'background' actor and then copy it across the scene and change the image of each actor?

Any other tips, thoughts would be most helpful and welcome.

Thanks in advance.

Comments

  • insertcodeinsertcode Member Posts: 8
    Can anyone offer any help on this? I'd be very grateful.
  • creativeappscreativeapps Member Posts: 1,770
    yes create one pattern and repeat in background I think its best way to reduce memory.
  • JPickardJPickard Member Posts: 477
    Yeah. I need advice on this exact same issue. Even more so, because I need layers for parallax too.
  • insertcodeinsertcode Member Posts: 8
    Thanks for the response.

    I can't use a pattern and tile it though as the background is different all the way along the map. It's not a 'background' in a traditional sense you see. The 'background' image incorporates the different platforms, lava pits and other design elements for different areas of the level so it can't be the same and tiles all the way along as that would make a really crappy level design ;)

    I incorporated parallax layers too but I've taken them out to save memory until I find the best method for what I need with regards to the background/level artwork.

    Hope this explains it a little better and further help/advice from everyone would be really appreciated...
  • EastboundEastbound Member, BASIC Posts: 1,074
    As long as you don't need Retina support, I'd just place 6-7 pieces. Tile them yourself, sort of.

    If you do need retina support, you're looking at 4x the number of necessary pieces.

    Setting all of these pieces to unmovable and opaque graphics mode will help reduce their impact on speed.
  • insertcodeinsertcode Member Posts: 8
    Why does it have to be different for retina support? I have saved the images at 72dpi and at the dimensions needed to cover the map.

    What extra do I have to do for retina (which I think you mean iPhone 4 for example)?

    Thanks
  • fenix66fenix66 Member Posts: 59
    You can easily find out how much RAM your picture needs from the formula (X*Y*24bit)/8bit
    X,Y picture dimensions , 24bit - color palette , 8bit for 1 byte.
    This equation will give you amount of RAM needed in bytes , if you want kb then you need to divide by 1024 bytes.

    So using this equation , when you have picture 1024x1024 it needs 3072kb in RAM.
  • EastboundEastbound Member, BASIC Posts: 1,074
    insertcode said:
    Why does it have to be different for retina support? I have saved the images at 72dpi and at the dimensions needed to cover the map.

    What extra do I have to do for retina (which I think you mean iPhone 4 for example)?

    Thanks

    The maximum image size you can have for the iDevices is 1024x1024, but for retina display these numbers are halved. So a 1024x1024 background image is contained in a 512x512 actor, otherwise it would be blurry at 1024x1024 on an iPhone 4.

    So without retina your backgrounds can be 1024x1024 in Gamesalad, but if you want to enable retina the max size is essentially 512x512
  • insertcodeinsertcode Member Posts: 8
    @Fenix - Perfect information and precisely what I was after thanks.

    After a little bit of maths and adjustments with the cuts, I calculate that I should be able to reduce the overall RAM requirement for the background images by 20%. That's a huge saving on performance for a little forward planning. Once again, thank you for the insight.

    @Eastbound - Thanks for the info on the retina display. I'm squeezing all I can out of the RAM already I think so for this game retina will have to wait until the hardware can cope. I could try it but it would look crap when it's running at 2 FPS! :)

    Thanks to all who responded...now to get this game nailed down!
Sign In or Register to comment.