Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Grim on Mon 21/02/2011 10:44:29

Title: Changing sprite size & format doesn't make game file smaller...
Post by: Grim on Mon 21/02/2011 10:44:29
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?
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: arj0n on Mon 21/02/2011 10:52:15
Maybe the AGS version you are using (< v3.2)
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: Grim on Mon 21/02/2011 10:53:16
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?...
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: arj0n on Mon 21/02/2011 11:05:50
I'm not complete sure but I'm using 3.2.0 (http://www.agsarchives.com/download/engine_id/40/ags-3.2.html) and have no such problems.
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: Calin Leafshade 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.
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: Grim on Mon 21/02/2011 11:15:34
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?
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: Calin Leafshade on Mon 21/02/2011 11:19:37
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.
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: Grim on Mon 21/02/2011 11:33:03
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?...
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: Knox on Mon 21/02/2011 15:09:28
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?
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: Calin Leafshade on Mon 21/02/2011 15:24:47
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.



Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: dbuske on Mon 21/02/2011 18:50:52
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?
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: mode7 on Mon 21/02/2011 19:28:11
You can use ogg compression for speech and music - that should reduce the size.
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: Knox on Mon 21/02/2011 19:43:32
@calin: hmm, interesting! So is it worth indexing large sprites to limit the amount of different pixel colors?
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: Kweepa on Mon 21/02/2011 20:48:12
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.
Title: Re: Changing sprite size & format doesn't make game file smaller...
Post by: Calin Leafshade on Tue 22/02/2011 07:45:50
Yea, the more blocks of continuous colour, the smaller the sprite will be.