Author Topic: Engine to run zipped .AGS files -> .AGZ ?  (Read 3492 times)

Engine to run zipped .AGS files -> .AGZ ?
« on: 12 Apr 2015, 13:43 »
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?

Ghost

  • AGS Baker
  • Rottwheelers
  • Time to give up.
    • Ghost worked on one or more games that won an AGS Award!
    •  
    • Ghost worked on one or more games that was nominated for an AGS Award!
Re: Engine to run zipped .AGS files -> .AGZ ?
« Reply #1 on: 16 Apr 2015, 16:59 »
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)
« Last Edit: 16 Apr 2015, 17:02 by Ghost »

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Engine to run zipped .AGS files -> .AGZ ?
« Reply #2 on: 16 Apr 2015, 17:10 »
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 and 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.
« Last Edit: 16 Apr 2015, 17:15 by Crimson Wizard »

Re: Engine to run zipped .AGS files -> .AGZ ?
« Reply #3 on: 16 Apr 2015, 17:23 »
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.

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Engine to run zipped .AGS files -> .AGZ ?
« Reply #4 on: 16 Apr 2015, 17:27 »
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).

Re: Engine to run zipped .AGS files -> .AGZ ?
« Reply #5 on: 16 Apr 2015, 19:44 »
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.


Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    • I can help with proof reading
    • I can help with scripting
    • Gurok worked on one or more games that won an AGS Award!
    •  
    • Gurok worked on one or more games that was nominated for an AGS Award!
Re: Engine to run zipped .AGS files -> .AGZ ?
« Reply #6 on: 17 Apr 2015, 00:11 »
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.
« Last Edit: 17 Apr 2015, 01:11 by Gurok »

Re: Engine to run zipped .AGS files -> .AGZ ?
« Reply #7 on: 17 Apr 2015, 00:14 »
Well in this case it's solid, since it's a single ags file.

Calin Leafshade

  • Long live King Cat!
    • I can help with making music
    • I can help with voice acting
    • Calin Leafshade worked on one or more games that won an AGS Award!
    •  
    • Calin Leafshade worked on one or more games that was nominated for an AGS Award!
Re: Engine to run zipped .AGS files -> .AGZ ?
« Reply #8 on: 07 Jun 2015, 11:10 »
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.

Re: Engine to run zipped .AGS files -> .AGZ ?
« Reply #9 on: 24 Jul 2016, 02:19 »
+1 7z would be even greater