@DreamWorld: Use it as a rule of thumb, and try to get your images as close as possible to the power of 2, but so long as you've optimized your game in other areas, you don't always have to follow it.
Your image that is 220x354 will run in the game memory as if it were 256x512. You don't have to use a 256x512...but your game is using that much memory regardless. Its a matter of getting the most "bang for your buck" rather than a rule. So if your image were 258x258...it would actually use 4 times as much memory because it exceeds 256. So it would be using memory for a 512x512 image (4 - 256px tiles). In this case...it would be wise to cut the 2 pixels off of the size and take back some of that memory.
An example of a hard fast rule would be to always size your images as an even number. This way you won't have the image land on a half pixel (there will always be an equal amount of image on both sides of center). Landing on a half pixel in the layout can cause the image to blur.
Does this apply to game objects too? So like if your image is 64x64 but then on the scene it is enlarged to 70x70. Will that use 128x128 worth of memory still?
Or what about the opposite, if the image resolution is not power of 2, but in the scene it's scaled so that it is.
By the way, if I am not mistaken you apply this rule IN YOUR IMAGE EDITING SOFTWARE.
i.e. make your image 256 x 256 in photoshop.....then you can resize in GS without sacrificing memory.
tenrdrmerMember, Sous Chef, Senior Sous-ChefPosts: 9,934
DreamWorld said: So I have a tank image which is 220x354 what resolution should it be?
That will use the same memory as an image 256x512 you do not have to increase it to that. The only way to save any memory will be to reduce the image to 128x256 which likely isint worth it since you would be drastically reducing your actors size.
patm1982 said: Does this apply to game objects too? So like if your image is 64x64 but then on the scene it is enlarged to 70x70. Will that use 128x128 worth of memory still?
Or what about the opposite, if the image resolution is not power of 2, but in the scene it's scaled so that it is.
No that will use the memory of a 64x64 image however your image will be stretched and probably blurred slightly.
Dont worry about the power of 2 thing two much. Its just something you can fall back on to help improve performance if you end with memory issues.
You should however have all even sized actors and then double sized art work for those actors if you are going to use resolution independence.
As a follow up on this question. Does GS take need more memory if I have for example a PNG with 320X64px with a lot of transparency in it and an actual image of 64x64px then when I use a PNG that is just 64x64. In other words, does transparency use memory? I ask this because it is sometimes easier to line up images.
tenrdrmerMember, Sous Chef, Senior Sous-ChefPosts: 9,934
yes transparency uses memory. if you place an image it will use the memory allotted for any color image that matches the full dimensions of the image file.
Comments
So they should be 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024
This helps optimize memory.
So if you have an image that is 68X68, round it down to the nearest power of 2 to preserve memory.
hope this helps!
Your image that is 220x354 will run in the game memory as if it were 256x512. You don't have to use a 256x512...but your game is using that much memory regardless. Its a matter of getting the most "bang for your buck" rather than a rule. So if your image were 258x258...it would actually use 4 times as much memory because it exceeds 256. So it would be using memory for a 512x512 image (4 - 256px tiles). In this case...it would be wise to cut the 2 pixels off of the size and take back some of that memory.
An example of a hard fast rule would be to always size your images as an even number. This way you won't have the image land on a half pixel (there will always be an equal amount of image on both sides of center). Landing on a half pixel in the layout can cause the image to blur.
Or what about the opposite, if the image resolution is not power of 2, but in the scene it's scaled so that it is.
i.e. make your image 256 x 256 in photoshop.....then you can resize in GS without sacrificing memory.
Dont worry about the power of 2 thing two much. Its just something you can fall back on to help improve performance if you end with memory issues.
You should however have all even sized actors and then double sized art work for those actors if you are going to use resolution independence.
Does GS take need more memory if I have for example a PNG with 320X64px with a lot of transparency in it and an actual image of 64x64px then when I use a PNG that is just 64x64. In other words, does transparency use memory?
I ask this because it is sometimes easier to line up images.
Lump Apps and My Assets
Lump Apps and My Assets