Images and RAM

OperationVideoGameOperationVideoGame Member Posts: 5
edited January 2012 in Tech Support
My entire images folder on my computer for this game is 1.7 MB, but in the GameSalad Viewer they are getting up to 70 MB? This is doing extreme damage to my overall RAM Usage and making my game perform slowly. Any reason why the images are so large?

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    RAM usage is not the same thing as file size.
    Every image that you add to a Scene will increase the RAM usage.

    GameSalad loads everything in as 32-bit textures.

    Which allows 8 bits for red, 8 for green, and 8 for blue. as well as 8 bits for an alpha channel. that is PER PIXEL.

    The basic formula to figure out the RAM is to multiply the number of pixels in an image by 3.

    So if your image is 512x512 pixels, the math would be:

    512 x 512 x 3 = 786432 bytes = 786Kb

    So a 512x512 image will basically use 786Kb of RAM in your game. And if you add another one of those images to the Scene, it will double.
    It has nothing to do with the file size of the image.

    Apple has different algorithms to reduce RAM usage a bit, but that is a pretty safe estimate.
  • ultimaultima Member, PRO Posts: 1,207
    i know you are pretty well versed in performance optimization fire maple, would you care to enlighten us with a few other little tricks of your of optimizing in GS? for examples, behaviors to use over others, or ways of doing things that's more optimal than the usual route... if you have the time that is .
  • Awesome! Thanks for the help. I will start shrinking down my image sizes as well.
Sign In or Register to comment.