Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Cyberdemon531

What do .pk3 files do that .wads don't?

Recommended Posts

Some mods I get are .pk3s with a bunch of files in them, like KDiZD and Stronghold. I was wondering what 'features' .pk3s hold and why some use them instead. Thanks.

Share this post


Link to post

The only real difference is that .pk3 files are merely compressed zip archives. As such:

  • They are compressed, reducing the filesize [usually] significantly.
  • They allow for a directory structure, with "files inside of folders".
  • They can be opened with any archival utility such as WinZip.
So for the developer, they offer greater maintainability and organization, and for the player, they offer a smaller filesize compared to a wad file.

Edit: meh, I'm too slow. :(

Share this post


Link to post
Manhunt21 said:

Then, if they're so great. How come people don't always use them? Just curious.


Because they're only supported by advanced ports (I think just zdoom and it's derivatives). Also because it's not always needed, a single map using only stock textures doesn't take up enough space to be compressed and doesn't really need an organized file system.

Share this post


Link to post

Exactly. PK3 are useful for large-scale collaborative projects with a lot of custom content. Don't forget that a mod like Stronghold does not just have map lumps and texture lumps, it also has a ton of text lumps for content definition (mostly but not only DECORATE code for custom actors), and it's a lot more practical for maintenance if you can put them all in separate files in a subdirectory. The alternative being just a giant lump in a WAD where you have to scroll for hours to find what you need to edit, or an endless series of lumps with nigh-identical names.

Something like a Community Chest, on the other hand, does not need a PK3 structure as much.

The drawbacks of PK3 is that these are not standard Doom specs, which means that:
- They're not supported by all ports
- Ports that do support them do not necessarily use them in the same way, so a jDoom PK3 file has a different directory tree to a ZDoom PK3 or a Vavoom PK3.

Share this post


Link to post

And just for completeness, I'll add my £0.02 about how I think pk3 is an annoying name to use.

.PK3 is the name used for Quake3 (and derivative games) data files. In Quake a PK3 file is nothing more than a ZIP file that has been renamed. This is also true for Doom supported PK3 files but Doom has no real connection to the Quake series of games and other id games where the PAK, PK2, PK3, PK4 series of names at least makes sense from a logical progression point of view. However, for some reason, the Doom community fixated on the rather specific PK3 extension.

The expected internal structure of a Quake3 PK3 file is different to what is expected by Doom ports that support "PK3" files. So, if a PK3 has any standardised definition in Quake3, it would be a ZIP file with a particular internal directory structure that is set up to provide the various game resources required and expected by the Quake3 engine. If you accept that, the so-called PK3s that Doom ports use aren't really PK3s anyway.

Doom "PK3s" are merely renamed zip files that share a 3 letter extension with another game (Quake3) that also uses renamed zip files but the internal layout of these files are different.

The extension could have been something far more meaningful for Doom ZIP files (ie something that identifies it specifically as a compressed archive intended for use with a Doom port - eg .DMZ?) but, for whatever reason, the first people to put them together started calling them PK3 files and it was therefore set.

Despite this, any extension you like will work. eg if you rename myfile.zip to myfile.sex and load it like this zdoom -file myfile.sex it will work just as well as if you had called it myfile.pk3 (and loaded it appropriately).

And now, of course, Zdoom also supports 7zip files so some people are now using PK7 to distinguish them from so-called PK3 files.

Share this post


Link to post

As long as it has an extension that's not .zip, I'm fine with whatever naming scheme so long as we know what it is. :P

Tips for Alienating your Playerbase (and annoying Xaser) #293: give the .zip extension to a game file meant to be opened in (Z)Doom. This way, people will have no clue that it wasn't meant to be downloaded into the usual temporary directory so its contents can be dumped somewhere like every other .zip in existence.

Share this post


Link to post
Enjay said:

.PK3 is the name used for Quake3 (and derivative games) data files. In Quake a PK3 file is nothing more than a ZIP file that has been renamed. This is also true for Doom supported PK3 files but Doom has no real connection to the Quake series of games and other id games where the PAK, PK2, PK3, PK4 series of names at least makes sense from a logical progression point of view.

PK2 is not an id software format. Quake II used pak files as well IIRC. If you find a PK2 file, it's a lot more likely that it's for Silkroad Online, some Korean MMORPG you may not have heard about.

Xaser said:

Tips for Alienating your Playerbase (and annoying Xaser) #293: give the .zip extension to a game file meant to be opened in (Z)Doom.


Tip for annoying me: put your pk3 file in a zip. It's redundant and I can play any other ZIP file directly in ZDoom without having to extract it first.

Share this post


Link to post

ZDZ would have been a decent extension name (ZDoom ZIP).

Gez said:
Tip for annoying me: put your pk3 file in a zip. It's redundant and I can play any other ZIP file directly in ZDoom without having to extract it first.

First I thought "ah, but if you distribute it unpacked the time stamp is lost"... but the ZIP keeps the timestamps of everything it contains, so that doesn't really matter.

Share this post


Link to post

Besides, using the file name extension as a means of signalling anything about the actual format of the file is unnecessary.

Tip for annoying me: put your pk3 file in a zip. It's redundant and I can play any other ZIP file directly in ZDoom without having to extract it first.

FYI: it is not necessary to extract first for use with Doomsday. I suspect the reason this practice proliferates is because users see the same structure used in the big resource packs.

Share this post


Link to post

DaniJ said:
Besides, using the file name extension as a means of signalling anything about the actual format of the file is unnecessary.

I find it helpful. A ZIP is generally taken to be an archive to be extracted. A new extension tells people it's a game file for ZDoom immediately, without having to consult documentation or without having to investigate it with an extracting utility.

Share this post


Link to post

I do not find it helpful as apps which could otherwise open and use it cannot 'see' it, as its got some made up name.

Edit: Remember that PK3/WAD/PAK/whatever are just containers. Any additional 'format' applied to their internal structure is the application's domain.

Share this post


Link to post
myk said:

ZDZ would have been a decent extension name (ZDoom ZIP).


I think Doomsday had PK3 files before ZDoom did. Though it was long before I got involved in this community so I'm not sure.

DaniJ said:

FYI: it is not necessary to extract first for use with Doomsday. I suspect the reason this practice proliferates is because users see the same structure used in the big resource packs.

Maybe. But while GZDoom has some code to load hi-res textures in a Doomsday pack (taken from ZDoomGL if I'm not mistaken), the rest of the structure is not compatible between the two ports (e.g. GZDoom will not find the maps in a Doomsday PK3, and vice-versa) as far as I know.

Share this post


Link to post

Sadly you are correct Gez. For some reason ZDoom opted to use a different structure to Doomsday when implementing ZIP support.

Doomsday treats an archive (ZIP/WAD/lump directory) as virtual extensions of it's working/base/runtime file systems (i.e., it remaps their internal structure into one or more of the engine's absolute paths). AFAIK there is nothing preventing us supporting the same structure as ZDoom.

Share this post


Link to post

DaniJ said:
I do not find it helpful as apps which could otherwise open and use it cannot 'see' it, as its got some made up name.

That's a drawback, but then, some benefits are incompatible. One benefits players (which are the first and often least knowledgeable users) and the other mod makers. Good compression utilities will open them anyway, just not by default. I personally added PK3 as an extra file type to be opened with 7-zip, and would do the same for an established port-specific one (or a DOOM-generic one).

Share this post


Link to post

You should note that by inventing an unnecessary file naming extension/convention you are in fact intervening in their 'normal' usage. I now need to consult the port's documentation to figure out I could have just opened it in WinZip.

Lets just disregard the DOOM environment for a second. What would you say if I decided to use PDF for new Doomsday documentation - only I renamed it DDF (heh)?

Share this post


Link to post

Normal usage to a player is to use a mod to play a game, not to extract files.

It might also depend on the engine's focus. An engine that expects users to potentially take customizing before running a mod (Doomsday?) may prefer to make access to the internal contents more straightforward, but another that focuses on quick and easy usage (ZDoom?) might benefit from a custom extension.

Share this post


Link to post
myk said:

Normal usage to a player is to use a mod to play a game, not to extract files.

It might also depend on the engine's focus. An engine that expects users to potentially take customizing before running a mod (Doomsday?) may prefer to make access to the internal contents more straightforward way, but another that focuses on quick and easy usage (ZDoom?) might benefit from a custom extension.

I don't think you are following myk. Its the other way around in this instance:

Doomsday can load nested ZIP archives whereas ZDoom can not. Thus, in this respect Doomsday is 'easier' under 'normal' usage (i.e., playing as opposed to modding) when dealing with resources structured in this way.

Edit: for the record there is no 'Doomsday PK3 structure'. Our archive reader implements a set of rules which on load, will automatically map files into other parts of the virtual file system. In addition to these default rules the mod author can use a set of mnemonics and naming conventions to instruct Doomsday to relocate both files and directories anywhere they want (relative to the base directory). If we are to support ZDoom's ZIP archive structure (it has been requested) then it would likely be done similarly (a new set of rules).

Those ports which think they have implemented support for Doomsday's structure are very much mistaken. From what I've seen, all they've actually done is add special case remapping of '/textures' and '/flats'...

Share this post


Link to post

Ah, I didn't know about that Doomsday feature. I see why you wouldn't need a game-specific extension. Although what I'm saying applies to ZDoom, as it stands.

bgraybr said:
Because they're only supported by advanced ports

Heh, that's technically correct, although I use ZIPs with vanilla by using batch files that extract the contents to a temp folder and then delete them after use.

Share this post


Link to post
Gez said:

Tip for annoying me: put your pk3 file in a zip. It's redundant and I can play any other ZIP file directly in ZDoom without having to extract it first.

An other reason to do this: Clumping the readme together with the pk3, rather than putting it inside the mod.

Of course, having pk3s inside zips doesn't bother me because I use a launcher that temp extracts zips and loads their contents in whatever port I use. ;)

Share this post


Link to post

So many things break for me by leaving them in the ZIP files that it's just a habit for me to extract ZIP-distributed mods before playing them. Therefore, it's more irritating to me to find that the ZIP I just downloaded should not be extracted but ran as-is than it is to open a ZIP and find a PK3 inside (which yes, I prefer doing because I can bundle text and other support files that aren't necessarily part of the mod along with it).

Share this post


Link to post
DaniJ said:

Doomsday can load nested ZIP archives whereas ZDoom can not.

It could (the mechanism for loading embedded wads already has the same code for loading embedded zips, it's just commented out), but the developers don't want to allow it. I've made personal builds where it works by the way.

I think it has to do something with memory consumption. From what I understand, an embedded archive is still a lump, so to access any of the embedded archive's data, the entire archive must be loaded in memory. So embedded wads take up a lot more memory than if they're repackaged as PK3. One especially infamous mod in particular, renowned for the sheer size of its distribution (several hundred megabytes), has been forced to be repackaged as a PK3 for its fifth major version because of that.

DaniJ said:

If we are to support ZDoom format mods (it has been requested) then it would likely be done similarly (a new set of rules).

Good luck with that. There would be a ton of work, between DECORATE, ACS, the countless control lumps, and all the features that already exist in Doomsday but are implemented differently... It'd practically require a dedicated jZDoom plugin!

But just the ZDoom PK3 folder structure as one of the default rules would make sense, because that's the structure used as well by Doom Builder 2 and SLADE 3.

Jodwin said:

An other reason to do this: Clumping the readme together with the pk3, rather than putting it inside the mod.

Heh, I always put it in the mod, if there's not a copy already there, and delete the external file afterwards.

Share this post


Link to post
Gez said:

I think it has to do something with memory consumption. From what I understand, an embedded archive is still a lump, so to access any of the embedded archive's data, the entire archive must be loaded in memory.

Indeed you are correct. However I don't consider this much of an issue as an efficient caching scheme can make up for most of the hindrances. Its not like you need to keep it all in application-local memory, all the time.

Gez said:

Good luck with that. There would be a ton of work, between DECORATE, ACS, the countless control lumps, and all the features that already exist in Doomsday but are implemented differently... It'd practically require a dedicated jZDoom plugin!

I was just referring to ZDoom's PK3 folder structure. I have no interest in re-inventing GZDoom.

Share this post


Link to post
Gez said:

PK2 is not an id software format...

Thanks for the clarification. To be fair, I wasn't sure that PK2 even existed but (without anything handy to actually check) I figured that with Quake uaing PAK files and Quake3 using PK3 files, it was a reasonable guess that Quake2 had used PK2 files. My mistake.

However, it kind of backs up my point even further in as much as id deliberately jumped over PK2 to use PK3 because the name tied in with the name of the game that they were specifically meant for - which was not Doom. ;)

Gez said:

Tip for annoying me: put your pk3 file in a zip. It's redundant and I can play any other ZIP file directly in ZDoom without having to extract it first.

Uploads to idgames excepted, presumably, where zip files containing the playable file plus a text file are supposed to be uploaded.

DaniJ said:

Besides, using the file name extension as a means of signalling anything about the actual format of the file is unnecessary.

I disagree. However, the usefulness is not from the program POV but primarily for the user.

Take, as an example, the DMD model format. When I see the DMD extension, I know that it is a model but that it is not one that any of my modelling programs can access. However, I also know that I can use the command line util to convert it to an MD2 and then I can work with it. None of my programs need to know that, but I do and the extension tells me.

Contrast that with PK3. I used to know that when I had a PK3 file, I could open it with Winzip and I would expect things inside to be laid out in a manner appropriate for the idtech3 engine and the resources etc would be of a type that I would expect to find in such a game. Now I have a bunch of files where it is very easy to forget whether they are idtech3 files or Zdoom files and this does cause me (minor) problems when working with these files.

And, of course, using something other than zip signals that the file is not meant to be opened for playing (as has already been mentioned) and also prevents Windows trying to pretend that it is a directory too.

In most programs, as you pretty much said, the file extension is actually used for little more than file filters and if a program is forced to load something with a non standard extension, then the program will probably load it provided the data is in a correct format. However, such an extension is likely to cause user confusion ("what's a .SEX file and how do I use it?")

So, whilst I agree that just having "some made up name" would be a bad idea, I do think that a name other than PK3 should have been picked and agreed on as a standard because using PK3 for Doom files is misleading, inappropriate and not consistent with the contents of what idtech3 PK3 files contain. However, I also think that it is too late and PK3 has been used so often that it is now regarded as the "correct" name and PK7 is also creeping in as a standard too.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×