PKZLib is a C++ library, which aims to recreate parts of the Goliath Engine, created by Beenox, so they can be usable in modern projects, with the main goal being accurate reading/writing for the engine's proprietary formats. This includes chunk handling, and a Package Manager for multiple package files at once.
BaseUtils is what powers the Goliath Engine's math, logic, and any algorithms implemented in the games. PKZLib contains accurate recreations of the BaseUtils system.
Header-only C++17, except Graphics/XenosTexture.cpp and BaseUtils/BUPng.cpp, which build into the
pkzlib_textures library on the thirdparty/textures submodules (ReXGlue, libsquish, stb). zlib (contrib/zlib)
is needed for the .pkz container.
git submodule update --init
cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build out
out/pkzlib_selftest
Consumers link the pkzlib INTERFACE target.
tools/pkzfields.py walks a raw .pak chunk tree and decodes leaf payloads
with composable XML schemas. Engine-wide layouts live in
schemas/goliath.xml; title-specific layouts stay in separate files instead
of entering the C++ parser.
# Decode common package/resource fields.
python tools/pkzfields.py game.pak --chunk GenSub_ResourceHeader
# Add Spider-Man: Edge of Time layouts and inspect its world draw table.
python tools/pkzfields.py level.pak --game eot \
--chunk RenderOctree_Prims --max-records 8
# Machine-readable output for corpus analysis.
python tools/pkzfields.py game.pak --game eot --json > fields.json