.OLM -- Object Static Lightmaps

1. Architectural Role & Engine Purpose

The OLM (Object Layout Map) format defines the spatial placement, orientation, and script linkages for all 3D world entities in Project I.G.I. 1.

OLM version v0.10 acts as the master world entity registry. It maps 3D models (buildings, security cameras, guard posts, fences, ammo crates) to exact world coordinates using compact 16-byte descriptors (olm_item_s).

2. Binary File Layout & Memory Map Diagram

An OLM file begins with a 32-byte header with spatial world bounds, followed by the descriptor array and orientation table:

OLM OBJECT LAYOUT — WORLD ENTITY REGISTRY (v0.10) LAYOUT 0x00: OLM Header (32 Bytes) 32 BYTES Magic "OLM " | Version 0.10 | Object Count (uint32) | Valley Bounding Box Min/Max XYZ magic[4], ver_major (0), ver_minor (10), count, world_min[3], world_max[3] Entity Descriptor Array: 16 Bytes per Object (olm_item_s) 16B DESCRIPTOR Model ID (uint16), Flags (uint16, Collision/Shadow), Position X (float), Position Y (float), Position Z (float) struct olm_item_s { uint16_t model_id, flags; float pos_x, pos_y, pos_z; } Orientation Matrix Table ROTATIONS 3x3 orientation matrices for non-axis-aligned buildings Euler angles & rotation matrices Script Task Linkage Table QVM BINDINGS Links world entity index to QVM script entity ID Guard handles, security doors, alarm panels

3. World Entity Instantiation Pipeline Diagram

During level initialization, the world manager parses OLM descriptors and spawns scene graph entities:

OLM ENTITIES — WORLD INSTANTIATION PIPELINE 1. WORLD LOAD • Read OBJECTS.OLM • Inspect 16B Records • Loop Entity Count 2. MODEL LOOKUP • Fetch Model ID (.MEF) • Query Model Registry • Instantiate Mesh Ptr 3. SPATIAL INSERT • Compute World Matrix • Insert into Octree (.CTR) • Insert into Scene Graph 4. SCRIPT BIND • Link QVM Task ID • Init Guard State • Ready for Simulation

4. Architectural Mechanics & Engine Implementation Details

Innerloop designed the 16-byte OLM descriptor for massive world populations:

  • Minimal Memory Footprint: In year 2000, 10,000 world objects required only 160 KB of descriptor memory, enabling entire outdoor valleys and military compounds to fit easily in memory.
  • O(1) Spatial Sorting: World objects are bucketed into spatial grid sectors, accelerating frustum culling during flight simulator rendering passes.

5. C++ Struct Definitions

#pragma pack(push, 1)
struct OlmHeader {
    char     magic[4];       // "OLM "
    uint16_t ver_major;      // 0
    uint16_t ver_minor;      // 10 (v0.10)
    uint32_t object_count;   // Total world entity instances
    float    world_min[3];   // Valley bounding box minimum XYZ
    float    world_max[3];   // Valley bounding box maximum XYZ
};
static_assert(sizeof(OlmHeader) == 32, "OlmHeader must be 32 bytes");

// IGI 1 16-Byte Entity Descriptor
struct olm_item_s {
    uint16_t model_id;       // Model identifier in level registry
    uint16_t flags;          // Collision, shadow, visibility flags
    float    pos_x;          // World coordinate X
    float    pos_y;          // World elevation Y (Height)
    float    pos_z;          // World coordinate Z
};
static_assert(sizeof(olm_item_s) == 16, "olm_item_s must be 16 bytes");
#pragma pack(pop)