file types and sizes
allc1865
Member, PRO Posts: 777
Hi everyone
I'm making some race track images and they need to be pretty big obviously, but I'm already up to 45.5 megabytes with about 5 tracks so far. The track sizes are 2048 x 1536 each. I need them to be smaller but if I go too small then it'll be blurry.
Any help would be appreciated, thanks
Comments
Any specific reason you need to keep the files size so small?
Images that size are going to have some weight to them. 45mb isn't that big of a game file, really. If you're shooting for the 50mb file size for Google, or whoever it is that has that limit, I don't think you are going to meet it with several tracks at 2048x1536
If that's not the issue, then you can go into the several hundred megabyte range with GameSalad, no problem. You have up to 100mb for people to download over a providers network before that shuts off, and requires a local network broadband connection.
Using a 2048 x 1536 pixel image is a very inefficient use of memory, a 2048 x 1536 pixel image takes up a 2048 x 2048 pixel chunk of memory.
@socks, so it takes up more memory?
@SlickZero , gamesalad says they recommend 20mb, but I know that's for the arcade. I just want to make sure I'm not going overboard with the memory and file sizes.
@SlickZero , I wanted them small simply because I was already up to 45.5 megabytes, but if that's ok....
More than what ?
@Socks , you said, " 2048 x 1536 pixel image takes up a 2048 x 2048 pixel chunk of memory." So I'm wondering, does the 2048 x 1536 file size that I have now take up more memory?
Yes, that's right.
Does it take up more memory than what ?
@Socks , oh, ok sorry. Does a 2048 x 1536 take up as much memory as a 2048 x 2048?
But reading your last post I guess a 2048 x 1536 does take up as much as a 2048x2048.
How does it do that? How does gamesalad read each files that you put in there? Does it double the file size?
Let me quote from this very thread:
>
And from a little later on . . .
GameSalad works on the 'power of 2 rule'.
The numbers you want to keep your images at should be:
2,4,8,16,32,64,128,256,512,1024,2048
So you could have a 32x64 image, for example.
Or a 64x512 image.
You get the idea I hope!
The smaller the image, the smaller the amount of memory it uses.
Let's take your example: 2048 x 1536
2048 is fine. It fits in with the recommended numbers.
The 1536 part though is between the recommended 1024 and 2048.
In this case, the memory used will round UP the number 1536 to the next value - 2048.
In this way, your 2048 x 1536 image will take up as much memory as a 2048 x 2048 one.
I think what @socks was trying to say was that it would be better if you could make the 1536 part of your image down to 1024 if possible.
This would save on memory.
You only need to be off the recommended numbers by 1 pixel - for example, a 64x65 image would actually take up 64x128 in memory.
Also, remember that if you're using Retina graphics to have your image size double that of the actor.
If your actor is 64 x 64 in size, you'd need a 128 x 128 image for it. The actor's size stays the same, the image is just double to make it sharp on Retina displays.
Hope that helps!
QS =D
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Start with 1, then double it . . . . so you get 2.
Then double again . . . . so you get 4, and 8, and 16, and 32 . . . and so on.
So we get, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048.
This is how memory is organised, think of these as little cups of milk, if your milk won't fit into a size 32 cup, you will need to use a size 64 cup, and if the milk won't fit into a size 512 cup you will need to use a 1024 size cup.
So . . . . imagine you have 508 units of milk, we can fit that into the 512 size cup, same deal with 509, 510, 511 and 512 . . . all fits into a 512 sized cup, now see what happens when we add just one more unit of milk (so we have 513 units of milk), it overflows, it won't fit into a 512 sized cup, so we need to use a 1024 sized cup.
Not a very efficient use of our cup's volume, nearly half of it is empty.
Or in the real (non-milky) world the smallest chunk of memory your 1536 pixel image will fit into is a 2048 pixel chunk of memory.
So you are using up a 2048 chunk of memory to store only 1536 pixels. (ignore the fact that I am only using one dimension here).
A more efficient use of memory would be: 1024 + 512 (=1536).
Now, let's go 2D !!
2048 * 2048 = 4,194,304
2048 * 1024 = 2,097,152
2048 * 512 = 1,048,576
So, at the moment your large 2048 * 1536 images use up 4,194,304 pixels worth of memory, but the image need only occupy 3,145,728 pixels worth of memory.
I'd split the image into two, a 2048 * 1024 pixel image and a 2048 * 512 pixel image (and position them accordingly), so you get the very same image, but save a load of memory.
Plus - Remember to brush your teeth after you drink your milk before going to bed.
Also: Don't get lost or killed.
QS =D
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
. . . or eaten by monsters.
Thank you guys, @socks and @quantumsheep! This was very helpful information
@SlickZero, thank you!