🛡️ TA Archive

HPI/GAF Feature Extraction

Status: Sep 2026, internal KB. Related: Feature-Library project, TNT format skill.

HPI v1 archive format (validated against 591/591 files, TA_Features_2013.ccx; encrypted HPIs like Martian Scream!.ufo)

Header:
  0x00  char[4]  magic 'HAPI'
  0x04  uint32   version (0x00010000)
  0x08  uint32   DirectorySize   (end of directory, file-absolute)
  0x0C  uint32   HeaderKey       (encryption key field; 0 = none)
  0x10  uint32   Start           (directory begins here, usually 20)

File data

GAF format

Header: uint32 IDVersion (0x00010100), int32 Entries, int32 Unknown1
Then `Entries` × int32 pointer → GAFENTRY:
  int16 Frames, int16 Unknown1, int32 Unknown2, char Name[32]
Then frame-pointer list per entry; frame data: int16 Width, Height, XPos, YPos, ...

TNT feature table (for map feature scanning)

Feature-Library data pipeline (as built Sep 2026)

FileContent
~/ta-maps-fu/_feature_scan.pyextracts feature tables from all map zips
~/ta-maps-fu/features_scan.jsonmap → feature-name list (611 vmaps)
~/ta-maps-fu/_hpi_v2.pyfull HPI parser (open-source candidate)
~/ta-maps-fu/ccx_feature_index.jsonTDF section name → tdf/filename
~/ta-maps-fu/ccx_gaf_index.jsonGAF entry name → gaf files
~/ta-maps-fu/features_still_missing.jsonunresolvable feature names

Sources integrated (Sep 2026): TA_Features_2013.ccx (591 files), TA_Features_2011.zip (544), CCDATA.CCX from real TA:CC CD ISO via archive.org (585: acid/creon/slate sets), Tamec2004final.zip → tamechpi2004.ccx (418), AtlantisMB Features, Frenzy MFP. Coverage: 1346 plausible feature names in corpus; 576 direct + 247 Cavedog-stock covered; 544 remain (Archipelago-transition / Aquatic tileset packs: AquaOre, ArchiTree, Barrier01-23, ArchMetal) — distributed as standalone UFOs by The Pack community (ModDB Cavedog addon pages).

Sprite vs 3D-model features

Only landscape features (trees, rocks, vents, barriers) are GAF sprites. Unit wreckage and metal heaps are 3D models (objects3d/*.3do with wreck00XX textures) — the feature TDF references a 3DO, not a GAF frame. No GAF entry exists for them anywhere; a GAF-based preview is impossible. In the /features/ UI these cards show a “3D model · renders in game” badge (render: "3do" flag in features-data.json, 434 entries). Destruction states of sprite features (e.g. Lush04crisp, tree04die) are separate feature definitions and appear as their own cards.

Gotchas