Advertisement

Filepackers?

Started by March 18, 2001 09:21 AM
10 comments, last by tidilipom 23 years, 8 months ago
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?
--Peace.
http://www.winzip.com

If not, could you be more accurate?
Vox
Advertisement
lol
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

--Peace.
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



Alexander "DmGoober" Jhinalexjh@online.microsoft.com[Warning! This email account is not attended. All comments are the opinions of an individual employee and are not representative of Microsoft Corporation.]
On my site, I have a Quake(2) PAK file loader, but it''s somewhat incomplte
Celeron ][ 566 @ 850256MB PC-100 CAS2 RAMDFI PA-61 Mainboard (250MB memory bandwidth sucks, it should be 500MB)ATI Radeon 32MB DDR LEWindows 98SE
Advertisement
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
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.
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~
"Build a man a fire, and he will be warm for a day. Set a man on fire, and he will have warmth for the rest of his life"
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

This topic is closed to new replies.

Advertisement