Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: ramon82 on Wed 07/07/2004 07:04:45

Title: Decreasing file size!
Post by: ramon82 on Wed 07/07/2004 07:04:45
Hi all,

Can you give some tips on how I can keep my game as small as possible in size? I mean image format (PCX, BMP), palette, res etc..

Thanks for your feedback
Title: Re: Decreasing file size!
Post by: Rui 'Trovatore' Pires on Wed 07/07/2004 07:18:54
I believe the following sentences will give you the lowest sive -

256 colors
320x240
PCX images

I think there's nothing other than the length of the game that interferes with the file size.
Title: Re: Decreasing file size!
Post by: Barbarian on Wed 07/07/2004 08:45:07
And any music or sound files you use, try to have in a format uses the least size, or you can perhaps convert some music / sound files over to a "lower quality" settings which generally reduces file-size, but, then again, you're also reducing sound quality too.
so you can play around and get a balance of what you think is best.

You could also make a version without any music or sounds (arrrgh, what?Ã,  :o no music or sounds? hehehe.).Ã, 

You can also try compressing it different formats too and see what results you get. Like for example, when it comes time it's ready for release and downloading, I think RAR format compression sometimes uses less size than a ZIP file compressions. Though, ZIP seems to be one of the more popular formats when it comes to compressing files.Ã,  Ã, Oh well, just a few random thoughts.Ã,  ;)
Title: Re: Decreasing file size!
Post by: Gilbert on Wed 07/07/2004 09:13:32
Using PCX files won't decrease the size of your game, no matter which graphics format you used to store your original graphics files, they're all converted to the same internal formats in an AGS game. Note that room backgrounds will be compressed with some lossless algorithm and sprites are never compressed, so be carefully if you need many large sprites.
Either way, you should ZIP your games before distributing, and this should make some good save on spaces in most cases already.
Title: Re: Decreasing file size!
Post by: ramon82 on Thu 31/05/2007 06:09:47
My game is made up so far of PNG sprites which do not exceed 3kb each for the character and a room of the same format which is 20kb large with a 320x200 res and still the game is like 2.3mb compiled already!!

how can i force ags to lower the size of the compiled game? as i said res is 320x200 16bit
Title: Re: Decreasing file size!
Post by: Gilbert on Thu 31/05/2007 06:27:39
If you had already ticked the "Compress sprite file" option, there isn't any other way (unless you reduce the amount and complexity of graphics, etc.).

Because of performance consideration. the sprites are currently compressed with a simple RLE scheme, which can help some, but won't compress well (compared to the tighter scheme used by room backgrounds) if you have more "complicated looking" sprites.

It wouldn't matter much though, as most probably the game will be reduced to a reasonably small size after ZIPPING for distribution.
Title: Re: Decreasing file size!
Post by: Fee on Thu 31/05/2007 07:32:31
Im at the 120 meg mark at the moment for the exe alone, so i tried packing it, but then the game doesnt run for some stupid reason.
Title: Re: Decreasing file size!
Post by: Gilbert on Thu 31/05/2007 09:22:04
Did you mean the game didn't run when it's ZIPPED?
That's normal, you only compress the games for distribution (upload to internet for downloading, etc.). The games MUST be extracted for playing.
Title: Re: Decreasing file size!
Post by: SSH on Thu 31/05/2007 09:22:14
You can't run the game out of a zip file without unzipping it first: you can't use Windows XP's "virtual folder" thingy
Title: Re: Decreasing file size!
Post by: Hudders on Thu 31/05/2007 09:38:13
Quote from: SSH on Thu 31/05/2007 09:22:14
You can't run the game out of a zip file without unzipping it first: you can't use Windows XP's "virtual folder" thingy
Are you sure?

I'm convinced I've done that on a number of occasions.  ???
Title: Re: Decreasing file size!
Post by: Gilbert on Thu 31/05/2007 09:49:38
That may work, but probably not within those WinAip, WinRar, etc.

Anyway, that "virtual ZIPed folder" thingie in XP should be avoided whenever possible, it's pure crap.
Title: Re: Decreasing file size!
Post by: Fee on Thu 31/05/2007 11:52:14
No, i actually tried to Pack the exe with UPX and Npack. Basically they compress the exe to a new exe that when you run it, extracts the Packed exe to RAM and runs it.
Title: Re: Decreasing file size!
Post by: Gilbert on Thu 31/05/2007 12:10:40
Why did you want to do that anyway?
If you compile the game to one single executable, the game data (sprite, compiled scripts, rooms, etc.) are appended to the engine file acwin.exe. If you use UPX/NPACK to compress the whole thingie, it may cause problem when it need to decompress "on the fly" the data part to access them in game, especially when the game is large.

Worst of all, the engine executable itself was already packed with UPX, we can't guarantee any odd behaviour will happen (if it executes at all) if you compress it once more.

Anyway, for large games, using the split resource options is preferred to compiling into a single executables since some ppl experienced disk loading performance issues in the past. In this case, UPX/NPACK won't help much on the file sizes (even if it works), so there's little point in doing so.
Title: Re: Decreasing file size!
Post by: ramon82 on Thu 31/05/2007 12:24:36
OK. Now assuming I want to start a new game, how can I keep the exe size as small as possible?

format of sprites?
pref res?
pref color dept?
any AGS settings to tick?

Thanks  ;)
Title: Re: Decreasing file size!
Post by: GarageGothic on Thu 31/05/2007 13:07:22
Import format of sprites makes no difference as AGS stores them in its own format anyway. The only thing that matters when it comes to sprites and backgrounds is size, complexity and number of colors.

The other settings are quite obvious. Just go for the lowest possible. 320x200 at 256 colors and use as few of these colors as possible in each sprite/background. Tick the "compress sprites" setting if a small game .exe is important to you. It won't change the rar/zip'ed distribution size much.
Title: Re: Decreasing file size!
Post by: Radiant on Sat 02/06/2007 19:43:22
Quote from: SSH on Thu 31/05/2007 09:22:14
You can't run the game out of a zip file without unzipping it first
Works fine for me, actually, if you find the basic setup acceptable (since I think you can't use setup files this way)

To reduce game size, use MIDI files for music rather than MPG/OGG. Also, stick to a 256-color game, 320x200 resolution, use graphics with many mono-color areas (since this improves the RLE compression that iirc is used for rooms), use the "compress sprite file" flag, and keep the room count low. Not all of these are feasible ^^

META is surprisingly small despite 800x600 resolution, because most of it runs in 16 colors.
Title: Re: Decreasing file size!
Post by: SinSin on Sun 03/06/2007 02:51:46
Hey hey

    Why does size matter these days?? broadband should only take a few minutes even to download 40 mb & most initial games are about 1 mb. I really wouldnt worry too much about the file size (unless you have managed to fill your hard drive with random stuff). In a phsycological sense tho aim for about 20 mb people are usually ok with waiting for files upto that size anymore and people kinda think "thats gonna take ages "
use yer bonce...

Make a game you are comfortable with and wait 2-3 weeks
Look at it again if it needs work, work at it
Zip the compiled folders up
Slap it on the net
Badda bing
Title: Re: Decreasing file size!
Post by: Fee on Sun 03/06/2007 03:47:48
Why? the Exe is 120 meg. Games getting a little big for somthing so crap and since the packer usually makes out Helbreath exe 1/3 the size and still useable, i hoped to do the same with the AGS exe.

Tho as it is, the game runs horribly slow on older PCs. I ran it on my mothers 1ghz machine and there was a 5 - 10 sec wait between rooms, i click to walk somewhere (especiall in the larger "maze" rooms) and it spends upto 30 sec calculating the path to get there lol.. Packing would be detrimental to old PCs so im not going to bother.
Title: Re: Decreasing file size!
Post by: Gilbert on Sun 03/06/2007 06:28:59
Quote from: Radiant on Sat 02/06/2007 19:43:22
To reduce game size, use MIDI files for music rather than MPG/OGG. Also, stick to a 256-color game, 320x200 resolution, use graphics with many mono-color areas (since this improves the RLE compression that iirc is used for rooms), use the "compress sprite file" flag, and keep the room count low. Not all of these are feasible ^^

Just to clarify, room backgrounds do not use RLE, according to CJ it's a better scheme similar to ZIP (Huffman or LZ* etc.), the recent addition of sprite compression uses RLE though.
Title: Re: Decreasing file size!
Post by: Pumaman on Sun 03/06/2007 10:59:29
Quote from: Fee on Sun 03/06/2007 03:47:48
Tho as it is, the game runs horribly slow on older PCs. I ran it on my mothers 1ghz machine and there was a 5 - 10 sec wait between rooms, i click to walk somewhere (especiall in the larger "maze" rooms) and it spends upto 30 sec calculating the path to get there lol..

I'm not sure what your game does but it really shouldn't be that slow on a 1 Ghz PC, unless you've got 800x600 with loads of full-screen-sized objects and overlays.
Title: Re: Decreasing file size!
Post by: Fee on Sun 03/06/2007 14:18:55
its probly the fact that some of the backgrounds are rather large, not sure, i havnt tested it on any other machines yet.

However even on this machine (AM2 5ghz) it often pauses for 3 - 5 sec calculating the path to take.
Title: Re: Decreasing file size!
Post by: SinSin on Sun 03/06/2007 14:31:15
I dont understand why there is a pause in the game. it being a 5 ghz machiene should make it ouber fast.
Quote from: Fee on Sun 03/06/2007 03:47:48
Why? the Exe is 120 meg. Games getting a little big for somthing so crap

!!120 mb!!! thats huge...
If its crap then why is it so big??

1 quick question as i dont know the answer to this
If you put alot of unused images in the sprite library will this make the game bigger on export or not .. don't worry i havent done this
Title: Re: Decreasing file size!
Post by: Gilbert on Sun 03/06/2007 15:51:48
Did you made the walkable areas very thin or very complicated?
If this is the case, it's known that the path-finding algorithm may take more time finding paths.
Title: Re: Decreasing file size!
Post by: Fee on Mon 04/06/2007 03:20:34
yeh, in some maps they are quiet complicated wich is why id like pathfinder to not make so many way points. IMO if it cant get there in 2 waypoints, then he shouldnt move :P
Title: Re: Decreasing file size!
Post by: SSH on Mon 04/06/2007 14:23:50
Is your machine dual-core? There's a known bug in processor drivers for dual-core that can give AGS problems.
Title: Re: Decreasing file size!
Post by: Fee on Mon 04/06/2007 14:37:40
Yeh its Dule Core, however the same thing happens on the 1ghz, only it takes alot longer to calculate the path. Well... thats what i assume its doing. I also quiet often get teleported randomly around the map, always into a walkable area. Checking the area i was in before the sudden TP, its not usually a particually crowded or complicated path.

Thats what i get for having 2500x2500 maps, im sure the problem would have been worse if it let me actually have the 4000x4000 backgrounds i wanted. :P