Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: stuh505 on Fri 21/05/2004 00:43:20

Title: What gets bundled in the compiled program?
Post by: stuh505 on Fri 21/05/2004 00:43:20
My game is already 1 GB and I don't even have much in it yet...I'm not sure how it is getting so big, unless...does it compress and contain everything that is in the AGS game folder?
Title: Re: What gets bundled in the compiled program?
Post by: Moox on Fri 21/05/2004 00:56:24
1 gb holy crap

you are looking at compiled folder, not the game folder correct?
Title: Re: What gets bundled in the compiled program?
Post by: strazer on Fri 21/05/2004 01:52:09
All multimedia files matching the AGS naming convention (soundX.ogg/mp3/wav/voc, musicX.mid/mod/xm/s3m, flicX.fli/flc) seem to be compiled into the exe, whether you use them or not!
Title: Re: What gets bundled in the compiled program?
Post by: stuh505 on Fri 21/05/2004 03:36:14
oops, I said GB didn't I?  For some reason I was thinking 100 MB = 1 GB...oh well, I MEANT 100 MB, which still seems large to me...but I just looked at all the file sizes and it seems to be be correct.

Title: Re: What gets bundled in the compiled program?
Post by: MrColossal on Fri 21/05/2004 05:33:48
try raring it, the size will go down a bit, at least it does for me, my game is over 8 megs and it zips to a little over 1

but if you have a lot of videos and mp3s it's gonna be huge
Title: Re: What gets bundled in the compiled program?
Post by: Alynn on Fri 21/05/2004 08:05:42
Same with winzip, I'm not an expert, but what it seems to me, the graphics add some, but not near what the actual size of the graphics are, WAV's don't compress very well, midi's do somewhat...

What I am thinking that decreases the size so much is the bytecode (guessing it's mostly text based) which as most of us know, text compresses very well... I've found that adding tons of new script seems to blow up the size of the game more than other things do.
Title: Re: What gets bundled in the compiled program?
Post by: auhsor on Fri 21/05/2004 10:20:33
Heh, we just learnt about how compression works at uni today. I should be able to remember it, but hey...
Yeah, when you compress it it should become considerably smaller. User rar or ace as they compress better than zips.
Title: Re: What gets bundled in the compiled program?
Post by: Privateer Puddin' on Fri 21/05/2004 10:36:12
Yet i would think zip is more popular for casual pc users..
Title: Re: What gets bundled in the compiled program?
Post by: Kweepa on Fri 21/05/2004 15:03:23
WinXP has zip support built in - a zip file opens like any other folder - so I think rar and ace are (walking) dead formats.
The size difference is maybe 5% at most anyway.

As for having an 100Mb game, that does seem a little excessive, but then stuh's backgrounds are 800x600 with little hope for run-length encoding savings.
Title: Re: What gets bundled in the compiled program?
Post by: Fuzzpilz on Fri 21/05/2004 15:30:48
Quote from: SteveMcCrea on Fri 21/05/2004 15:03:23
The size difference is maybe 5% at most anyway.
Uh, no. It can be quite substantial (more than 50% occasionally!), depending on the data. And 5% of a big file can be quite a lot, especially if you're going to distribute it to a lot of people over the net. Say stuh's game will compress down to 100 MB when it is finished (since it's already that large uncompressed and he hasn't gone far yet, that's reasonable) - 5% larger would be 105. If 100 people download the game, which is not terribly unlikely, that's a 500 MB difference already.

Not that I like to advocate the use of proprietary archive formats and compression algorithms. The PKZIP format has the advantage of being widely supported, as has been pointed out. There are, however, other superior algorithms that will hopefully see wider adoption eventually, such as the Burrows-Wheeler transform based bzip2. The problem with such things, of course, is that everybody doesn't use them because everybody else doesn't either.

Quote
As for having an 100Mb game, that does seem a little excessive, but then stuh's backgrounds are 800x600 with little hope for run-length encoding savings.
RLE on its own is a pretty crappy method of compression. I don't actually remember if AGS compresses its resources at all, but it doesn't seem so to me - this should be obvious, considering how well finished AGS games compress. Any clarification on that, CJ? (and information on whether you plan to ever start doing so? I think it's been discussed before, but I don't remember exactly)
Title: Re: What gets bundled in the compiled program?
Post by: Scorpiorus on Fri 21/05/2004 17:45:36
QuoteI don't actually remember if AGS compresses its resources at all, but it doesn't seem so to me - this should be obvious, considering how well finished AGS games compress.
As far as I know, room backgrounds are compressed (using lzss algorithm maybe?) whereas sprites are stored with no compression at all which results in a fairly good compressibility with an external archiver.

Zip is fast (with todays computer speeds it's not that important, though) and microsoft's having integrated it in WinXP will obviously make it even more popular.

What I always liked in Rar (since dos times) is its ability to make a solid archive which is really good for transfering large amount of tiny files.
Title: Re: What gets bundled in the compiled program?
Post by: Kweepa on Fri 21/05/2004 18:11:22
Quote from: Fuzzpilz on Fri 21/05/2004 15:30:48
Quote from: SteveMcCrea on Fri 21/05/2004 15:03:23
The size difference is maybe 5% at most anyway.
Uh, no. It can be quite substantial (more than 50% occasionally!), depending on the data.
I have never ever seen a big difference.
What sort of data gets that good compression?
Not AGS games...

Quote
If 100 people download the game, which is not terribly unlikely, that's a 500 MB difference already.
If you use rar you've probably saved 1GB because 10% of your audience has ignored it! Huzzah!

Quote
RLE on its own is a pretty crappy method of compression.
It works well for most of the artwork AGS sees.
And I think it's what AGS uses for backgrounds, which is why I mentioned it in the first place.

Quote from: Scorps
What I always liked in Rar (since dos times) is its ability to make a solid archive
You can do that with zip by first zipping with no compression, then rezipping the resulting zip file with maximum compression. Kind of like .tar.gz. Admittedly that's pretty lame...
Title: Re: What gets bundled in the compiled program?
Post by: Fuzzpilz on Fri 21/05/2004 18:33:50
Quote from: SteveMcCrea on Fri 21/05/2004 18:11:22
I have never ever seen a big difference.
What sort of data gets that good compression?
Not AGS games...
Wrong. You can easily try it out yourself - typically the zip is at least 5% larger, not at most. (disclaimer: I only tried a few games, and didn't perform any significance tests etc.)

Quote
If you use rar you've probably saved 1GB because 10% of your audience has ignored it! Huzzah!
The question is, is that a good thing? Is it good that most people are using something inferior? I'm not saying that everybody should use specifically (format X) or (format Y) instead of zip, but it's a very bad idea to cling to zip and dismiss all attempts at progress.

Quote
It works well for most of the artwork AGS sees.
And I think it's what AGS uses for backgrounds, which is why I mentioned it in the first place.
As I said, I'm not sure what, if any, compression AGS uses, but think: if RLE of all things works well for something, then more effective algorithms (e.g. DEFLATE, which is used for PKZIP and Gzip archives) will work even better. You may well be throwing away the opportunity to make the final product much more compact.
Title: Re: What gets bundled in the compiled program?
Post by: Scorpiorus on Fri 21/05/2004 18:45:50
Quote from: SteveMcCrea on Fri 21/05/2004 18:11:22
Quote from: Scorps
What I always liked in Rar (since dos times) is its ability to make a solid archive
You can do that with zip by first zipping with no compression, then rezipping the resulting zip file with maximum compression. Kind of like .tar.gz. Admittedly that's pretty lame...
Yeah. Those times, though, I had a 286 with 40mb HDD and couldn't really allocate an extra 5-10mbs for such manipulations. I was so happy when discovered that rar had that function, I must to say. :)
Title: Re: What gets bundled in the compiled program?
Post by: Pumaman on Fri 21/05/2004 19:50:13
Yes, room backgrounds are compressed with an LZ-based algorithm. Sprites are not compressed for performance reasons - this has been discussed extensively in the past.
Title: Re: What gets bundled in the compiled program?
Post by: Kweepa on Fri 21/05/2004 20:29:02
Quote from: Fuzzpilz on Fri 21/05/2004 18:33:50
Wrong. You can easily try it out yourself - typically the zip is at least 5% larger, not at most. (disclaimer: I only tried a few games, and didn't perform any significance tests etc.)
That's true - I got about 10% on my game in progress - rar must be getting better.
Looks like I was talking oot me arse again!

Quote
The question is, is that a good thing? Is it good that most people are using something inferior? I'm not saying that everybody should use specifically (format X) or (format Y) instead of zip, but it's a very bad idea to cling to zip and dismiss all attempts at progress.
I would love for M$ to adopt rar. But they're not going to, I suspect. I don't see any recent specs for the format.
So I agree it's not a good thing but whaddareyagonnado?

Quote
As I said, I'm not sure what, if any, compression AGS uses, but think: if RLE of all things works well for something, then more effective algorithms (e.g. DEFLATE, which is used for PKZIP and Gzip archives) will work even better. You may well be throwing away the opportunity to make the final product much more compact.
Not really. If you pack the game afterwards it doesn't make a hell of a lot of difference to the distribution.

Title: Re: What gets bundled in the compiled program?
Post by: stuh505 on Fri 21/05/2004 22:36:37
Last I checked (which was some time ago) you needed non-free decompression software for .rar.  If you ask me that is reason enough for it to be dead.

Anyway, Pumaman's comment about sprites not being compressed explains why my file is so large....as pointed out, my game is 800x600, I'm using 32-bit alpha channel sprites, some of my rooms are kind of close up so my characters might be a little larger than normal (144x344), so each character has 10 MB of sprites minimum (thats for standing still and walking in the 4 directions).
Title: Re: What gets bundled in the compiled program?
Post by: auhsor on Sat 22/05/2004 04:21:09
I did some quick little tests on the game, The Uncertinity Machine v1.1
Uncompresed: 45.5 MB
Zip: 19.6 MB
Ace: 17.1 MB
Rar: 17.0 MB

With an even larger game, I think that difference woulld be more noticable. But unfortunately, it seems the popular choice is zip, even though its not the best. Reminds me of other things... mp3/ogg vorbis anyone?
Title: Re: What gets bundled in the compiled program?
Post by: Fuzzpilz on Sat 22/05/2004 10:04:09
Not really, auhsor - rar isn't free/open. If you want something superior in that direction that's relatively widely used, use Bzip2 (http://gnuwin32.sourceforge.net/packages/bzip2.htm). It's a command line tool, though, which I assume will have contributed to its low popularity outside OSS circles. Many proprietary tools can decompress it, though - I know Winrar does, for example.
Title: Re: What gets bundled in the compiled program?
Post by: Radiant on Thu 27/05/2004 17:31:37
I would like to point out that a single test does not constitute any kind of statistical validity.
Title: Re: What gets bundled in the compiled program?
Post by: SSH on Thu 27/05/2004 17:54:43
Maybe someone should take a selection of large games from the download pages, try them with bzip2, tar/gzip, zip, rar, ace, etc. and compile some statistics of the results. But I've got better things to do with my time.... AOTS is available in zip or rar, btw  ;)
Title: Re: What gets bundled in the compiled program?
Post by: Ieremiou on Thu 27/05/2004 17:55:58
Personally I have many of the different archiver tools because One of them will be smaller than another. Also, I look for newer and better compression archivers. Recently I picked up a fairly good archiver called www.winrk.com (WinRK) which for PDFs at least can decrease the size by 20%. For instance, I took a 15 mb PDF and it shrank to about 12 mbs. As a side note the PDF was originally a 44 mb monster which i stripped using a program called PDF Enhancer. Although I did test WinRK on this bloated monster it it shrank to about 15mbs.. heh.. now that's compression.

Basically I have WinRAR, WinZIP, 7-ZIP, WinRK, and WinACE as archiver Utilities. Each one has an advantage then another depending on what you're compressing. Also some support SFX Compression. WinRAR, WinZIP, 7-ZIP, and WinACE support them now... WinRK is working on it since he's fairly new on the scene.

AlsoÃ,  some of these support the creation of other archives like bzip2, tar, gz, zip. These tools I've seen that support that are 7-zip, and WinRK for now.Ã,  The guy of WinRK is basically working on what 7-Zip has become with I assumeÃ,  a completely different algorithym.  Also with a completely different GUI where 7-Zip is like a desktop explorer.

There are also other Archiving Tools that are commandline versions that work in WinXP which tend to have a better compression then GUIs. But I don't personally like using the commandline anymore unless I'm emulating MS-DOS with DOSBox to play an old game of mine.

So test what you get with a variety of Archivers and you may find one that works better.

Also there are Compact Utilities for .EXEs out like PE Compact (Student/Freeware) which basically compressions the data inside a EXE but this can be risky because sometimes the Compacting strips important data but PE Compact has a automatic (or you can turn it off in the settings) back up so that if the output from compressing your EXE, DLL, OCX *and I think a few others* becomes corrupt you have an automatic backup.

Gosh, the utilities these days.

Edit:

Here is a link to a basically a benchmark/test site for many of the Archivers out (keeps fairly updated too). www.maximumcompression.com
Title: Re: What gets bundled in the compiled program?
Post by: SSH on Fri 28/05/2004 20:41:18
Obviously, I didn't have anything better to do, so here's some results I got from compressing AGS games:

The games:
Buccaneer, 6DA, RodeQuest 2, Purity of the Surf, Larry Vales 2, Perm. Daylight, Odys. Kent, Astranded, Beyond Reality, RLBAT, WWTLF, The Case, Spellbound, Byzantine, J Stickman, Bestowers of Eternity, Grr Bearly Sane, Songo, 5 days a starnger, Time Out and Cirque de Zale...

Total uncompressed size 239Mb

In order of best compression

SBC (command-line) took 10 minutes to compress to 67 066 634 bytes
7zip took 11 minmutes to compress to 69 144 393 bytes (3% bigger)
WinRK took 1 hour 16 minutes (!) to compress to 69 531 834 bytes (4% bigger)
WinRAR took 4 minutes to compress to 73 352 704 bytes (9% bigger)
WinZip took 4 minutes to compress to 82 817 830 bytes (23% bigger)

This is on a 600Mhz pentium III

Since 7zip can also make self-extractors, it looks like the best to me, all round in terms of ease-of-use, time to compress and archive size.

I also tried downloading durilca and paqar which supposedly have better compression ratios yet, but they both need you to experiment with their millions of options and I couldn't be bothered.