Installer Compression

Member
Posts: 81
Joined: 2007.07
Post: #1
My last game I distributed as a simple zip file. My new game is much larger and I was hoping to get better compression than LZW. Is there a way to configure zip to use something better than LZW or can the mac Installer program use a better compression than LZW (something like LZMA)?
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
Installer? Really? It's extremely rare for a game to have a legitimate need to be distributed in anything more than a drag-and-drop DMG, which is far better for users, so I'd first suggest reconsidering that.

That aside, is there some reason you can't build an uncompressed DMG and distribute an archive of it in some format other than zip (say, bz2) that gives you the compression ratio you want?
Quote this message in a reply
Member
Posts: 81
Joined: 2007.07
Post: #3
Can you create a DMG file with bz2 or LZMA compression without having to wrap it again? When you download a bz2 wrapped DMG file does OS X automatically unzip it and present the DMG file to the user?
Quote this message in a reply
Moderator
Posts: 452
Joined: 2008.04
Post: #4
I'll echo Alex's response. It's very uncommon for Mac users to see installers, except for system components and really large applications that throw stuff all over your drive (photoshop installs adobe crap all over).

A zip or a dmg are both fine. How big is your new game? And how much of a difference is there between the different compression formats? You might be better off by actually trying to reduce the size of your game (compressing the music, running optipng on your textures, sizing them appropriately, slightly reducing color depths, etc)

Howling Moon Software - CrayonBall for Mac and iPhone, Contract Game Dev Work
Quote this message in a reply
Member
Posts: 81
Joined: 2007.07
Post: #5
I don't want an installer or care about one, sorry I must be using the wrong wording. Using a zip file or DMG file is fine, I'm just trying to see if there are options to make it smaller when creating the zip or dmg file, by using a different compressor.

My game data is already highly compressed, using jpg and ogg where possible.

To give you an idea of why you should be looking at this is, zip compresses my data to 105MB, while LZMA achieves 74MB, quite a huge difference and well worth it for the user if they are on a slower connection!
Quote this message in a reply
Moderator
Posts: 452
Joined: 2008.04
Post: #6
Okay, that sounds good Rasterman. That's a pretty significant size difference. Out of curiosity, I'd try putting your game in a compressed dmg. That uses bzip2 compression, as I understand it. I guess it probably won't be quite as good as LZMA... but the weakness of the zip compression is that it doesn't benefit from similarities between multiple files in your archive, since each file is compressed individually.

Howling Moon Software - CrayonBall for Mac and iPhone, Contract Game Dev Work
Quote this message in a reply
Member
Posts: 81
Joined: 2007.07
Post: #7
I discovered I can make a zip file with bzip2 compression with 7zip, I'm not sure if Mac opens and installs it like a normal zip file though, looks like its close to lzma, so that is a good option if the download to install is just like a normal zip.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #8
Why all the pain with the weird archive formats? While noble to try to get the download sizes down, it's not worth its a lot more work for you or relies upon the user having the fanciest compression programs installed on their computers.

.zip files get mediocre compression partly because each file is compressed separately. Neat if you only want to get one file out of the archive, useless in the internet age. If you put it on a DMG and then compress that, you won't have the same issue and you can compress it with something like bzip2 which you can guarantee that any Mac user will be able to decompress.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Moderator
Posts: 452
Joined: 2008.04
Post: #9
Compressed dmgs are bzip2 and Mac users are used to the format. It works on all their machines and they won't even know it's compressed.

Howling Moon Software - CrayonBall for Mac and iPhone, Contract Game Dev Work
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #10
Not all compressed DMGs are bzip2; most are gzip, it's not necessarily straightforward to create a bzip2'd DMG, and versions of Mac OS X prior to 10.4 (?) can't extract bzip2'd DMGs.
Quote this message in a reply
Member
Posts: 45
Joined: 2008.04
Post: #11
Alternatively you could package all your game assets into a custom format that is decompressed on demand when your game loads, i.e. like doom ".wad" files. That way you have complete control over the compression of your assets regardless of the actual distribution packaging (dmg/zip) used for your application.
Quote this message in a reply
Member
Posts: 81
Joined: 2007.07
Post: #12
OneSadCookie Wrote:Not all compressed DMGs are bzip2; most are gzip, it's not necessarily straightforward to create a bzip2'd DMG, and versions of Mac OS X prior to 10.4 (?) can't extract bzip2'd DMGs.

Thanks for that bit of info, sounds like I'll be sticking with the normal zip file. I tested gzip compression, its only 1MB or so better than normal zip so no point in using it.

Also OSX 10.5.8 cannot decompress a .zip file compressed with 7zip using bzip2 compression, so that's out.
Quote this message in a reply
Member
Posts: 81
Joined: 2007.07
Post: #13
aBabyRabbit Wrote:Alternatively you could package all your game assets into a custom format that is decompressed on demand when your game loads, i.e. like doom ".wad" files. That way you have complete control over the compression of your assets regardless of the actual distribution packaging (dmg/zip) used for your application.

Yeah I thought of that, but customizing game code for this is not worth it for me, another thing I thought about doing is using installer script to do a custom decompression of the data, but since you guys are shooting me down me on every front I try to pursue with this it doesn't sound like its worth it. I can't believe OS X doesn't have better built in compressors for zip Sad
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Automatic creation of app bundle in dmg installer peterp 7 4,923 Feb 24, 2010 01:22 PM
Last Post: cmiller
  Installer for Mac Thenend 8 4,818 Nov 2, 2005 05:54 PM
Last Post: Duane
  Best Compression Choice Jake 20 7,806 Jun 24, 2005 07:06 PM
Last Post: Jake