Changing sprite size & format doesn't make game file smaller...

Started by Grim, Mon 21/02/2011 10:44:29

Previous topic - Next topic

Grim

Hi,

I've done my research befre posting but I still can't find the answer...

As my game grows bigger and bigger I've gone back to large un-cropped sptites I used in the beginning and saved them as much smaller cropped png files instead of bmp. I thought it would make a significant difference, since the old file size of 1.3 mb on average for one spite has now come down to 15-20 kb.... But after replacing sprites in the editor the size of the game stays exactly the same.

  Having read the other posts I made sure I had "compress the sprite file" option enabled ( it was from the start anyway), added one new sprite, rebuilt game files several times, compiled, tried to split resource files into X mb chunks.... and no change. I thought that even if sprite format wouldn't make any difference, at least cropping the sprite from 800x600 to 200x600 would make the game smaller. But no. It doesn't.

What am I doing wrong?

arj0n


Grim

Quote from: Arj0n on Mon 21/02/2011 10:52:15
Maybe the AGS version you are using (< v3.2)

I'm using 3.1.1. WIll upgrading resolve this problem?...

arj0n

I'm not complete sure but I'm using 3.2.0 and have no such problems.

Calin Leafshade

Reimporting the sprite files as a different format will have no effect.

AGS saves sprites in its own internal format regardless of the format you import them.

Grim

Quote from: Calin Elephantsittingonface on Mon 21/02/2011 11:08:04
Reimporting the sprite files as a different format will have no effect.

AGS saves sprites in its own internal format regardless of the format you import them.

Fair enough. What about the cropping? Shouldn't that make it smaller?

Calin Leafshade

depends. If you are cropping out empty space or a single colour then it will make a very very small difference (on the order of a couple of kb) to the size because AGS uses RLE encoding which groups pixels of a similar colour together to save space.

Grim

Oh... I guess I wasted some time then, saving each file in different format and cropping blue edges of the sprites....

That's a shame. I guess it means it will be quite a large game, then. When it's finished it will be probably a 500mb Zip download. Is it actually putting people off when they have to download such a large file? I mean, Monkey Island 2 SE was 1.1 GB (on PS3), so I'm thinking maybe at this day and age it's becoming more acceptable?...

Knox

QuoteOh... I guess I wasted some time then, saving each file in different format and cropping blue edges of the sprites....

I feel your pain...I did the same thing, converting all my bmp's into png's, and then using pngGauntlet to further compress my png's...to only find out later that it's useless to do that!

What Im wondering is how well does AGS compress files? As in, how much does a 900kb sprite weigh in AGS after it compresses it? Is there a formula we can use to guess ourselves before importing?
--All that is necessary for evil to triumph is for good men to do nothing.

Calin Leafshade

I think AGS uses content aware compression so it not possible to give a ball park figure.

basically it works like this:

You can think of an image as a series of numbers representing their colour. Imagine a row of numbers like this:

1,1,1,1,1,1,4,2,6,8,1,2,1,1,1,1,1,1,2,3,4,6,2,3,6,6,6,6,6,6,6,1 = 32 'slots'

Those 32 numbers take up 32 'slots' of memory but you can compress it like this:

6(1),4,2,6,8,1,2,6(1),2,3,4,6,2,3,7(6),1 = 19 slots

So AGS will compress a simple pixel art image far more successfully than a photograph because it has lots of blocks of the same colour.

In fact if the photograph has no repeated pixels at all then it will hardly be compressed at all which is why JPEGs (which uses a different form of lossy compression) are usually used for photographs.

In sum, it depends on your image and paintings/photographs with perform poorly compared to pixel art despite resolution.




dbuske

I also was unable to reduce the size of my 2 finished games.
The biggest file is the vox file.
Is there a way to reduce the size of that?
What if your blessings come through raindrops
What if your healing comes through tears...

mode7

You can use ogg compression for speech and music - that should reduce the size.

Knox

@calin: hmm, interesting! So is it worth indexing large sprites to limit the amount of different pixel colors?
--All that is necessary for evil to triumph is for good men to do nothing.

Kweepa

Yes, you can do that. For certain images it will help.
You can get an idea of how much compression you will achieve if you can save as PCX, as this uses run-length compression much like AGS. Probably won't save you much time though.
Still waiting for Purity of the Surf II

Calin Leafshade

Yea, the more blocks of continuous colour, the smaller the sprite will be.

SMF spam blocked by CleanTalk