Understanding the image sheet compression

0 favourites
  • 15 posts
From the Asset Store
- This pack is suitable for shooting games, running games, platform games, and side-scrolling...
  • Hi everyone!

    How are you today?

    Quick question to you all, I am taking Ashley's post about performance to the letter (with my previous tiny game taking 120mb of RAM). I reduced from 1080p to 720p, every image is made to fit in a power of two size, repeated sprites as much as possible, etc.

    The "problem" I'm facing though is that I design a 128x128 image sprite, but when I export my game it becomes a 256x256 sheet.

    This is the original file used in Construct2, a 128x128 pixels PNG 32 Fireworks project file: https://www.dropbox.com/s/fa9a6zyl2htqf9g/good.fw.png

    This is the file that got out of the export process, a 256x256 mostly empty, border stretched file: https://www.dropbox.com/s/iydqhl26sbyz6 ... sheet0.png

    Two questions:

    1) Why is this happening to the majority of my images, the stretching and the double in size.

    2) With the doubled size, is it also taking double the RAM? Is my 128 image now considered 256?

    Thank you all for your time and have a great day <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Jay

  • how many frames of animation do you have for that one sprite?

    also reference this..

    https://www.scirra.com/blog/87/under-th ... onstruct-2

  • how many frames of animation do you have for that one sprite?

    also reference this..

    https://www.scirra.com/blog/87/under-th ... onstruct-2

    Just one, there's no animation for this sprite.

  • Should I report this as a bug then? Because from that very link you gave me:

    [quote:2ud3nzcx]If a 1024x1024 sheet is only half filled, half the pixels are wasted memory again. If this happens, Construct 2 will instead slice the sprite sheet in to two or three 512x512 sprite sheets to reduce wasted space.

    [quote:2ud3nzcx]Runtime memory use is reduced by eliminating the unused space around power-of-two sized images.

    Right now it is actually making my images larger and adding unused pixels.

  • Its probably because construct adds a 1px border around each image, so your 128x128 image becomes a 130x130 image and that needs to go on a 256x256x sheet. The border is to prevent antialiasing issues.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Its probably because construct adds a 1px border around each image, so your 128x128 image becomes a 130x130 image and that needs to go on a 256x256x sheet. The border is to prevent antialiasing issues.

    that would be really weird if c2 added to your sprite... that doesn't sound right to me.

    technofou are you sure there isn't an empty frame in the "animation"?

  • Well the question you need to be asking is, what good does a power of two sprite sheet do when the renderer doesn't need p^2 images anymore.

  • Its probably because construct adds a 1px border around each image, so your 128x128 image becomes a 130x130 image and that needs to go on a 256x256x sheet. The border is to prevent antialiasing issues.

    Damn, I didn't know about that, I was actually doing it myself!

  • Well the question you need to be asking is, what good does a power of two sprite sheet do when the renderer doesn't need p^2 images anymore.

    Basically I'm trying to get as much "image" as possible for the smallest power of 2 I can.

  • that would be really weird if c2 added to your sprite... that doesn't sound right to me.

    Pretty sure of this. You can test it by making a 126x126 sprite and a 128x128 sprite and see what the sprite sheets look like after export.

  • > that would be really weird if c2 added to your sprite... that doesn't sound right to me.

    >

    Pretty sure of this. You can test it by making a 126x126 sprite and a 128x128 sprite and see what the sprite sheets look like after export.

    Yep that's the plan! Weird though that some 32x32 sprites where compressed as 32x32 images then!

  • Cutting the image by 2 pixel actually did the trick. I'm also removing some sprites and converging them in the same with Animations (for example, 3 sprites for the three types of coins are now the same sprites with each design as different animations)

  • this should be documented somewhere... not cool..

  • this should be documented somewhere... not cool..

    Or just an option to disable it.

  • Not everybody will know how to fix seam issues, and some things are easier to change, than to teach.

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