Adventure Game Studio | Forums

AGS Development => Engine Development => Topic started by: nims on Sun 12/04/2015 13:43:57

Title: Engine to run zipped .AGS files -> .AGZ ?
Post by: nims on Sun 12/04/2015 13:43:57
Hi,

I was thinking if it wouldn't be a good idea that the engine was able to execute a zipped AGS file (a zipped AGS file. renamed to .AGZ)? I noticed that zipping my .AGS file saves 50% of the size, so it would be ideal for distribution.

What do you think?
Title: Re: Engine to run zipped .AGS files -> .AGZ ?
Post by: Ghost on Thu 16/04/2015 16:59:43
It's probably not worth the effort. I am not a pro coder but as far as I know a zipped file is no longer readable, and needs to be decompressed to allow the data to be used. Zipping them for distribution is the sensible thing, sure, but once unzipped and compared to the size of the "usual games out there" I don't think any AGS game could be called a big thing. The engine dev team will be able to answer your question better, but as far as I see it: Only a very small part of any AGS game is an actual executable. That's more or less the engine. If the engine was rather large, and could just load a chunk of assets and interpret it at run time, then your approach would not just sensible, it would be the most logical and resource friendly approach. But as it it, AGS games are almost self-contained, and zipping the upload is already the common practise, so there is little room for improvement here.

__
* Fun fact: If I had a dollar for every post complaining that a game/the engine/a module doesn't run from within a zip file, I'd have about three King Size Meals (and two extra sauces) worth of moneys. (laugh)
Title: Re: Engine to run zipped .AGS files -> .AGZ ?
Post by: Crimson Wizard on Thu 16/04/2015 17:10:24
Actually, I once wanted to propose replacing AGS data file with ZIP archive (or maybe I've already did that before?).
Many games and engines use zipped data. Ones worthy to mention are PK3 (http://en.wikipedia.org/wiki/PK3_%28file_extension%29) and PK4 (http://fileinfo.com/extension/pk4) formats used in "id Software"'s games.

OTOH, the notable peculiarity of this would be that the archive can be freely opened by anyone.

As for zipping the compiled AGS file, that could be useful if you have a lot of games on your HDD. I recall the console/arcade emulators usually let you run ROMs from zip files, for convenience.
Title: Re: Engine to run zipped .AGS files -> .AGZ ?
Post by: nims on Thu 16/04/2015 17:23:34
Quote from: Ghost on Thu 16/04/2015 16:59:43
Zipping them for distribution is the sensible thing, sure, but once unzipped and compared to the size of the "usual games out there" I don't think any AGS game could be called a big thing.
Well actually I have to disagree a little here. I am using the alpha which allows FULL HD content in 1920 x 1080 P content. I am creating a game at that size and I noticed that my current AGS file with about 8 rooms and 3 characters is already 100MB in size. The template I created for this is already 45MB in size. Zipping the file itself saves 50% in size, which I think is a huge deal. I imagine that a full blown game which will probably take multiple GB in size. Zipping them saves a lot of space and can fit a 4GB game in 2 GB.

Also note that I have the feeling that a lot of us will going to start using AGS for android and will target games for that. Since phone don't have a lot of space to spare, I would love the engine to support smaller files in this case.
Title: Re: Engine to run zipped .AGS files -> .AGZ ?
Post by: Crimson Wizard on Thu 16/04/2015 17:27:22
BTW, nims, you could try to enable sprite compression in the game settings, that should decrease the size of the game file (but will make load times somewhat longer).
Title: Re: Engine to run zipped .AGS files -> .AGZ ?
Post by: nims on Thu 16/04/2015 19:44:10
Hi CW,

I did it and here are the results:

Uncompressed sprites: Size is now 140 MB. That file zipped is 73 MB.

Enabled compression. The file is now 100MB. That file zipped is again 73MB.

I suspect that the sprite compression algorithm does it on a sprite per sprite basis, instead of a "solid"-aproach.

So I would suggest to use .zip support or change the compressed sprite aproach into a better sized solution.

Title: Re: Engine to run zipped .AGS files -> .AGZ ?
Post by: Gurok on Fri 17/04/2015 00:11:45
Zips aren't solid anyway. That's how we can read individual files from the compressed streams without decompressing the whole archive.

The difference you're seeing is probably because deflate beats AGS' RLE compression.

EDIT: Okay, now I understand what you mean about zip being a solid approach.
Title: Re: Engine to run zipped .AGS files -> .AGZ ?
Post by: nims on Fri 17/04/2015 00:14:28
Well in this case it's solid, since it's a single ags file.
Title: Re: Engine to run zipped .AGS files -> .AGZ ?
Post by: Calin Leafshade on Sun 07/06/2015 11:10:31
I agree with the idea of using plain zip files as the data format.

It makes sense to use a format that has plenty of upstream support instead of having a custom format just for AGS.

I see no downside.
Title: Re: Engine to run zipped .AGS files -> .AGZ ?
Post by: necros on Sun 24/07/2016 02:19:40
+1 7z would be even greater