Log in

View Full Version : need a packager for VC


Yuriy
12-12-2003, 10:57 AM
Hi,

I have a game in development on Visual C. As you know graphics goes separate, some script files, sound files to different directories. I know there are packager that put all your bunch of files into "packs" like for sound files it would be sound.pak, graphics - graphic.pak etc. So you dont have bunch of files all over after installation, but just an executable and couple of pak or dat files.

Did you guys use such software? Please advise. What's a good one etc.

Thanks

patrox
12-12-2003, 11:01 AM
you can put them in the exe or in a DLL.

LockResource etc....

pat.

Dan MacDonald
12-12-2003, 11:04 AM
There's a cool product called MoleBox (http://www.molebox.com/) that is super easy to integrate into your product and only costs about $100.

Yuriy
12-12-2003, 11:35 AM
Originally posted by Dan MacDonald
There's a cool product called MoleBox (http://www.molebox.com/) that is super easy to integrate into your product and only costs about $100.

Thanks! I will check this program. If anyone has other suggestions on software that can be used, please add comments.

PeterM
12-12-2003, 11:36 AM
Or you could store your files in a zip archive and use something like zlib to read them out when you need them.

Quake 3 uses ZIP for its pak files.

Fenix Down
12-12-2003, 01:37 PM
Originally posted by PeterM
Or you could store your files in a zip archive and use something like zlib to read them out when you need them.

Quake 3 uses ZIP for its pak files.

Yup, that's what I do (ZLIB). Shhhh don't tell anyone. ;)

mogul
12-12-2003, 01:44 PM
http://www.thinstall.com

luggage
12-12-2003, 02:02 PM
thinstall is $749!!! I'd personally go for molebox as mentioned by other people.

Karukef
12-13-2003, 01:12 AM
Of course a file-archive routine that compresses files seem nice such as using zlib to pack your files into a .pak or whatever to make it look professionally. But for developers of small downloadable games, quite a lot of space can be saved by NOT compressing your files as they appear on the users computer after installation. The reason for this is that you can almost surely find a superiour compression scheme to use on your install, and compression always work better on uncompressed data.

So dont worry about compressing anything that doesn't benefit from lossless compression, and let the install archive do that for you. You just CAN NOT BEAT a really good compressor. The best one I am aware of right now is 7-zip (free) and the even (amazingly much) better uharc which is only available for test use. The nullsoft installer supports 7-zip, but 7-zip can also be used to compress executables (i.e you install executable if you make it entire without compression).

I personally use a intermediate step between all my file loading: I have a class which I ask for a file, and this class either loads the filename directly if it exists, or looks in a flat file database of files (filenames first with offsets into the file for the actual file data) otherwise. This is something most people should be able to code in an hour or four and gives the best possible result for compression.

Siebharinn
12-13-2003, 01:15 PM
That doesn't make a whole lot of sense. What is the difference between compressing (say) 10 meg worth of assets down to 5 ahead of time, or compressing 10 meg down to 5 with the installer? True, your previously compressed archive isn't going to get compressed any further by the installer, but that's ok because it's already as small as the installer's compressor would have been able to make it.

On the other hand, if you use a non-compressing archive, like the original WAD files, then your install compressor will still get good results.

Karukef
12-14-2003, 01:56 AM
Sieb: It does make a lot of sense. The difference between using "the best available compressor" and using "the best available compressor that you can use IN your program to load from a compressed datastream" is huge simply because very few compressors are available in library or dll form. But that isn't even the biggest problem. Top quality compression uses a lot of time and memory these days, and solid archiving (saving even more safe) make loading single files almost impossible.

I have spent a lot of time looking into compressors and I know what I am talking about here. The difference between compressors is huge. RAR for example compressed a test folder with lots of game assets to 12 mb, 7zip to 9 mb and uharc to 5,6 mb!!!!!! The savings are really worth it.

Hercule
12-14-2003, 05:34 AM
Karukef how do you intergrate 7zip ?

Karukef
12-14-2003, 09:37 AM
My entire point was don't integrate it. Use uncompressed data for your game, and use 7-zip to compress the installer. Then you get maximum compression with no penalties when accessing your data.

AFAIK 7zip integration is not well documented, as the developer wishes to get paid for consulting services with 7zip ;)

Fenix Down
12-14-2003, 09:39 AM
Karukef: you can still use ZIP and ZLIB to store/read your game resources, because you can make a ZIP archive with no compression. That's what I'm planning to do coupled with 7zip. :) Saves you the trouble of writing your own flat file format, and you also get the advantage of being able to compress your resources should the need arise in the future.

Siebharinn
12-14-2003, 12:24 PM
I still don't get it. Why is it better to let the installer compress the data files over precompressing them, provided that the compressor is the same?

Fenix Down
12-14-2003, 12:53 PM
It's not better if the compressor is the same. But can you integrate a 7zip reader into your game? In that case you have nothing to gain from doing it this way. :) Well, game loading will speed up since you don't have to decompress things each time you load the game. But that's the only thing you'd gain then.

Siebharinn
12-14-2003, 01:24 PM
Which installers use 7 zip?

Dan MacDonald
12-14-2003, 01:34 PM
Innosetup has a 7-zip option i believe

Siebharinn
12-14-2003, 01:48 PM
Hmmm...7 zip is apparently open source, although it looks like you'd have to make your own dll build.

Karukef
12-15-2003, 01:15 AM
Siebharring: As I already wrote, there is a big performance hit if you want to read something as intensely compressed as 7zip. For example, it uses 64mb of memory for decompression. And then there is this thing called solid archiving which will at least add some overhead to locating a specific file if it can be done efficiently at all. Games that use compression on their actual gamedatafile use compression of approximately same caliber as zip because read speed and memory requirement is excellent. You can even achieve faster read speeds than from disk if the decompression routine is fast enough.

I'll say it again until you believe me. If you want the optimal compression possible use the lossless compressor on the entire install. If nothing else, it is guaranteed to be smaller because it can also compress your game.exe without the size/loadtime overhead an .exe compressor adds to make it uncompress itself.

xfire
12-16-2003, 12:33 PM
Greetings,
Yuriy, it's no big deal to write your own package file format. I've done it in just a few weeks and it also uses compression in case the output file is at least 1% smaller than the input file.

If anybody's interrested i'll upload the code for the tool to create an rfs (resourece file system) file as well as the code required to load the data from an rfs file.
just let me know...

elund
12-16-2003, 12:52 PM
The beta build of Nullsoft's NSIS installer (http://nsis.sourceforge.net/site/index.php) has 7-zip support (LZMA). I haven't played around with it yet, though.