Sprite sizes

This forum is currently in read-only mode.
From the Asset Store
220 Food Sprites in 16x16 pixel size. Perfect for items for a retro style game.
  • Should all sprites be trimmed to their smallest possible size -- removing any border of transparent pixels?

    I ask because I make the main sprites (i.e. player ship) and all the addional sprites (i.e. flames for boost, shield images, etc) on one sprite sheet like so:

    <img src="http://i232.photobucket.com/albums/ee215/JDoejoe/SpriteSheet.png">

    That way when I reassemble them in construct using image points they all line up perfectly.

    But that also means that the center "ship" image has a bunch of empty space all around it. Should I be trimming each of these individually, then fiddling with them in construct to make it all line up?

    Another way of looking at it is: Does construct use up resources storing and moving all those transparent pixels? Enough so that it's better practice to cut out the excess?

    I know the physics behavior takes them all into account unless you make a custom collision mask.

    These sprites were made at 400x400, but in game they'll probably end up closer to 100x100. Once they're that small, am I just splitting hairs worrying about transparent pixel trimming?

  • You don't have to, but yes editing the images to the least amount of empty space is a good idea.

    Saves memory, and you can use bounding box collisions when needed.

    Making them in power of two dimensions is even better.

  • You don't have to, but yes editing the images to the least amount of empty space is a good idea.

    Saves memory, and you can use bounding box collisions when needed.

    Making them in power of two dimensions is even better.

    Got it. I'll look into making all this stuff 128x128 or 256x256.

    Thanks again Newt!

  • Make it a habit to always make sprites fit into a power of two size texture. A sprite that is 65x65 is pointless, since it will use up the memory of a 128x128 one. Either make it 64x64, or just make it 128x128. This is why large sprites aren't recommended, because the memory usage increases exponentially. A 128x128 sprite uses 4 times more vram than a 64x64 one. So trimming to the smallest possible size only matters if you trim to the smallest possible power of two size. Going from from 100x100 to 70x70 makes no difference. Also, make note that the texture size/memory usage is the size you put into the picture editor. The size in the layout editor just scales that texture, and uses the same amount of memory.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Additionly I want to stress that you are not bound to square sizes. Any power-of-two size on width or height will suffice. Only the oldest graphics cards (generation one and maybe two) don't handle uneven sizes. All cards of the last 6 to 8 years will. So, if you have an original size of 129x257, then you don't need to convert it to something like 128x128 or 256x256. Instead it's safe to make it a 128x256 one. (And if your game will be played on a very old card by accident , it will use more VRAM but won't refuse to work, if there is enough.)

    Look at those threads for more info about that subject:

    http://www.scirra.com/forum/viewtopic.php?f=8&t=7786&p=60406#p60406

    look at the example cap in that post

    http://www.scirra.com/forum/viewtopic.php?f=3&t=7578&p=58897#p58897

  • There are times when your going to want to use a little extra space in the alpha channel.

    For instance many fx are only applied to the bounding box, and if you have pixels all the way to the border, it can make it look cut off. Also its useful for using against a collision box, to make it look like the image is hovering, etc.

    But as the previous posts suggest, you should keep p^2 in mind.

  • I'll keep everything 128x128 for now -- and see where that gets me. I have a feeling that v-ram won't be the bottleneck for this project. (famous last words)

    It does help in planning to note that a 70x70 uses the same memory as a 100x100. Never knew that.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)