✖ Memory use Vs Processor overhead ? ✖

CloudsClouds Member Posts: 1,599
edited February 2012 in Working with GS (Mac)
I realise that we can keep the size of an app down by optimizing the assets the games uses.

So . . I take my 24bit Photoshop images and make them 8 bit PNG images - which can greatly reduce the file size.

So, now I have a smaller overall game size, which loads much quicker on the end user's iPhone/iPad/Android . . . .

Now . . assuming we have no memory issues (let's imagine our app happily loads onto even the older devices as it's only - for example - 5MB) . . . do these smaller 8 bit files have any impact on how the end device performs, I am talking purely about how smoothly the app runs - does it make any difference if the device is throwing 50 x 8 bit images around the screen or if it is throwing 50 x 24 bit images around the screen ?

Cheers in advance for any input / insights !

Comments

  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    @Tynan
    I think optimising images is good to keep games under 20MB so they can be downloaded over cell phone networks.

    But I don't think it makes a difference to game performance. Whether 8bit or 24bit the image will be have the same length and width. So the same number of pixels are being pushed around by the cpu.

    I published a mac game the other day which I haven't done before. Feels so much nicer not to have those long loading times!

  • SAZ_1SAZ_1 Member Posts: 397
    haha yea thats soo true i was playing spin the nut on my mac the other day and it doesn't have any loading times felt soo weird lol... but i think as shaz said it only changes the size of your game file, so your saving space.. personally i dont think its a huge thing either if you go over 20mb, nice to keep it under but if it goes over then hey what the heck!
  • old_kipperold_kipper Member Posts: 1,420
    edited February 2012
    I've wondered about this. I presume a smaller file with the equivalent of a 1/3 of the colour info will open initially into ram faster but I guess that the 8 bit file is then held in 24 (possibly 16)bit colour space where the values of the colours are met by raising the rgb channels to match them (otherwise you might get stepping in the colour when you adjusted the colour channels within GS for the actor). So 8bit rather than 24 bit wouldn't reduce the held memory for the dimension of the graphic. There is a loss on quality of antialiasing on 8 bit with alpha that I think I can see, but you will have to judge for yourself. just a few thoughts. I may be wrong. kipper
  • CloudsClouds Member Posts: 1,599
    @HoneyTribeStudios @SAZ_1 @old_kipper

    Cheers for the input, my suspicions pretty much matched what everyone has said here, an 8 bit file will be smaller so will load faster . . . but once in RAM it will take up the same memory as a 24 bit file (as old kipper says, both will likely be held in 16 or 24 bit colour space) and will be no more or less demanding on the processor than a 24 bit file . . . Might do a test.

    @old_kipper

    "There is a loss on quality of antialiasing on 8 bit with alpha that I think I can see . . . "

    If you supply the anti-aliasing area enough colours (or tones) there should be no loss in quality over 24 bit, anti-aliased areas tend to only have 2 or 3 tones, so it shouldn't be difficult to have anti-aliasing as good as 24 bit in an 8 bit file.
  • old_kipperold_kipper Member Posts: 1,420
    @tynan I think I see it mostly on edges of objects but this might be down to time painting out blue screen spill and rough matting in animation/effects frames and I still get very critical about.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    @saz_1 Apple even sent me an email the other day saying the game I uploaded was 19mb but after processing it was 20mb and would be too big for downloading over cell phone newtworks. So they recommended that i cancel the binary and get the file size down a bit more. Which I did.

    I put a load more of the images through imageAlpha. Great tool that one.

    @old_kipper @tynan Also keep in mind that if you use retina images and tick resolution independence the auto generated smaller images will be in 24bit irrelevant of what your originals are. At least I'm assuming that based on the file sizes of the auto images which are sometimes bigger than the 8bit retina sized images.
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    @old_kipper

    "I think I see it mostly on edges of objects but this might be down to time painting out blue screen spill and rough matting in animation/effects frames and I still get very critical about."

    You are talking to an anti-aliasing nazi ! Seriously, I often spend hours moving/lightening/darkening individual pixels on images. Spent at least an hour today trying to improve the anti-asliasing on a 32 x 32 3D cube (no joking)

    On green/blue screen spill I matte stuff leaving the spill in and then simply desaturate the blue/green area of the spectrum on the edges of the cutout.

    All the stuff in this video (below) I shot against a roll of green paper in my front room.

  • CloudsClouds Member Posts: 1,599
    @HoneyTribeStudios

    "I put a load more of the images through imageAlpha. Great tool that one."

    Yep, it's fantastic, wish it had a batch feature though.
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    "Also keep in mind that if you use retina images and tick resolution independence the auto generated smaller images will be in 24bit irrelevant of what your originals are. At least I'm assuming that based on the file sizes of the auto images which are sometimes bigger than the 8bit retina sized images"

    What are the down-sampled images like, I know Gamesalad itself has pretty awful interpolation within the application (a poor 'nearest neighbour' at best) - I was curious as to how they down sample, hopefully with something decent rather than the game engine itself ??

    Anyone got a sample of the an original and a down-sampled image ?
  • fzeedfzeed Member Posts: 247
    Wow, thats pretty cool!!!!
  • CloudsClouds Member Posts: 1,599
    Just tested . . . . .

    A ton of large (512 x 512) 24 bit images spinning and bouncing around the place drags my poor iPad (1) down to 38 fps - changing the images to 8 bit makes no difference, still 38 fps.
  • old_kipperold_kipper Member Posts: 1,420
    edited February 2012
    @tynan Really like your video! Very nicely done by any standard (and I like the music). I noticed the anamorphic lens flare in some sections and wonder if you did use an anamorphic lens, or is that a post effect? Also I love the time effects and particles linked to the people's movement in the shots. YUM!

    Most of my film and tv work was in the early 90s (I worked at Aardman) before the tools were as neat as they current are unless you went up to high end suites and even those didn't have the power of home systems today.

    And on the 38fps... not surprised. Next possible test might be to do a test of anamorphic squash of frames and open them out to un-squashed size within the actor. Think this would reduce memory but as the squash to be useful would have to pull things within the rule of 2 so the squash would be quite harsh and image quality not fab. And I am not sure of the effect on processing speed, but it might be useful in some cases.
  • ozboybrianozboybrian PRO Posts: 2,102
    8 bit would lower the image quality/potential though...
  • Rob2Rob2 Member Posts: 2,402
    edited February 2012
    All ends up in a 32bit space in the end - but there are a few caveats which effect performance along the way - file type etc.

    Stunning video - fecking impressive - and what songs !!

    If you want to see the down-sampling quality open up an ri published app and then https://developer.apple.com/library/ios/#qa/qa1681/_index.html to view the pngs (there is a quicklook plugin available somewhere) The whole Xcode/Apple optimisation process actually increases file size sometimes - especially if you have gone crazy with ImageAlpha or ImageOptim
  • CloudsClouds Member Posts: 1,599
    @old_kipper

    Really like your video!

    Cheers.

    I noticed the anamorphic lens flare in some sections and wonder if you did use an anamorphic lens, or is that a post effect?

    It's an old late 70s Iscorama anamorphic, uncoated, so all you have to do is have a light anywhere in the frame and the lens flares start - there are also some post flares done in Video Co-pilot's Optical Flares.

    "Also I love the time effects and particles linked to the people's movement in the shots. YUM!"

    Particles swaying with one of the girls is just glitter thrown up into the air and blown about with a piece of cardboard, hi-tech stuff !!

    And on the 38fps... not surprised. Next possible test might be to do a test of anamorphic squash of frames and open them out to un-squashed size within the actor. Think this would reduce memory but as the squash to be useful would have to pull things within the rule of 2 so the squash would be quite harsh and image quality not fab. And I am not sure of the effect on processing speed, but it might be useful in some cases

    I thought of the very same thing ! I have an actor (animation) that moves pretty quickly, he's full resolution when still but when moving drops to half-res (in both X and Y) as he's covered in so much motion blur that the drop in res is imperceivable.
  • CloudsClouds Member Posts: 1,599
    @ozboybrian

    "8 bit would lower the image quality/potential though..."

    I'd agree that with some images converting to 8 bit might compromise the image quality, but it's surprising what you can get away with, even smooth gradients can covert well to 8 bit.
  • CloudsClouds Member Posts: 1,599
    @Rob2

    "All ends up in a 32bit space in the end - but there are a few caveats which effect performance along the way - file type etc."

    Good to know ("All ends up in a 32bit space in the end"), cheers for the info. Are not file type all converted to what GS needs when importing, or are you talking about iOS in general ?

    "Stunning video"

    Cheers !


    "If you want to see the down-sampling quality . . . "

    Again, cheers for the info . . . so I see 'Pngcrush' is used the do the down sampling and is handled by Xcode and not GameSalad (shows you how much I knew about the process!) which can only be a good thing as I expect 'Pngcrush' uses a high quality sampling algorithm, having not published a resolution independent game I was worried that GS might do some kind of internal game engine down conversion using it's pretty crude nearest neighbour method ! 8-X
  • hotMagichotMagic Member, PRO Posts: 266
    If you are doing any sort of alpha, you are gonna get some weird edges with PNG8. I use 24 for anything that needs to have that alpha edge, and anything that uses a lot of gradient colors.
    We use Riot, because it does a nice side by side. And our image work is done on PC.
    http://luci.criosweb.ro/riot/
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    @hotMagic

    "If you are doing any sort of alpha, you are gonna get some weird edges with PNG8"

    An anti-aliased edge leading into transparency typically has less than 4 or 5 tones, easily within the capabilities of an 8 bit image, in fact it's safe to say that there is no reason why the edges (anti-aliased leading into transparency) on an 8 bit image cannot be identical to a 24 bit image.
  • hotMagichotMagic Member, PRO Posts: 266
    Tynan, I've never had a lot of luck with that. I tend to get tiny white artifacts on those. But im paying attention to this thread for sure!
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    @hotMagic

    "I've never had a lot of luck with that. I tend to get tiny white artifacts on those."

    Can you post a (24 bit) image that you have had the white artefact issue with when attempting to convert it to 8 bit ? I will see if I can convert it to 8 bit without the artefacting.
  • Rob2Rob2 Member Posts: 2,402
    @Tynan iOS in general - png are best - Xcode performs optimisations using pngcrush which speed up file loading times but you will need to reverse these to view normally. Pngcrush does not resize images.
    I don't know what tool GS are using for image resizing (downsampling) - could be a bucket and spade...
    Confusion is creeping in with the use of the word size... story of my life.
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    @Rob2

    "I don't know what tool GS are using for image resizing (downsampling) - could be a bucket and spade..."

    In the actual game engine they seem to be using a mediaeval incantation or some kind, but I suppose it's not reasonable to expect realtime bicubic interpolation at 60 fps on a mobile device.

    "Confusion is creeping in with the use of the word size... story of my life."

    Lol !



  • hotMagichotMagic Member, PRO Posts: 266
    That would be awesome of you. As in, super awesome. Ill find my worst offender and post it tonight.
  • hotMagichotMagic Member, PRO Posts: 266
    That was in response to @Tynan. Sorry super slow poster here.
Sign In or Register to comment.