Retina and Performance

expired_012expired_012 Member Posts: 1,802
edited November -1 in Working with GS (Mac)
Could someone please explain to me what the power of two and divisibility by four is all about...Really wanna get retina display right this time around as well as great performace

Is it a good idea or bad idea to leave RI unchecked and just simply scale up your imgs?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi artonskyblue; as I understand it: power of two is about making sure all of your graphics dimensions are divisible by 2, whether or not you're using Resolution independence.

    If you enable Resolution Independence in GS, you make your graphics twice the size (or rather same size, double the ppi, i.e 144) as those for pre-iPhone4. Then the iPhone4 will display your graphics at the size you want but higher resolution; any before that will still be the correct size but displayed at a resolution of the usual 72ppi.

    I've not tested out Resolution Independence within GS; so possibly it might not like image size you want/144dpi even though that is the same as double the size you want/72ppi; a quick experiment would solve that as to which one GS accepts (possibly both).
    artonskyblue said:
    Is it a good idea or bad idea to leave RI unchecked and just simply scale up your imgs?

    A bad idea; if you are not enabling Resolution Independence in GS, than bring in your images into GS the size you want, at a resolution of 72dpi as usual.

    hope that cleared it a bit for you. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • expired_012expired_012 Member Posts: 1,802
    Thanks guys!

    So say I have a 120x120 image, and the actor that will be using that image is 60x60. You're saying its a bad idea to insert the image into GS as 120x120 and drag it in to the 60x60 actor, and leave RI unchecked? Wouldn't that image be displayed as high res?

    So instead I should just scale down the 120x120 image to 60x60, bring it into GS, check RI, and then the image will be displayed as high res (120x120) on retina supported devices and normal size (60x60) on older devices?

    Sorry for being so specific, I just really want to fully understand how this all works
  • UtopianGamesUtopianGames Member Posts: 5,692
    If i had a 120x120 image i would make a 60x60 actor drag it in and leave RI checked (on).

    With RI on it should display the 60x60 image on older devices and the 120x120 on new devices capable of retina.

    Darren.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    artonskyblue said:
    Thanks guys!

    So say I have a 120x120 image, and the actor that will be using that image is 60x60. You're saying its a bad idea to insert the image into GS as 120x120 and drag it in to the 60x60 actor, and leave RI unchecked? Wouldn't that image be displayed as high res?

    So instead I should just scale down the 120x120 image to 60x60, bring it into GS, check RI, and then the image will be displayed as high res (120x120) on retina supported devices and normal size (60x60) on older devices?

    Sorry for being so specific, I just really want to fully understand how this all works

    You're a bit tangled there! OK:

    Choice 1: you want your game to run, lets say, on an iPhone 3GS, which will also run on an iPhone4. But you're not fussed about taking advantage of the iPhone's higher resolution, displayed on it's new, sooper-dooper Retina Display. This is like you're making a game, like you've always done with GS, and as if the iPhone4 DIDN'T have the capability of a higher resolution than those that go before it. with this choice, you simply ignore "Enable Resolution Independence" on the GS Project page, i.e leave it unchecked. Then bring in your graphics to the size you want, again as you've always done, the size you see is the size you get, 72ppi.

    Choice 2: again you want your game to run on all the iPhones, past and present but you want to take advantage of the higher resolution images that can be displayed on the iPhone4. With this choice, check Enable Resolution Independence on the Project Editor page, but bring in your images at twice the size as you want, at 72ppi.

    The rest is done for you, automatically, depending on which phone is being used. If it's a pre-4 one, it'll halve the size of your doubled images, making them the size you want, and ignore any resolution info; be seen as 72ppi.

    On the iPhone4, the resolution will automatically be doubled, so halving the size of your images, also to the size you want, but show on the Retina display at a better resolution.

    hope that's made it clearer for you. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • expired_012expired_012 Member Posts: 1,802
    Thanks to everyone, that definitely cleared some things up

    One more thing: How bad is checking RI in terms of memory usage and project file size, whats the impact of it?
  • UtopianGamesUtopianGames Member Posts: 5,692
    Not sure but i got RW under 20 mb and it has a lot of content.

    Darren.
  • FranzKellerFranzKeller Member Posts: 517
    this is confusing me ;-)
    I tried starting two new apps, one with RI unchecked, and one checked -
    under device > Screen > size both register as 420 x 580?

    is that the size I should make my background at for this to work?

    another question - will the larger images be used if the app is run on an iPad?

    As an iPad user myself, I'd like to support the greatest number of possible systems for my new apps.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    The power of two thing is a memory useage issue. nothing to do with RI or blurry art.

    The multiple of 4 is an RI thing. which stems from the even number thing for non-ri

    Standard Res to avoid blurry images all you need to do is even numbers that way if it lands on half a pixel it doesnt split a pixel and make it blurry.

    Resolution independence requires a double sized image so you want your actor to be a multiple of four so when high res is displayed you don't get a pixel split in to making your art blurry.
    Remember your actor needs to be a multiple of 4 then double the size. if you make your art a multiple of four and then half it for the actor it is possible to end up with an actor that is not a multiple of 4.

    Now Power of 2 is a whole different beast.
    First for example i'll list some powers of two.: 2,4,16,32,64,128,256,512
    Now what the power of 2 for art size does is determine how much memory is used for an image.
    64x64 is the largest image size you can use for that determined memory size. but 60x60 will use the same and 68x68 will use the same memory as 128x128

    This is solely a performance thing nothing to do with display quality like the multiple of four is for RI.
    Im my example it would be advantageous to reduce the art and actor to fit a 64x64 size as opposed to leaving it 68x68 you are technically cutting the memory usage in half for that image. so if you have a bunch of them you could actually improve performance for a barley noticeable change in actor/image size.

    I hopt that helps people understand this a little better.
  • dunkelgeistdunkelgeist Member Posts: 68
    tenrdrmer said:
    The power of two thing is a memory useage issue. nothing to do with RI or blurry art.

    The multiple of 4 is an RI thing. which stems from the even number thing for non-ri

    Standard Res to avoid blurry images all you need to do is even numbers that way if it lands on half a pixel it doesnt split a pixel and make it blurry.

    Resolution independence requires a double sized image so you want your actor to be a multiple of four so when high res is displayed you don't get a pixel split in to making your art blurry.
    Remember your actor needs to be a multiple of 4 then double the size. if you make your art a multiple of four and then half it for the actor it is possible to end up with an actor that is not a multiple of 4.

    Now Power of 2 is a whole different beast.
    First for example i'll list some powers of two.: 2,4,16,32,64,128,256,512
    Now what the power of 2 for art size does is determine how much memory is used for an image.
    64x64 is the largest image size you can use for that determined memory size. but 60x60 will use the same and 68x68 will use the same memory as 128x128

    This is solely a performance thing nothing to do with display quality like the multiple of four is for RI.
    Im my example it would be advantageous to reduce the art and actor to fit a 64x64 size as opposed to leaving it 68x68 you are technically cutting the memory usage in half for that image. so if you have a bunch of them you could actually improve performance for a barley noticeable change in actor/image size.

    I hopt that helps people understand this a little better.

    Nice! Thanks for your wisdom.
  • FranzKellerFranzKeller Member Posts: 517
    as often, the GS manual is not up to date either.

    So many user questions could be solved by better documentation
  • PhoticsPhotics Member Posts: 4,172
    FranzKeller said:
    as often, the GS manual is not up to date either.

    So many user questions could be solved by better documentation

    Well, there is a textbook out there. :)
  • Fodder76Fodder76 Member Posts: 154
    So even for fullscreen images, (for example, the full resolution of 960 x 480 for the iPhone 4) would be better created as a 1024 x 512?
  • SparkyidrSparkyidr Member Posts: 2,033
    Fodder76 said:
    So even for fullscreen images, (for example, the full resolution of 960 x 480 for the iPhone 4) would be better created as a 1024 x 512?

    not better as such.. but both images with use the same amount of memory, even though one of them is smaller.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Fodder76 said:
    So even for fullscreen images, (for example, the full resolution of 960 x 480 for the iPhone 4) would be better created as a 1024 x 512?

    If the aspect ratio is the same it would be wise to create your art that size and then scale for iphone version but I would assume the aspect ratio is not exact the same. i've never made an ipad game so I haven't really looked into it
  • FranzKellerFranzKeller Member Posts: 517
    I've heard about the textbook. ;-) And it's good that SOMEONE wrote it...

    so assuming that i am starting my app as "iPhone portrait",
    should my graphics be 420 x 580, or twice that?

    (I'm making the entire interface, which will fill the screen, in PS and AI beforehand.)
    tenrdrmer said:
    If the aspect ratio is the same it would be wise to create your art that size and then scale for iphone version but I would assume the aspect ratio is not exact the same. i've never made an ipad game so I haven't really looked into it

    The aspect ratio IS slightly different, so some space is wasted on the iPad screen when running iPhone games, but not much. Unless you want to $ell two versions, I think to just make one universal app for all.
  • Fodder76Fodder76 Member Posts: 154
    The aspect ratio for the iPhone4 and older iPhones is definitely the same, but the aspect ratio for the iPad is not the same.

    I wasn't really factoring in the iPad in my question above.

    With my fullscreen images at 960x480, I haven't noticed any performance or memory problems, but I have noticed that the images are compressed a fair amount with noticeable banding. That's definitely something I want to get rid of, and I wasn't sure if the dimensions I have the image at is the cause or not.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    FranzKeller said:
    I've heard about the textbook. ;-) And it's good that SOMEONE wrote it...

    so assuming that i am starting my app as "iPhone portrait",
    should my graphics be 420 x 580, or twice that?

    (I'm making the entire interface, which will fill the screen, in PS and AI beforehand.)

    The aspect ratio IS slightly different, so some space is wasted on the iPad screen when running iPhone games, but not much. Unless you want to $ell two versions, I think to just make one universal app for all.

    Iphone screen size is 480x320 not 480x520. If you what to do high res then yes you need to do twice that. so 960x640 and you cannot make a universal app with GS although some have installed high res versions on ipads and it does fill it up pretty decent. It will not be listed as a universal app so if you want to tap the ipad market you will have to make a separate app.
  • FranzKellerFranzKeller Member Posts: 517
    Okay, thanks. That is as I originally thought...
    I'm going to do 640 x 960 landscape from this point.

    But why does it say 420 x 580 in "Game Salad Creator"
    Under Game / Devices / Screen / Size I wonder?

    I guess that technically a "universal app" is one that automatically adjusts to either device, eh?

    What I meant was the fact that "iPhone" apps work perfectly well on iPad, but not vice versa.

    (So, do iPhone4 apps run at full retina resolution on an iPad, btw?)

    ha, all this is STILL much easier than dealing with a million semi-compatible windows machines. ;-)
    tenrdrmer said:
    Iphone screen size is 480x320 not 480x520. If you what to do high res then yes you need to do twice that. so 960x640 and you cannot make a universal app with GS although some have installed high res versions on ipads and it does fill it up pretty decent. It will not be listed as a universal app so if you want to tap the ipad market you will have to make a separate app.

  • gurechangurechan Member, PRO Posts: 211
    So, should you manually change the scene size to 960 x 640, or keep it the default size, make the graphics to suit 960 x 640 and bring them into GS and let it half their size to fit 480 x 320?

    If it's the latter, and you have follow the power of 4 and 2 rules, I assume that on the iPhone 4 it will up-scale the scene automatically, and as the images are actaully sized for 960 x 640, they don't loose quality?

    I'm just trying to understand this, and what actual scene size you should be using.
Sign In or Register to comment.