Archived

This topic is now archived and is closed to further replies.

Filepackers?

This topic is 6116 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

Umm okay I need a tool that can pack several files together into one big datafile that later can be extracted...Am I making sense here? Where can I get a tool that can do that?

Share this post


Link to post
Share on other sites
Haha! :D
Erm okay...I want to pack several images (for example) into one datafile that easily can be extracted from within my program and then the images can be used...
Hope this makes mor sense

Share this post


Link to post
Share on other sites
Use pak files. Simpliest file format on the planetok that''s a complete lie, but whatever. Hyperbole).

Here''s the format, stolen verbatim from someone else (dont worry i give them credit):

Quake 2 PAK Format
___________________

Thanks and kudos to Pete McCormick (petra@force.net), who like me takes no responsibility for problems caused by use of this information.

The format of PAK files is such. The first 12 bytes of the files are the header. This is seperated into three, 4 byte blocks as follows:
-Header-
- Signature (4 bytes of char, equals ''PACK'' in ALL cases. If it doesn''t then it is not considered a pack file.)
- Directory Offset (4 bytes, single integer. Specifies the position of the first of X Directory areas in the file.)
- Directory Length (4 bytes, single integer. Specifies the length of the X dirextory areas.)
(Note: We can find the number X by dividing the length by the 64, because each directory section is 64 bytes. If the mod of this division is not zero then we have a corruption.)

-Directory section-
- File name (56 bytes of char, specifies the name of the file pointed to by the File Position data. Includes path info. ie maps/base1.bsp)
- File Position (4 bytes, single integer. The first byte(address) of the file named by File Name)
- File Length (4 bytes, single integer. The length of the file named by File Name)


Notes: Normally, the header is at the start of the file and the X number of directory areas at the very end. The file data is usually in between.

Albie Cunningham
(albert.cunningham@osi.varian.com)


Since the drawing cannot appear here i''ll summarize. The file looks like this (all binary of course):
-Header
-binary data, all mashed together
-Directory Entry
-Directory Entry
- . . .

There are as many directory entries as there are files. There is only one header.

DmGoober



Share this post


Link to post
Share on other sites
Or you could put it in a zip file, like Quake3 does. This is fast enough on modern systems (and I use that term lightly and gives you the extra bonus of reducing your filesize
Info on the zip fileformat can be found on http://www.ziron.com/links/forprog.htm, but there is a better site, I just forgot it''s url

I hope this helps you

Share this post


Link to post
Share on other sites
One note about Quake 3''s use of WinZip that I didn''t see mentioned is that a .pk3 file is just a .zip file. What''s important to note is that the .zip is UNcompressed.

Share this post


Link to post
Share on other sites
Uncompressed?

What do you mean by that?

The files are actually smaller than they would normally be. Just open up one of the pk3 files and look under the "ratio" heading.. Most of them are under 50% of the size they originally were.

If that''s not what you meant, then please explain.. thanx...


My latest engine ( still in development ) loads from .zip files. And they''re compressed.

It''s really not all that difficult, but the code for it is HUGELY phat, so I can''t really explain it here. hmmmmmmm.. That''s a good idea for a tutorial.. I''ll do that next.

~Cobra~

Share this post


Link to post
Share on other sites
Ah... maybe I''m wrong. My bad...

I thought I had read that somewhere, but didn''t confirm it before posting. If you checked, then that must be the case.

Again, sorry!

ThomW

Share this post


Link to post
Share on other sites
I''m building a PAK reader/writer (can only read and execute from a pak archive at the moment) for myself with a WinZip type interface.

http://www.voxelsoft.com/dev/pakview.zip

See if you like it. If you do, I''ll write it up tomorrow and you can register it for $10, Ok? (j/k) No, really I''ll put it out for free download next week

Share this post


Link to post
Share on other sites
I used to code in DJGPP and I used allegro as my graphics library. It had a .dat system that held images, sounds, text, anything actually and had it compressed pretty well. I forgot the url for allegro but you can follow some link there from www.delorie.com (where you get djgpp). Im currently going to use this .dat system on my next project.

Share this post


Link to post
Share on other sites