Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Editing .pak

From Quake Wiki

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
'''.pak''' is Quake's container file format. It is an exceedingly simple uncompressed archive format (collection of folders & files) which preserves file paths and that's about it. There are many [[Quake_tools#PAK_Editors|tools for working with .pak files]].
+
'''.pak''' is Quake's container file format. It is an exceedingly simple uncompressed archive format which preserves file paths and that's about it. See [[Quake_tools#PAK_Editors]] for a list of tools to work with .pak files.
 
 
== Overview ==
 
PAK files are commonly used to store data to be loaded by a Quake game [[engines|engine]]. The data may include graphics, objects, textures, sounds, and other game data.
 
 
 
Filenames inside PAK files are restricted to a maximum length of 56 characters<ref>Unofficial Quake Specs, http://www.gamers.org/dEngine/quake/spec/quake-spec34/qkspec_3.htm#CPAKF (Note that 0x38 is actually 56, not 50)</ref>. Sub-directories inside the PAK file are part of this. For example a file ''foo.bsp'' in a directory ''maps'' would technically have the name ''maps/foo.bsp'' which has a length of 12 characters.
 
 
 
Quake engines usually load the [[pak0.pak]] file in the ID1 subfolder, plus whatever other PAK archives they find in the game directory (subfolder) they're told to use. The PAKs are treated exactly the same as if their contents were extracted into separate files, rather than being packed together in one PAK archive.
 
 
 
PAK files are typically named ''pak0.pak'', ''pak1.pak'', ''pak2.pak'', and so on. The [[pak0.pak]] which comes with Quake and lives in the ID1 folder is required by all Quake game engines.
 
 
 
== File precedence ==
 
[[File:Quake_File_Folders_Hierarchy.png|right|200px|caption]]
 
Since a file might exist in the same path in multiple pak files and the game directories (ID1 and mod), precedence is important to know about.
 
 
 
Consider a map <code>maps/start.bsp</code> existing in the following files and paths:
 
* <code>id1/pak0.pak:maps/start.bsp</code>
 
* <code>id1/pak1.pak:maps/start.bsp</code>
 
* <code>mod/pak0.pak:maps/start.bsp</code>
 
* <code>mod/maps/start.bsp</code>
 
 
 
Generally the engine will prefer the one from the last PAK file in the path hierarchy, so in this case the file from the mod's <code>pak0.pak</code>.
 
 
 
But some modern engines will actually prefer a file outside PAK files over PAK files in the same mod path. So for example [[FTE]], [[Darkplaces]] or [[QuakeSpasm-Spiked]] will use the unpacked <code>mod/maps/start.bsp</code> which (editor's subjective opinion) is infinitely more reasonable.
 
  
 
== Format specification ==
 
== Format specification ==
 
All numerical values are in little-endian (Intel) format.
 
All numerical values are in little-endian (Intel) format.
  
Header (12 bytes):
+
Header (64 bytes):
  
 
{|class="wikitable"
 
{|class="wikitable"
Line 171: Line 148:
 
</pre>
 
</pre>
  
==Notes==
+
== See also ==
<references />
+
* [[Quake file formats]]
 
 
{{Quake file formats}}
 

Please note that all contributions to Quake Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see Quake Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)

Template used on this page: