1. Architectural Role & Engine Purpose
The RES (Covert Strike Resource Archive) format packages all game data, terrain tiles, meshes, textures, audio, and scripts into consolidated disk volumes in I.G.I. 2: Covert Strike (2003).
In IGI 2, the resource system was significantly upgraded to include LZSS/zlib block compression, accelerated binary hash indexes, and multi-threaded streaming queues, cutting mission load times in half while packing vastly higher-resolution textures into smaller file sizes.
2. Binary File Layout & Memory Map Diagram
An IGI 2 RES archive consists of an outer ILFF/RES2 container header, a directory table, and compressed data blocks:
3. Asynchronous Streaming & Decompression Pipeline Diagram
IGI 2 uses a background worker thread to decompress assets on the fly during gameplay transitions:
4. C++ Struct Definitions
#pragma pack(push, 1)
struct Res2Header {
char magic[4]; // "RES2" or "ILFF"
uint32_t file_count; // Number of files in archive
uint32_t index_offset; // Offset to directory table
uint32_t archive_size; // Total file length
uint16_t version_major; // 2
uint16_t version_minor; // 0
uint32_t flags; // Sector alignment flags
};
struct Res2Entry {
uint32_t name_hash; // 32-bit CRC hash
uint32_t data_offset; // Offset in data stream
uint32_t packed_size; // Compressed size
uint32_t unpacked_size; // Decompressed size
uint16_t compression; // 0=Raw, 1=LZSS, 2=Deflate
uint16_t asset_type; // Asset category ID
uint32_t reserved;
};
static_assert(sizeof(Res2Entry) == 28, "Res2Entry must be 28 bytes");
#pragma pack(pop)