Sign in to follow this  

Packfile

This topic is 4550 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I was wondering how some games build and use a pack file, to give you some examples of games who do this: *.MPQ files for Blizzard games (Warcraft, Diablo, Starcraft and WoW) *.BIG files for Homeworld. The games seem to work faster with these packfiles then, with single files. It seems to be a large collection of files in one file. Each packfile has a list of pathnames of each file. My question is how these game use them and make them (with the use of an external program or script)?

Share this post


Link to post
Share on other sites
A lot of those files are nothing but zipfiles, with the extensions changed.

Quake 3, I believe was one of these. I'm not sure about the *.mpq and *.big file types, but if you want to go for the zipfile approach, you can download the zlib library and get it to work with your code easily enough (says me, who never got it to work, but then I spent very little time on it).

Share this post


Link to post
Share on other sites
http://www.campaigncreations.org/starcraft/inside_mopaq/index.htm

Thats a good description of MPQ files even though it doesn't show the format itself. Anyway, I've built a couple pack file formats in my time and seen quite a few. The majority of the ones I've seen come in similar formats (because its simple to build them this way):

header (information on the pack file)
file information (information about the individual files)
file data (the actual files)

Even though the two you gave as examples don't do what Endar said, they're fairly similar to a zip file. So really just think of them like that. You open the pack file using your code, take out the files you want and put them in memory, and go.

Share this post


Link to post
Share on other sites
There is also an article on FlipCode on how to create a Virtual File System.
You could say Homeworld and other games that use packed files are using Virtual File Systems.

Here's the link to the first article (out of 3):
http://www.flipcode.com/articles/article_vfs01.shtml

Share this post


Link to post
Share on other sites

This topic is 4550 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this