Tombstone
PackUnpack
Jun 2001 – Jul 2001 · age 19
What it was
A pair of Win32 console tools in C++ for packaging game assets, written over about a week of summer for a homemade engine. The packer read a five-line script, walked a folder tree, and wrote one pack file: a four-byte index length, an index of relative paths with offsets and sizes, then every file concatenated into a single blob. No compression, no magic number, trivially inspectable. The reader loaded the index into a binary tree, flattened it into a sorted list, and let a program open, seek, read and extract entries. A manager mounted up to 255 packs and stamped the pack number into the top byte of each resource ID, so one integer named any file anywhere. And when a loose copy of a packed file sat on disk, the reader quietly preferred it. Both tools built clean and round-tripped two sample textures. The engine never mounted them.
Wins, for the age
- At nineteen, Jeff found on their own the development loop that Doom's PWAD overrides had made famous eight years before: drop a modified file beside the game and it wins, no repacking. Jeff has seen it in every serious engine since, and met it first by writing it.
- Reinvented the header-plus-blob layout of id Software's WAD and PAK formats from first principles, and put the design effort where it belongs, in the index.
- Packed a pack slot and an entry into one 32-bit handle across 255 mounted packs. A tidy trick for a primate one year out of high school.
- Shipped two clean release builds in one day, with a working round trip to prove it.
What it taught
- The runtime reader, not the offline writer, is where an asset format earns its keep.
- Copy constructors must copy every field. This one copied three of five, so the override flag became whatever was left on the stack.
- "Not found" cannot share a value with a valid answer: ID 0 meant both.
- Walking a directory tree on Win32 needs care with
.and.., and templates in Visual C++ 6 taught why header-only templates exist.
Genealogy
Ancestors: Ant Colony: a tiled game world hungry for textures and assets on disk. Descendants: Z3D Warp Engine SDK: the same pack format, disk overrides and top-byte IDs, inside an engine DLL. Adama Platform: the storage instincts, grown up two decades later.
Epitaph
Here lies PackUnpack, which packed a folder into one file and, if you left the folder there, politely ignored the file. Engines have agreed with it ever since.