how does the image size power of 2 works?
my actor is 60x30 divisible by 2 is =30x15 but i think it should be even numbers? so do my image has to be 60x32 but i also want my image for ipad and iphone 4 and that should be divisible by 4? so will it will be 60x32 =15x8? but again is not even number no more, so what do you recommend my image of 60x30 should be so i can use it for all ipad,iphone 4 and older devices, i am sure this should then apply to the rest of my images?
Comments
You might want to move those numbers up to the next power of 2. But if you don't, that's still kinda close enough. It's not a huge memory loss. If that's your retina display graphics, 64x32 might be a better size because it would scale down better at 32x16 instead of 30x15.
In The Unofficial GameSalad Textbook, I wrote about the huge memory difference between two images...
512x512 and 513x513
Even though it was just one more pixel row horizontally and vertically, it basically quadrupled the memory requirement. So for large images, something like this is important... but for 60x30... it doesn't seem so significant memory wise.
As long as your actors are even number sized then when you double it for RI artwork you will be fine.
I tried to keep most actors powers of two. Like TANK in BOT - the actor size is 64x64. For retina display, the image size is 128x128.
2,4,6,8,16,32,64,128,256,512,1024 etc
It's not 'divisible by 2' it's 'power of 2' as in 2x2x2x2x2 etc...
More efficient memory usage is the result. I believe GS scales images up as far as memory usage is concerned, so if you import a 400px wide image, it will treat it as if it was 512.
Bear in mind that both axis' don't have to be the same. 128x64 or 32x512 is fine. As long as each is a power of 2, you're sorted.
On a side note, try and keep your original art graphics and the actor size as close as possible, as scaling bitmaps will ALWAYS reduce quality, either by pixellating on scale up, or squashing pixels out of existence on scaling down. If i have a 200px wide actor, i'll use a 256px wide image in photoshop, but only use the 200px for my actor as planned, and have some blank space. I can crop that later in GS by changing the tile mode (for collision purposes) and it means i get 1:1 resolution on the artwork, no nasty compression or expansion.
The powers of two thing is a memory optimizing technique. It has nothing to do with RI. NOTHING!!!!!!!
Dont even worry about it if you are not having Performance issues with your Game.
I have only ever had one time where the powers of 2 made a difference in my apps performance and that was on a scene that had 20+ 960x640 images.
Just my 2c
my comments are about power of 2 more so than RI, and I think some of your comments in that last post are incorrect, and i'll leave it at that. By all means PM me if you want to chat more, but the way you are talking about resolution is very misleading, and you cant make assumptions about visual fidelity without any reference at all.