Understanding the image sheet compression

Discussion and feedback on Construct 2

Post » Thu Jun 22, 2017 5:29 pm

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 :D

Jay
B
6
S
1
Posts: 18
Reputation: 413

Post » Thu Jun 22, 2017 5:46 pm

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
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Thu Jun 22, 2017 5:50 pm

jobel wrote: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.
B
6
S
1
Posts: 18
Reputation: 413

Post » Thu Jun 22, 2017 6:25 pm

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

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.

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.
B
6
S
1
Posts: 18
Reputation: 413

Post » Thu Jun 22, 2017 7:58 pm

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.
B
79
S
51
G
39
Posts: 370
Reputation: 24,705

Post » Thu Jun 22, 2017 10:15 pm

UberLou wrote: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"?
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Thu Jun 22, 2017 10:27 pm

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.
Image ImageImage
B
168
S
50
G
163
Posts: 8,224
Reputation: 105,067

Post » Thu Jun 22, 2017 10:43 pm

UberLou wrote: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!
B
6
S
1
Posts: 18
Reputation: 413

Post » Thu Jun 22, 2017 10:44 pm

newt wrote: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.
B
6
S
1
Posts: 18
Reputation: 413

Post » Thu Jun 22, 2017 11:10 pm

jobel wrote: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.
B
79
S
51
G
39
Posts: 370
Reputation: 24,705

Next

Return to Construct 2 General

Who is online

Users browsing this forum: justifun and 12 guests