Skip to content

lotr2_maps_dat_record — campaign map file record#

Header: lotr2_maps_dat_record.h

Summary#

Each record in l2_maps.dat is 0x80c1 bytes. Records are stored back-to-back with no header. Index n begins at file offset n × 0x80c1.

  • Confidence: likely
  • Record size: 0x80c1 (32961 bytes)
  • Province grid: 64×64 (0x40 × 0x40), six byte planes
  • Visible grid: 0x81×0x41 bytes at record offset 0x6000

Normative behavior: ../spec/data/l2_maps_dat.md.

Offset table#

Offset Size Field Loaded by
0x0000 0x1000 flags_plane[] lotr2_map_load_from_dat → cell +1
0x1000 0x1000 layer_a_plane[] → cell +2
0x2000 0x1000 layer_b_plane[] → cell +3
0x3000 0x1000 layer_c_plane[] → cell +4
0x4000 0x1000 layer_index_plane[] Side tables only
0x5000 0x1000 province_id_plane[] → cell +7
0x6000 0x20c1 visible_tile_plane[] lotr2_map_seed_grid_from_dat

Cell indexing (64×64 planes)#

For coordinates (x, y) with 0 ≤ x, y < 64:

i = y * 0x40 + x
byte_at(plane_base + i)

Visible grid indexing#

Row r in 0..0x80, column c in 0..0x40:

j = r * 0x41 + c
runtime_tile_index = 0xfff0000 | visible_tile_plane[j]

Side tables built during parse#

When layer_index_plane[i] != 0:

Condition Function Target
flags_plane[i] & 0x40 lotr2_map_append_province_to_layer DAT_0055b750 (6×16 lists)
flags_plane[i] & 0x80 lotr2_map_set_province_slot_pair DAT_0055ac00 (6 pairs)

max_province_id (DAT_0055aa20) tracks the maximum province_id_plane[i] where province_id < 0x11.

Python decode shape#

The reference decoder (tools/dump_l2_maps_dat.py) exposes:

{
    "record_index": 0,
    "record_size": 0x80c1,
    "max_province_id": int,
    "layer_lists": {layer_index: [province_id, ...]},
    "slot_pairs": [{slot: int, "province_id": int}, ...],
    "cells": [{"x": int, "y": int, "flags": int, ...}, ...],  # optional
    "visible_grid": [[int, ...], ...],  # optional
}

Evidence#

Claim Source
Record read size 0x80c1 lotr2_map_load_from_dat @ 0x00477610
Plane offsets +0, +0x1000..+0x5000 Nested loops in same function
Visible plane at +0x6000 lotr2_map_seed_grid_from_dat @ 0x0047781d
Tile index byte + 0xfff0000 Same function
No header/count in dat Only indexed seek; count from PL8 probe

Open questions#

  • Semantic names for layer_a..layer_c beyond copy targets
  • Whether planes can be regenerated from visible grid alone