PAK: Difference between revisions
Thunder4ik (talk | contribs) m (→top: clean up, replaced: {{goldsrc → {{gldsrc (5)) |
|||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LanguageBar}} | ||
'''PAK''' file formats are package formats previously used by {{gldsrc|4}} engine games to store content. It was first introduced in {{quake|4}} engine which {{gldsrc|1}} subsequently adopted it. | {{quake topicon}}{{quake2 topicon}}{{gldsrc topicon}} | ||
{{stub}} | |||
{{cleanup}} | |||
'''PAK''' file formats are package formats previously used by {{gldsrc|4}} engine games to store content. It was first introduced in {{quake|4}} engine which {{gldsrc|1}} subsequently adopted it. Unlike Quake, GoldSrc prioritizes loose files over those found in a PAK. | |||
This was changed during the '''WON/Retail''' to {{steamicon|1}} transition | This was changed during the '''WON/Retail''' to {{steamicon|1}} transition in 2003, when the game files were stored inside [[GCF]] files located in {{path|...\Steam\steamapps\username\}} folder. Since the 2013 [[SteamPipe]] update, the game file have been stored directly to the filesystem (example: {{path|...\SteamApps\common\Half-Life\valve}}), as opposed to {{source|1}} and {{source2|1}} engines (which continued to packing game files inside multiple [[VPK]] files after SteamPipe transition) as most modern systems are fast enough to load {{gldsrc|1}} game files quickly. | ||
As of today, the Steam version of {{hl|1}}, along with other {{gldsrc|1}} games are still able to load the {{path|.pak}} file despite | As of today, the Steam version of {{hl|1}}, along with other {{gldsrc|1}} games are still able to load the {{path|.pak}} file despite longer being used to store vanilla game files. | ||
{{ | {{important|PAK is often used as a generic file extension in the industry. PAK files used by other software, such as [[W:Google Chrome|Chromium]], [[Wikipedia:Unreal_Engine|Unreal Engine 4+]], or [[W:CryEngine|CryEngine]] are completely unrelated to the file format used by {{gldsrc|2}} and {{idtech2|2}}.}} | ||
{{note|[[MP3]] files ''cannot'' be packaged in a PAK file. {{confirm|This might also be the case for [[WebM]], and formerly [[AVI]].}} }} | |||
== Structs == | |||
{{license|type=gpl|version=2}} | |||
{{w|C (programming language)|C}} code from {{file|common/qfiles|h}} in [https://github.com/id-Software/Quake-2-Tools/ the original Quake II development tools]: | |||
<source lang=c> | |||
#define IDPAKHEADER (('K'<<24)+('C'<<16)+('A'<<8)+'P') | |||
typedef struct | |||
{ | |||
char name[56]; | |||
int filepos, filelen; | |||
} dpackfile_t; | |||
typedef struct | |||
{ | |||
int ident; // == IDPAKHEADER | |||
int dirofs; | |||
int dirlen; | |||
} dpackheader_t; | |||
#define MAX_FILES_IN_PACK 4096 | |||
</source> | |||
{{todo|Explain what the variable names mean, and how the structs are laid out in a PAK}} | |||
{{important|{{code|MAX_FILES_IN_PACK}} is an engine limit, not a format one. The 2023 Kex remaster of {{quake2|2}} exceeds {{code|MAX_FILES_IN_PACK}}, and as such will not load in some tools such as {{pakscape|2}}.}} | |||
== See also == | |||
* [[VPK]] - Package format used by {{src|2}} and {{src2|2}} | |||
* [[GCF]] - Package format used by Steam prior to [[SteamPipe]] | |||
* [[HLLib]] - Library which can load PAK files | |||
* {{vPKEdit|2}} - Program which can create and modify PAK files | |||
* {{pakscape|2}} - Ditto | |||
* [[PakExplorer]] - Ditto | |||
[[Category:File formats]] |
Latest revision as of 10:39, 24 January 2025



For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.
PAK file formats are package formats previously used by GoldSrc engine games to store content. It was first introduced in
Quake engine which GoldSrc subsequently adopted it. Unlike Quake, GoldSrc prioritizes loose files over those found in a PAK.
This was changed during the WON/Retail to Steam transition in 2003, when the game files were stored inside GCF files located in ...\Steam\steamapps\username\
folder. Since the 2013 SteamPipe update, the game file have been stored directly to the filesystem (example: ...\SteamApps\common\Half-Life\valve
), as opposed to Source and Source 2 engines (which continued to packing game files inside multiple VPK files after SteamPipe transition) as most modern systems are fast enough to load GoldSrc game files quickly.
As of today, the Steam version of Half-Life, along with other GoldSrc games are still able to load the .pak
file despite longer being used to store vanilla game files.




Structs

This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License; version 2 as published by the Free Software Foundation. This work is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See version 2 of the GNU General Public License for more details.
C code from
common/qfiles.h
in the original Quake II development tools:
#define IDPAKHEADER (('K'<<24)+('C'<<16)+('A'<<8)+'P')
typedef struct
{
char name[56];
int filepos, filelen;
} dpackfile_t;
typedef struct
{
int ident; // == IDPAKHEADER
int dirofs;
int dirlen;
} dpackheader_t;
#define MAX_FILES_IN_PACK 4096


