.IFF -- Skeletal Animation (FORM BOBJ)

1. Architectural Role & Engine Purpose

The IFF (Interchange File Format / EA IFF-85) format encapsulates skeletal motion-capture and keyframe animation curves in Project I.G.I. 1.

IFF animation files drive character locomotion (patrolling, sprinting, crouching, climbing ladders), weapon reload sequences, death physics reactions, and cinematic in-engine cutscenes. The container uses standardized 4-character chunk identifiers (FORM, HEAD, BONE, CHAN, DATA) to describe skeletal hierarchies and Euler rotational channel tracks.

2. Binary File Layout & Memory Map Diagram

The IFF file structure uses hierarchical nested chunks with 32-bit big-endian chunk length descriptors:

IFF ANIMATION — EA IFF-85 SKELETAL CHUNK LAYOUT 0x00: FORM Chunk Header (12 Bytes) EA IFF-85 FourCC "FORM" | Total Length (Big-Endian) | Form Type "ANIM" (0x414E494D) form[4], file_size, form_type[4] HEAD Chunk: Animation Header METADATA Duration (float seconds), Frame Count, Sample Rate (30 FPS), Bone Count head_id[4], duration, frame_count, fps, bone_count BONE Chunk: Skeletal Hierarchy SKELETON Parent Bone Indices & 4x4 Rest Matrices parent_idx (-1 for root), base_matrix[16] CHAN & DATA Chunks: Keyframe Channel Streams KEYFRAMES Rotational curves (Euler Angles) and translation tracks sampled at 30 Hz Sub-frame linear interpolation • Pelvis, spine, arm, and leg channels

3. Skeletal Animation Sampling & Skinning Pipeline Diagram

During the engine update tick, the animation controller evaluates skeletal poses and uploads matrix palettes to the GPU:

IFF ANIMATION — SKELETAL HIERARCHY & SKINNING PIPELINE 1. TIME ADVANCE • CurrentTime += dt • Compute Keyframe Sample • Sub-Frame Lerp Factor 2. CHANNEL SAMPLE • Sample Euler Rotations • Sample Root Translation • Interpolate Keyframes 3. SKELETAL PASS • Recursive Parent Mult • WorldMat = Local * Parent • Solve Foot Plant IK 4. GPU SKINNING • Matrix Palette Upload • Direct3D Model Skin • Smooth 60 FPS Pose

4. Architectural Mechanics & Engine Implementation Details

Innerloop used IFF animation chunks to achieve realistic human movements on limited CPU budgets:

  • Sub-Frame Linear Interpolation: Animations are authored at 30 Hz. When the engine runs at 60 FPS or higher, the skeletal evaluator computes linear sub-frame blends, ensuring perfectly smooth character locomotion.
  • Root Motion Decoupling: Root translation channels can be extracted to drive the physics capsule directly, preventing feet from sliding across terrain during walk cycles.

5. C++ Struct Definitions

#pragma pack(push, 1)
struct IffChunkHeader {
    char     chunk_id[4];   // "FORM", "HEAD", "BONE", "CHAN", "DATA"
    uint32_t chunk_size;    // Big-Endian chunk payload size
};

struct IffAnimHead {
    float    duration;      // Total length in seconds
    uint32_t frame_count;   // Number of frames
    uint16_t sample_rate;   // Typically 30 FPS
    uint16_t bone_count;    // Total bones in skeleton
    uint32_t flags;         // Looping and root-motion flags
};

struct IffBoneDesc {
    int16_t  parent_idx;    // -1 for root bone, else parent index
    uint16_t flags;         // Transform constraint flags
    float    rest_matrix[16];// 4x4 initial binding matrix
};
#pragma pack(pop)