Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Kairus on Wed 28/01/2004 03:19:30

Title: Graphics compression
Post by: Kairus on Wed 28/01/2004 03:19:30
I thought the fact you could import PCX files meant you could reduce the size of the game, as the PCX are compressed already. But I created a set of very big objects that only used two colors, the size was 17 kb for all of them. Then I imported them into my game and their size was like 125 kb each. Even importing them as 256 colors (which destroyed the images as the colors didn't match the palette) didn't reduce them much.
Do you think in future versions of AGS there will be graphic compression (at least .PCX, which is good enough) support? Or is there already a way to save them compressed into the game?
Thanks,
Kairus
Title: Re:Graphics compression
Post by: Privateer Puddin' on Wed 28/01/2004 07:45:03
AGS has its own compression, so no matter what format you import, it should have the same results.
Title: Re:Graphics compression
Post by: Ishmael on Wed 28/01/2004 08:09:04
Zip the game exe up... it goes to quite a little package. There the images are compressed even more (actually, there are the sprites compressed. AGS compresses only backgrounds when importing)
Title: Re:Graphics compression
Post by: Kairus on Wed 28/01/2004 13:31:35
Yes, I realized the zip thing, but I thought it could be possible that the engine itself compressed the sprites to some decent format (PCX for example, I think the algorythm is free), or perhaps it could import them as 256 colors without messing the colors up and then displaying them in 16 bit... Just a suggestion for later versions of AGS. :)
Title: Re:Graphics compression
Post by: Kweepa on Wed 28/01/2004 15:32:20
Why bother?
It affects neither your development (unless you spend time trying to second guess the engine :) ), nor the user's download speed.
Title: Re:Graphics compression
Post by: Ishmael on Wed 28/01/2004 16:56:18
how do you shove over 256 colors into 256 col image?

When converting to gif, if the image has less then 256 colors, a custom palette is created for it, and the colors are exactly as they are drawn. If the 256 colors are exceeded, the image will be converted into standard system palette, which messes colors.

And, as already stated, what are you after with this?
Title: Re:Graphics compression
Post by: Gilbert on Thu 29/01/2004 10:10:38
Actually it's a frequently mentioned thing, no matter what the graphics file format you used for import the resultant data are the same, sprites are NOT compressed in an AGS game for speed issue, while bgs in rooms were compressed by some lossless algorithm when saved (which has nothing to do with the original file, and according to CJ should be quite good in compression rate), so sizes and number of sprites are quite critical to file size, if you really need to keep a game small (even when it's not zipped), you may need to have some planning on their usages.
Title: Re:Graphics compression
Post by: Pumaman on Sat 31/01/2004 14:27:13
Yep, Gilbert's got it in one.

Room backgrounds are compressed when you import them.

Sprites however are not - this is for performance reasons, since during the game sprites are regularly loaded from disk and it would probably cause a noticable slowdown to have to decompress them as well.

Room backgrounds don't suffer from that problem since they are only loaded once, when the player changes rooms.