Game Development Community

How To Use A Single ZIP File For All Game Resources

by Chaim Krause · in Torque Game Builder · 11/05/2007 (10:28 am) · 4 replies

I am looking for information on this topic. I have come across bits and pieces of info that this could be done, but I cannot find the info I need.

(Why isn't this in the TDN Wiki? Why doesn't the forums search work? You angry too? Please reply to this >> http://garagegames.com/mg/forums/result.thread.php?qt=68973 )

If you can help me out, I will summarize and create a resource for others to use.

I think there is built-in support to zip up directories and distribute things that way. There is even a secret password to encrypt the ZIP file. And that you can mod the source code to change it.

Pointer to info welcome. I am more than willing to RTFM. I just cannot find the TFM!!

thanx,
chaim

#1
11/05/2007 (10:35 am)
No there is no virtual file system integrated, especially not with encrypted zip.

There are resources that give you zip with password support (although thats pointless, ZIP password protection is a joke). But I'm not sure if there are zipStream klasses to redirect the resource loaders to a zip.

This means: Lot of research for you on how the stuff works etc

the CipherLib resource might give you some ideas on how to implement a different stream system. (or you might as well just use that one and hold your files on their own but AES encrypted :)
#2
11/05/2007 (11:06 am)
Thanks Marc. I plan on going with a full wrapper soon enough, but I was looking at this for a short-term "good enough" solution for use during internal testing. I ain't giving up hope yet. (c:
#3
11/05/2007 (12:23 pm)
You can't create one zip of everything(*), but you can create zips of the inidividual mod directories. For example, zip up the common directory and rename/delete the directory itself and it should work. Same applies to your game directory. The only thing to be aware of is that the filenames within the zip should not include the name of the directory, otherwise TGB will think the files are e.g. common/common/main.cs as it uses the name of the zip (without extension) as the directory automatically.

There is lots of info around on this, try searching for mod zips. Don't know why you couldn't find it before, but it's there somewhere ;)

As far as encrypted zips goes, passworded zips have been supported since TGB 1.5. Yes, zip 2.0 encryption is weak and breakable. However, it's enough to prevent casual copying. It's also possible to implement AES encrypted zips, though not without modifications to the code.

T.

* - That's not entirely true, there's a thread somewhere about it from when TGB 1.5 was first released. In general though it's best to stick to the mod zip approach as that's well tested and supported, whereas the "VFS" code was just some proof of concept code I wrote that crept into the official release.
#4
11/05/2007 (12:44 pm)
Thanks Tom. I will try that. BTW, after reading your post I tried again and all I find are hits that discuss custom c++ code to add extra functionality. I cannot find a single hit on GG that describes what you have just explained. I am sure somebody will find it, call me and idiot, and then post the link here. I'll just sit back and wait for that to happen. :-)