.MTP in IGI 2 -- Model-Texture Packages

1. Architectural Role & Engine Purpose

In I.G.I. 2: Covert Strike (2003), the MTP (Model-Texture Package) format continues to serve as the binary EA IFF-85 container bundling 3D models with their associated textures (same FORM MTP container family as IGI 1).

Clear Distinction from .DAT: In IGI 2, levelN.dat remains a human-readable plain-text asset manifest. .MTP is a binary package format used to deploy self-contained multi-texture weapon systems and multi-part character assets.

2. Binary File Layout & Memory Map Diagram

The IGI 2 MTP binary structure encapsulates models, compressed textures, and instance tables:

IGI 2 MTP PACKAGE — EA IFF CONTAINER & MULTI-PASS SHADING LAYOUT 0x00: FORM MTP Container Header (12 Bytes) EA IFF-85 FourCC "FORM" (4B) | Total Container Size (uint32) | Form Type "MTP " (0x2050544D) magic[4]="FORM", form_size, form_type[4]="MTP " MODS Chunk: Model Name List MEF MODELS LE string count followed by packed null-terminated model filenames. uint32 LE count; char[] count null-terminated strings TEXF Chunk: Multi-Pass Texture Manifest SURFACE SHADERS LE string count followed by packed null-terminated texture filenames. uint32 LE count; char[] count null-terminated strings INST Chunk: Model-Texture Bindings WORLD INSTANCES One entry per MODS model (no count prefix): modelIdx + texCount + texture indices. modelIdx u32LE; texCount u32LE; texIdx[texCount] u32LE INST Before TEXF: Deferred Resolve TWO-PHASE INST appears before TEXF in file order: read all chunks first, resolve indices after. model_name = MODS[modelIdx]; textures = TEXF[texIdx] per entry Crucial Distinction: Binary Container vs Plain Text IFF vs TEXT .MTP is a binary EA IFF compound package. In contrast, levelN.dat is a plain-text token manifest. Level loading parses levelN.dat to locate .MTP packages and individual .MEF/.TEX files inside .RES.

3. Direct3D 8 Texture Binding Pipeline Diagram

The IGI 2 runtime resolves MTP bindings directly into Direct3D 8 texture stages:

IGI 2 MTP PACKAGE — MULTI-PASS MATERIAL & THERMAL IR PIPELINE 1. IFF FORM MTP PARSE • Verify FORM MTP • Read Chunk Sizes • Swizzle Big-Endian IDs 2. MODS & TEXF RESOLVE • Load Embedded MEFs • Direct3D 8 Mipmaps • Bind Surface Shaders 3. INST PLACEMENT • Decompose 3x3 Matrix • World XYZ Coordinate • Register Octree Leaves 4. THERMAL IR SHADING • Query IR Heat Value • Human: 0.95 / Wall: 0.05 • Heat Gradient Mapping 5. SCENE GRAPH MOUNT • Instantiate Entity • Frustum Culling List • DrawIndexedPrimitive

4. Architectural Mechanics & Specifications

In IGI 2, MTP instance definitions map each model to its texture list from the shared TEXF pool. Because the INST chunk appears before TEXF in file order, parsers read all chunks first and resolve MODS[modelIdx] and TEXF[texIdx] names afterward.

5. C++ Struct Definitions

#pragma pack(push, 1)
struct Igi2MtpInstanceHeader {
    uint32_t model_index;    // Index into MODS array
    uint32_t texture_count;  // Number of assigned texture indices
};
static_assert(sizeof(Igi2MtpInstanceHeader) == 8, "Igi2MtpInstanceHeader must be 8 bytes");
#pragma pack(pop)