Question how GS renders files ie power of 2...

billpaternobillpaterno Member Posts: 26
edited November -1 in Working with GS (Mac)
Quick question. I see that all art gets rendered to the power of 2 so it makes sense to try and optimize your artwork before coding. However, I am curious if you bring in an image that is not the power of 2, but you scale it in GS to fit that number, will GS reformat the files or are you bloating your app with unnecessary size?

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Like you said, your images use square "container" sizes that are powers of two in GameSalad.

    So if your image is 128x75, GameSalad will reserve a space in memory that can hold a 128x128 image.
    You would get the most "bang" for your buck if you image was 128x128, but this isn't always possible.

    What you want to avoid though, is making your images a little bit higher than the previous power of two...

    For example, if your image was 129x75, GameSalad would now have to reserve a space that can hold a 512x512 image.

    Your images can be any size you want, just be aware of the "container size" that they need.

    the powers of two are:
    2,4,8,16,32,64,128,256,512,1024,2048, etc...
  • billpaternobillpaterno Member Posts: 26
    okay so container size is the raw file size and that is what I should be shooting for as opposed to scaling them in GS, right?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Well, I certainly wouldn't scale your artwork. That is not necessary.
    And it doesn't mean that all of your graphics need to be squares or anything like that.

    Your artwork can be any size - you aren't limited to anything.

    It's just something to be aware of when you're designing your game.

    a graphic that is 129x43 takes up way more memory than a graphic that is 128x43.
    If one of the dimensions of your graphic goes above a power of two, gamesalad will be forced to use the next memory size to hold it. So just try to avoid situations like that. In this case, GS will have to use a 512x512 space in memory to hold the 129x43, whereas the smaller one fits into 128x128.
  • multiplayermultiplayer Member Posts: 30
    are you sure that 129x43 will be 512x512? not 256x64??
  • JGary321JGary321 Member Posts: 1,246
    it would be 256 x 64
  • GamexcbGamexcb Member Posts: 179
    Ok I have this question two if I have an image that is 122X342 and I sized it down to 62X172 in Gamesalad would it work well? Or would it be better to make the image 62X172 outside of Gamesalad?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    oops, i meant to say 256x256.

    but i guess i'm still wrong. i thought the textures mapped to squares, but if rectangles work, that's even better.
  • JGary321JGary321 Member Posts: 1,246
    Gamexcb - The IMAGE would still take up memory = to 128 x 512. The GS Overlords said that ACTOR size does not matter. It's the base image size. So even making the actor 62 x 172 still uses 128 x 512 unless you make change the base image.
  • austinleeaustinlee Member Posts: 19
    What if you'd like to use a large image for a background? Is it bad practice to make an image that is 320x480 to fill up the whole screen?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    That should work fine. It will just use the same amount of memory as an image that is 512x512. The basic idea is that if you can follow the 2 rule without it making your game look weird you should do it to save memory. It does not mean that every single image must follow the rule. Sometimes you just really need an image that falls in the middle of two power of 2 numbers - I say give it a shot and if your game runs smoothly who cares!
Sign In or Register to comment.