Images and RAM
OperationVideoGame
Member Posts: 5
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
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.