A drop-in replacement for TeamSpen210/HammerAddons postcompiler. Runs between VBSP and VRAD in the Source Engine map compile pipeline to transform entities, auto-pack assets, and combine static props.
Single native binary, zero runtime dependencies. Cross-platform Rust workspace.
postcompiler [OPTIONS] <MAP>
Arguments:
<MAP> Path to .bsp (or .vmf — converted to .bsp)
Options:
-c, --config <FILE> Path to hammeraddons.vdf
-g, --game <DIR> Game directory containing gameinfo.txt
--nopack Disable auto-packing
--nosaving Don't write the BSP back (dry run)
--regenerate Force regeneration of cached models
-v, --verbose Verbose logging (repeat for trace logging)
--propcombine Enable static prop combining
-V, --version Print version
-h, --help Print help
$bsp_exe $path/$file
$postcompiler_exe --propcombine $path/$file
$light_exe $path/$file
# Debug
cargo build
# Release
cargo build --releaseThe Linux release binary is at target/release/postcompiler.
rustup target add x86_64-pc-windows-gnu
cargo build --release --target x86_64-pc-windows-gnuThe Windows release binary is at target/x86_64-pc-windows-gnu/release/postcompiler.exe.
This target requires the MinGW linker configured in .cargo/config.toml.
Run these before tagging a release:
cargo fmt --all -- --check
cargo clippy --workspace -- -D warnings
cargo test --workspace
cargo build --release --workspace
cargo build --release --target x86_64-pc-windows-gnu
target/release/postcompiler --versionThe postcompiler reads three config files:
| File | Format | Location | Purpose |
|---|---|---|---|
hammeraddons.vdf |
Keyvalues (VDF) | Walked from map path | [postcompiler] options: game dir, auto_pack, disabled_transforms, crowbar_location, pack filters |
hammeraddons_paths.vdf |
Keyvalues (VDF) | Next to hammeraddons.vdf | |name| -> path variable expansion |
hammeraddons_game.dmx |
DMX binary | Next to gameinfo.txt | HAGame v1: tags, steamid, studiomdl paths, searchpaths, particles manifest |
18 crate workspace under crates/. See PLAN.md for full breakdown.
Core pipeline:
- Parse CLI args & config
- Read BSP (header, lumps, entities, pakfile, game lumps)
- Mount existing pakfile as virtual filesystem
- Run transforms (sorted by priority, gated by
inhibit_tags+disabled_transforms) - Apply I/O remaps (recursive output rewriting)
- Inject VScript code
- Auto-pack referenced assets (FGD-driven entity scan + BSP lump scan)
- (Optional) Propcombine: cluster, merge, and recompile static props
- Save modified BSP