PK4

From DoomWiki.org

Revision as of 03:38, 12 May 2020 by Quasar (talk | contribs) (rephrase overly long wiki link; minor style)


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 particular 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 file size difference is significant: Doom 3’s assets are 3.6 GB uncompressed, and only 1.44 GB in their original .PK4 form.

Sources

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