hey guys, I was just wondering how important image sizes are? do I have to follow the powers of 2 rule or is that only if my game is really huge? Thanks. SM
Optimising your image sizes to make them as small as possible while still making sense to how your game looks - that can make a big difference to your RAM usage. Especially if you have a lot of images in one scene.
So when designing your objects and characters, it's a good idea to keep the power of 2 sizes in mind. So 2,4,8,16,32,64,128 etc
So if your character looks great at 72x72, see if you can make it 64x64 instead as this will use up less RAM
Having a lot of full screen images in one scene will eat your RAM. If it makes sense to your game, using small images is better for optimisation reasons.
--- Get Honey Tribe on iTunes "...a touch above the rest in the endless running genre" 148apps.com "Honey Tribe: Colony Collapse is not only a remarkably endearing little game, but it's also incredibly addictive." Pocket Gamer "If you’re a nature lover, or simply a lover of well-executed games, Honey Tribe is worth checking out. Download it today." AppAdvice.com Say hi on Twitter Like us on Facebook www.HoneyTribeStudios.com
so do I use, 72 dpi for the iphone 4 and ipad as well? what if the image is set at something higher like 300 dpi because I didn't know how to change it when I drew it but do now?
Images must be at 72 DPI. Without Resolution Independence checked, the image sizes must be in the powers of 2. With Resolution Independence checked, the image sizes must be in the powers of 4.
SAMman said: so do I use, 72 dpi for the iphone 4 and ipad as well? what if the image is set at something higher like 300 dpi because I didn't know how to change it when I drew it but do now?
72 DPI is for all images. If the DPI is higher than that, simply open up the image in Preview, click Tools, and click Adjust Size. Change the DPI there,
If not in the powers of 2 or 4, the images will appear blurry. If not 72 DPI, the image will be even more blurry and it won't be the correct size. If you follow what's been given above, you'll get much clearer images.
Power of 2 Rules Memory is a precious resource on the iPhone and iPad. The less memory used, the better your game performs - kinda obvious.
The iPhone and iPad utilize a shared memory system, which means that the GPU does not have its own memory; rather, it uses up some of the main system memory for storing textures. The memory limitations are even more obvious on older iPhones, iPod touch, and iPhone 3G devices that were limited to 128MB of memory. Aggravating the memory constraints is the padding of images to texture with power-of-two sizes in their length and width. The GPU inside older versions of the iPhone and iPod can store textures internally only in power-of-two sizes.
The iPhone 3GS, iPhone 4, and iPad (1 and 2) can use non–power-of-two textures, doing so comes with a significant performance penalty. To understand what the power-of-two size and texture padding means, here is a quick example. Take any drawing tool, and draw a square. Set the height and width as 256, to represent a 256 × 256 pixel texture. Now draw another square, this time 129 × 129 pixels in size, just slightly over half the height and half the width. The smaller square will represent your 129 × 129 pixel image stored as a 256 × 256 texture. Look at the drawing: about three-quarters of the texture space is empty space, and thus wasted! In other words the device has to manually pad your sprite out to 256x256 on the fly, and THEN it uses the extra memory too. Not good.
The illustration below shows a 129 × 129 pixel sprite inside of a 256 × 256 texture. Regardless of the bit depth of your images (8, 16 or 24), only about one-quarter of the memory this image is using is actually utilized to display anything—the rest is wasted. In other words, all the transparent space around your sprites use memory up.
Example of wasted memory: a 129 × 129 pixel image padded out to 256 × 256
Applying the Power of 2 rule is crucial to achieving maximum performance.
Even sided Sprites. Another less obvious rule is always ensure your sprites are even sized, ie 97 x 69 could result in blurry images or images that appear less sharp. Always round your images up to the next even value ie: 98 x 70, though 128 x 128 in this example would be better.
Resolution. All your Sprites and Images should be 72dpi.
tenrdrmerMember, Sous Chef, Senior Sous-ChefPosts: 9,934
Also Since this is not just a powers of 2 thread. Lets not forget, if you want to use retina display graphics. All you have to do is make your actor size an even number and then double those dimensions when creating your artwork. If your actor size is even when you double it the dimensions WILL be divisible by 4 every single time.
Comments
So when designing your objects and characters, it's a good idea to keep the power of 2 sizes in mind. So 2,4,8,16,32,64,128 etc
So if your character looks great at 72x72, see if you can make it 64x64 instead as this will use up less RAM
Having a lot of full screen images in one scene will eat your RAM. If it makes sense to your game, using small images is better for optimisation reasons.
---
Get Honey Tribe on iTunes
"...a touch above the rest in the endless running genre" 148apps.com
"Honey Tribe: Colony Collapse is not only a remarkably endearing little game, but it's also incredibly addictive." Pocket Gamer
"If you’re a nature lover, or simply a lover of well-executed games, Honey Tribe is worth checking out. Download it today." AppAdvice.com
Say hi on Twitter
Like us on Facebook
www.HoneyTribeStudios.com
SM
Memory is a precious resource on the iPhone and iPad. The less memory used, the better your game performs - kinda obvious.
The iPhone and iPad utilize a shared memory system, which means that the GPU does not have its own memory; rather, it uses up some of the main system memory for storing textures. The memory limitations are even more obvious on older iPhones, iPod touch, and iPhone 3G devices that were limited to 128MB of memory. Aggravating the memory constraints is the padding of images to texture with power-of-two sizes in their length and width. The GPU inside older versions of the iPhone and iPod can store textures internally only in power-of-two sizes.
The iPhone 3GS, iPhone 4, and iPad (1 and 2) can use non–power-of-two textures, doing so comes with a significant performance penalty. To understand what the power-of-two size and texture padding means, here is a quick example. Take any drawing tool, and draw a square. Set the height and width as 256, to represent a 256 × 256 pixel texture. Now draw another square, this time 129 × 129 pixels in size, just slightly over half the height and half the width. The smaller square will represent your 129 × 129 pixel image stored as a 256 × 256 texture. Look at the drawing: about three-quarters of the texture space is empty space, and thus wasted! In other words the device has to manually pad your sprite out to 256x256 on the fly, and THEN it uses the extra memory too. Not good.
The illustration below shows a 129 × 129 pixel sprite inside of a 256 × 256 texture. Regardless of the bit depth of your images (8, 16 or 24), only about one-quarter of the memory this image is using is actually utilized to display anything—the rest is wasted. In other words, all the transparent space around your sprites use memory up.
Example of wasted memory: a 129 × 129 pixel image padded out to 256 × 256
Applying the Power of 2 rule is crucial to achieving maximum performance.
Even sided Sprites.
Another less obvious rule is always ensure your sprites are even sized, ie 97 x 69 could result in blurry images or images that appear less sharp. Always round your images up to the next even value ie: 98 x 70, though 128 x 128 in this example would be better.
Resolution.
All your Sprites and Images should be 72dpi.
That is honestly the best explanation of the powers of 2 I have ever seen.
I fully understand it. But have never been able to convey it in such an easily understandable way to others.