Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 8th Jul 2004 23:49
Hi,

I recently looked at a sample program that I received about reading and writing to files and I noticed when I looked at it through windows explorer it had a pack file with it. Can someone explain what a pack file is an how you create one and use one ?

Unseen Ghost
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 8th Jul 2004 23:52
usually a pak file is a compressed file like a zip. usually it holds level architecture (bsp) and texture data for games.


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 9th Jul 2004 00:00
so could I just create a zip file through windows explorer and use that or not ?

Unseen Ghost
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Jul 2004 00:55
what exactly are you trying to do?

the load bsp command has a parameter for a pak file, if youre using one that holds your game data but I don't think you can just insert a zip there instead.

maybe I am not following what you are asking


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 9th Jul 2004 01:45
how do you even create a pack file to use it in games ?

Unseen Ghost
AciDucK
21
Years of Service
User Offline
Joined: 13th Aug 2003
Location:
Posted: 10th Jul 2004 00:18
Pack files (.pak or sometimes .pck) are archive files. They contain other files, just like zip, rar and ace files. The difference is that pack file are usually not compressed, while zip andn rar files are. Pack files just contain all the files within one after another without compression, so it is similar to a directory. Because of this structure you don't have to decompress the pack file in order to read the files it contains. You can access them directly by using byte offset. For example, the file "firetex.pak" contains 3 fire textures - "fire1.jpg" from byte 1 to 100000, "fire2.jpg" from byte 100001 to 200000, "fire3.jpg" from byte 200001 to 300000. So, in order to access file "fire2.jpg" you open the pack file "firetex.pak" and start reading from byte 200001.
This method is very convenient, and used a lot by game developers. Because games contain hundreds of files, and the developers don't want you to be able to copy and use the files in your own game, they put all the small normal files into several big pack files. And then you see games with up to 20 large files, instead of 2000 files. For example, Battlefield Vietnam's data folder contains the files "animations.rfa", "menu.rfa", "sound.rfa" and so on. These are pack files, they just have a different extension. You can open these files, and most of the other pack files, with winzip or winrar. Creating them and reading them from your program is fairly easy.
To create a pack file:



To read a pack file:

APEXnow
Retired Moderator
22
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 10th Jul 2004 09:07
AciDucK, nice example

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer

Login to post a reply

Server time is: 2025-06-01 09:29:16
Your offset time is: 2025-06-01 09:29:16