Packaging resources

From Doomsday Wiki
Jump to: navigation, search

This article is a stub. You can help by expanding it.

This article describes preferred conventions for packaging resources for Doomsday 2.0.

How ZIP files are treated

The engine does not differentiate between regular directories and the contents of ZIP files. In the internal file system, ZIP files appear as directories. Their contents can be modified as if they were regular directories/files. This applies to creating/deleting files/subdirectories, and reading/writing files.

ZIP files with the file name extension .zip, .pk3, .pack, .addon, .box, .demo, .savegame, and .map are all treated as ZIP files in the file system — their contents can be accessed just like they were regular directories.

Nesting ZIPs

A ZIP file can contain any number of nested ZIP files. They are treated just like every other ZIP file. Note that when accessing a nested ZIP file inside another ZIP file, a copy of the entire nested ZIP file is kept in memory. (Contents of unnested ZIP files are only kept in memory when caching individual decompressed entries.)

Note that the two cases below are identical from the engine's point of view:

  1. ZIP containing nested ZIPs:
    • (ZIP)
      • sub1.pack (ZIP)
        • subsub.pack (ZIP)
      • demonstration.demo (ZIP)
  2. ZIP containing unzipped subdirectories:
    • (ZIP)
      • sub1.pack/ (directory)
        • subsub.pack/ (directory)
      • demonstration.demo/ (directory)

For performance/memory consumption reasons, one might want to only use an actual ZIP file at the top level.

Resource packaging conventions