A General Question

thomasrichardgamesthomasrichardgames Member Posts: 263
edited November -1 in Working with GS (Mac)
hi, i heard that all the actors in the scene need to be divisible by 4. Is this correct. Therefore, would i have to change all my little blocks from a (height - 45) and (width - 57) to something that is divisible by 4. Thanks.

Comments

  • jb15jb15 Member Posts: 602
    There is a lot of misinformation going around in the forums re. graphics. From what I understand (and what works for me) is that all graphics have to be divisible by 2. 2, 4, 6, 8, etc.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    The image that you import into GameSalad needs to be divisible by 2. But it also has to be divisible by 2 again when you divide it by 2. So an image that is 26x26 will look blurry because half of that is 13x13 which is not divisible by 2. 32x32 will work because it's 16x16 divided by 2, and can be divided by 2 again. and again.

    And once the image is imported into GameSalad, you can make it any size you want on the stage after that, doesn't have to be divisible by 2.
  • DizkoDizko Member Posts: 498
    Your best practice will be to try your best to stick to power of two sizes. This applies universally to all real-time engine systems. Using power of two textures is much more memory efficient than simply adhering to even numbered sizes. However, if you must use a non-power of two image than sticking to SlickZero's rules will work.

    Power of two sizes:
    1024
    512
    256
    128
    64
    32
    16
    8
    4

    Also note that you don't have to make square images, you can do rectangles like a 256x512 image for example would be perfectly acceptable.

    If you want to know why it is important, this is a pretty good read on it.
    http://www.katsbits.com/tutorials/textures/make-better-textures-correct-size-and-power-of-two.php

    Long story short, computer systems (including the iPhone) are built around the power-of-two idea. Think about the storage size, 8gigs, 16gigs, 32gigs, all power of two. The memory sizes of the iPhone 128gigs, 256gigs, 512gigs.... all powers of two. Basically, when you make your images power of two, they fit nicely into the memory and therefore are much more efficient.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Divisible by 4 is for image file dimensions If you are using Resolution Independence. the best way to achieve this is make all of your actors an even number (ie. Divisible by two) and the make the artwork exactly double those dimensions.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Disko the Powers of 2 is a memory management issue. and the divisible by 4 thing is a proper viewing issue. really not related.

    And making the images powers of 2 do not improve performance. Its just a way to know what level of memory you are using. ie. If your image is 260x260 it is using the memory of 512x512 so you have 2 options. You can create your image size at 512x512 and get a higher resolution. with no added memory losses or you can drop your art down to 256x256 and save a little memory. But simply making your artwork a power of 2 does not get you any gains in memory performance, you have to use it to your advantage to get the desired result.
  • DizkoDizko Member Posts: 498
    tenrdrmer said:
    Disko the Powers of 2 is a memory management issue. and the divisible by 4 thing is a proper viewing issue. really not related.

    And making the images powers of 2 do not improve performance. Its just a way to know what level of memory you are using. ie. If your image is 260x260 it is using the memory of 512x512 so you have 2 options. You can create your image size at 512x512 and get a higher resolution. with no added memory losses or you can drop your art down to 256x256 and save a little memory. But simply making your artwork a power of 2 does not get you any gains in memory performance, you have to use it to your advantage to get the desired result.

    By using power of two textures you're in the clear for RI without any afterthought. There is little to no benefit to deviate from that rule. I would only do so if absolutely necessary.

    Suggesting that memory management isn't related to performance is a bit misleading too. Of course memory management is related to performance. Perhaps it doesn't translate all that much into raw FPS but it certainly will effect load times, potential crashing issues etc etc.

    When you think about performance you really ought not just to think about the raw FPS. You have to consider everything and using memory effectively, should be one of those.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I never said anything about performance or FPS. I Said "Proper Viewing" The reason thats all it has to do with is if its not divisible by 4 the image may appear blurry depending on placement.

    And Why on earth would you limit your game to only 10 possible dimensions. The only time I would bother with powers of 2 is for images over 256pixels and not much over.

    Dont get hung up an limit your game over very small memory increases. Which they are very small on the lower end of the scale. And even then make your art the size you want it to be to look right and work for your game. then adjust the image if it can be done without sacrificing what you are going for. If you image is 260x260 you can prob make your actor slightly smaller and resize the image to 256x256 and your good. But if your final image comes out at 400x400 and thats what looks right don't sacrifice the look of your game by changing it to 256x256 for a memory increase. the Powers of 2 is a tool you can use to optimize your game. I would never start the game and Say ok we gotta make every things dimensions one of these 10 sizes. You'll be so hung on the dimensions of everything you wont be able to do what you want and you will likely never be happy with your game.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    uptimistik said:
    Well said tenrdrmer....

    +1
  • DizkoDizko Member Posts: 498
    tenrdrmer said:
    I never said anything about performance or FPS. I Said "Proper Viewing" The reason thats all it has to do with is if its not divisible by 4 the image may appear blurry depending on placement.

    And Why on earth would you limit your game to only 10 possible dimensions. The only time I would bother with powers of 2 is for images over 256pixels and not much over.

    Dont get hung up an limit your game over very small memory increases. Which they are very small on the lower end of the scale. And even then make your art the size you want it to be to look right and work for your game. then adjust the image if it can be done without sacrificing what you are going for. If you image is 260x260 you can prob make your actor slightly smaller and resize the image to 256x256 and your good. But if your final image comes out at 400x400 and thats what looks right don't sacrifice the look of your game by changing it to 256x256 for a memory increase. the Powers of 2 is a tool you can use to optimize your game. I would never start the game and Say ok we gotta make every things dimensions one of these 10 sizes. You'll be so hung on the dimensions of everything you wont be able to do what you want and you will likely never be happy with your game.

    I appreciate your passion but I don't understand it. I never said it was an absolute, you're suggesting that I did, you seem to be arguing for the sake of it. It's also not just 10 dimensions, you can use power of two using rectangle sizes as well.

    For example, you can have
    128x1024 or 512x64 or 32x256 etc etc

    Again, I do not understand you vigor on the subject as it seems to be irrelevant. If you need to use something other than a power of two, then by all means, like.. I said before. But you really should try to get into the practice of using them, more so if you ever plan to go beyond GS.
Sign In or Register to comment.