Skip to main content

Build system for Weissblatt PK3 files

Project description

PK3Make

"Make" for Weissblatt PK3 files

Installation

  1. Set up a virtual environment
  2. Install dependencies pip install -r requirements.txt

How to use

PK3Make supplies multiple subcommands. To get an overview type:

./pk3make.py --help

To fully build your project akin to a makefile, simply type:

./pk3make.py make ./PK3Makefile # Default PK3Makefile

Notes, Tips and Caveats

All text files are assumed to be UTF-8 encoded. PK3Make will automatically attempt to convert CRLF to LF newlines but using LF newlines is recommended.

PK3Make will not find hidden files. To avoid DuplicateLumpErrors, place your workfiles in a hidden directory, for example .local/.

Should your project contain custom palettes, place it's corresponding LUMPDEF before any graphic, flat or fade. That way, PK3Make can cache your palettes and speed up build times by reducing thread idle.

But why?

To put it bluntly: No other tools suited Weissblatt.

Although the PK3 specification for Weissblatt's engine is based on ZDoom PK3, it's directory namespaces are very different. This made Doom's usual autobuild toolkit DoomTools a poor fit for development. Due to the size of the Weissblatt project, manual assembly using SLADE was also out of the question.

I chose Python as the basis for PK3Make because it is platform-independent, easy-to-read and ubiquitous and although some Doom/Weissblatt-specific modules needed to be written from scratch for PK3Make, Python's vast standard library and otherwise mature PyPI repository helped stem some of the heavy lifting for things such as image processing.

PK3Makefile reference

PK3Make uses it's own build definition language called PK3Makefile, inspired by the METAINFO spec from Matt Tropiano's dImgConv.

PK3Makefiles are processed line-by-line with everything following # being treated as a comment. Otherwise it is split into Build Options, which define PK3Make's general behavior and LUMPDEFS, which define what files to put into your PK3 and how to build them.

Build options

Build options are specified per-line and follow the pattern

?<OPTION>: <PARAM>

PK3Make supports the following options:

?srcdir: <DIR> specifies the directory to pull it's base assets from. PK3Make will attempt to find all defined lumps within this folder and mirror it's path within ?workdir after compilation.

?workdir: <DIR> specifies the temporary working directory. PK3Make will check the timestamps between this and ?srcdir and rebuild/copy any outdated files into ?workdir during the compilation process.

?palette: defines the main color palette, by LUMPNAME (PLAYPAL by default)

?destfile: describes a filepath to the destination PK3. This is where ?workdir will get copied to during packing.

Lump definitions

Lump definitions follow the following pattern:

<LUMPNAME> <TYPE> <OFFSET>

LUMPNAME describes the filename as used in-engine. Just like the engine, it is matched against the first eight characters of the basename in a case-insensitive manner. Globbing such as D_*.mid is allowed, in which case TYPE and OFFSET are applied to all matching lumps. LUMPNAMEs starting with a "/" are treated as explicit file paths and match against the full file path, starting at the source directory.

TYPE determines how the file is treated during compilation. It can be one of the following:

  • colormap: File is a Colormap. OFFSET specifies the lump name for the palette from which it is generated
  • fade|flat: File is an image and should be converted to a flat. Only PNG images are supported.
  • graphic: File is an image and should be converted to a Doom Picture using OFFSET (see below) as a picture offset. If missing, the offset is assumed to be 0 0.
  • marker: File does not exist and is a 0-byte marker. Explicit path definition required.
  • palette: File is a graphic and should be converted to a color palette. Only PNG images supported.
  • raw: Copy the file over as-is. When preserve_filename is given in the offset, the original filename will be preserved.
  • tinttab: File is a TINTTAB. OFFSET is defined as <PALETTE> <WEIGHT>. Upon generation, PALETTE orthogonally maps each color index against one another, WEIGHT specifies a bias towards horizontal/vertical colors between 0 and 1.
  • udmf: (Not supported yet.) File is a UDMF TEXTMAP. PK3Make will generate a directory named LUMPNAME featuring:
    • <LUMPNAME>: Marker
    • TEXTMAP: Original TEXTMAP file (renamed)
    • ZNODES: UDMF BSP tree generated by PK3Make
    • ENDMAP: Marker

OFFSET defines the offset of doom pictures. For convenience, these can be either:

  • <x> <y>: Explicit X/Y-coordinates
  • center: Sets the offset to the center of the image
  • sprite: Sets the offset to width/2 (height-4). This is a very common offset for sprites placed in the game world.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pk3make-1.1.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pk3make-1.1-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file pk3make-1.1.tar.gz.

File metadata

  • Download URL: pk3make-1.1.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pk3make-1.1.tar.gz
Algorithm Hash digest
SHA256 3d7ca73967d9de749453adc3314a4581df70238e33b0a3011bd9f9ae47a92e83
MD5 e2894f18090d21c7560fdae006043a29
BLAKE2b-256 7c5c02bd0796f4ac69ac204d0b01971b3d9b782c1448309767fcd084f57ee383

See more details on using hashes here.

Provenance

The following attestation bundles were made for pk3make-1.1.tar.gz:

Publisher: python-publish.yml on liquidunderground/pk3make

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pk3make-1.1-py3-none-any.whl.

File metadata

  • Download URL: pk3make-1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pk3make-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 99cd172371852c4b1b34dfcf6b8b21b6f1dd461b589a1aa8c6d04827210f3ab0
MD5 6b80e6f2105ead35dcf205ad6ea94747
BLAKE2b-256 90ac8db3129d19d0e0dfc5c8abe900bcf63b18c5741e129463d5099bba98ab31

See more details on using hashes here.

Provenance

The following attestation bundles were made for pk3make-1.1-py3-none-any.whl:

Publisher: python-publish.yml on liquidunderground/pk3make

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page