Difference between revisions of "PK4"

From DoomWiki.org

[checked revision][checked revision]
(Created page with "'''PK4''' (or '''.pk4''') is the extension used by Doom 3. Like the PK3 format, it is actually a ZIP archive with a changed extension. Ideally, every asset used by th...")
 
m (Sources: fix link)
Line 13: Line 13:
  
 
==Sources==
 
==Sources==
{{idTech 4 ModWiki}}
+
{{idTech 4 ModWiki|{{PAGENAME}} (file format)}}
 
[[Category:Doom 3 file formats]]
 
[[Category:Doom 3 file formats]]

Revision as of 07:59, 11 May 2020

PK4 (or .pk4) is the extension used by Doom 3. Like the PK3 format, it is actually a ZIP archive with a changed extension.

Ideally, every asset used by the idTech 4 engine is stored in a .PK4 file (also known as a "pack" or "pak" file). Pack files are just normal .ZIP files with the .PK4 extension - you can use 7-Zip or a similar utility to browse or create new .PK4 files. An even easier alternative might be Pk4scape, which handles all things for the user.

If you have more than one pack file or assets in a mix of pack files and individual files here is the expected behavior of the engine:

  1. Assets inside pack files that come later in alphabetical order override assets with the same name in Pack files that come earlier.
  2. Assets as individual files override assets inside pack files.
  3. Assets in pack files or modfolders override assets with the same name in the base folder

Compression

As renamed .ZIP files, .PK4 can have compressed files inside but also uncompressed ones by using the store option in the .ZIP format. The pack files that come with Doom 3 and the Doom 3: Resurrection of Evil expansion feature compression. Although compressed pack files increase loading times, this penalty is small while the filesize difference is significant: Doom 3’s assets are 3.6Gb uncompressed, and only 1.44Gb in their original .PK4 form.

Sources

This article incorporates text from the open-content id Tech 4 ModWiki article PK4 (file format).