mapdata.dat Format

mapdata.dat gives the folder of each campaign mission (see Appendix: Missions list). The entry number is the game's mission number: 0 means no mission, 1 is the Terran tutorial and 64 is the last mission of the Brood War Zerg campaign. The file only gives the folders. Which missions make up each campaign, their order, their races and their cinematics are fixed in the executable.

The file is arr\mapdata.dat in the game's MPQ archives. It is 260 bytes long: one 4-byte entry for each of the 65 missions.

The layout is the same in every version from 1.04 to 1.17, in both StarCraft and Brood War. StarCraft 1.00 to 1.03 used an older layout with 32 missions (128 bytes). That older file is still in StarDat.mpq in later versions, but it is never loaded, because the game finds the copy in BrooDat.mpq (or patch_rt.mpq) first.

The game loads the file once, when the program starts. StarEdit does not use it. If the file is longer than the layout, the game stops with a file error. A shorter file loads without an error if it ends exactly where a field ends; the missing fields then keep whatever they held before. Out-of-range values are not rejected: the game then reads whatever follows the table that the value points into.

The game loads a mission's map from \staredit\scenario.chk in its MPQ archives. The sounds played by the mission's briefing and triggers are loaded from <the file name in the map>. The game also uses the last part of each folder to find the mission that belongs to a map file of the same name (.scm files among the original missions, other files among the Brood War missions).

Mission Folder

Offset
0x0000
Length
260 bytes (4 bytes / Mission)
Description
A string number in arr\mapdata.tbl, counting from 1: 1 is the first string. The game turns it into the string itself when it loads the file. Only the lowest 16 bits are used; 0 means no string, and a number beyond the last string gives an empty string. The string is the mission's folder, for example campaign\terran\terran01.
Values
Integer value between 0 and the number of strings in arr\mapdata.tbl. In the shipped file, entry n holds n + 1.

Appendix: Missions list

Description
Every mission number, with its folder from arr\mapdata.tbl in the shipped data. Entry 0 points to the string null and is never loaded. There are no terran07 and terran10 folders.
Bits
0x00
null
0x01
campaign\terran\tutorial
0x02
campaign\terran\terran01
0x03
campaign\terran\terran02
0x04
campaign\terran\terran03
0x05
campaign\terran\terran04
0x06
campaign\terran\terran05
0x07
campaign\terran\terran06
0x08
campaign\terran\terran08
0x09
campaign\terran\terran09
0x0A
campaign\terran\terran11
0x0B
campaign\terran\terran12
0x0C
campaign\zerg\zerg01
0x0D
campaign\zerg\zerg02
0x0E
campaign\zerg\zerg03
0x0F
campaign\zerg\zerg04
0x10
campaign\zerg\zerg05
0x11
campaign\zerg\zerg06
0x12
campaign\zerg\zerg07
0x13
campaign\zerg\zerg08
0x14
campaign\zerg\zerg09
0x15
campaign\zerg\zerg10
0x16
campaign\protoss\protoss01
0x17
campaign\protoss\protoss02
0x18
campaign\protoss\protoss03
0x19
campaign\protoss\protoss04
0x1A
campaign\protoss\protoss05
0x1B
campaign\protoss\protoss06
0x1C
campaign\protoss\protoss07
0x1D
campaign\protoss\protoss08
0x1E
campaign\protoss\protoss09
0x1F
campaign\protoss\protoss10
0x20
campaign\expprotoss\protoss01
0x21
campaign\expprotoss\protoss02
0x22
campaign\expprotoss\protoss03
0x23
campaign\expprotoss\protoss04
0x24
campaign\expprotoss\protoss05
0x25
campaign\expprotoss\protoss06
0x26
campaign\expprotoss\protoss07
0x27
campaign\expprotoss\protoss08
0x28
campaign\expterran\terran01
0x29
campaign\expterran\terran02
0x2A
campaign\expterran\terran03
0x2B
campaign\expterran\terran04
0x2C
campaign\expterran\terran05a
0x2D
campaign\expterran\terran05b
0x2E
campaign\expterran\terran06
0x2F
campaign\expterran\terran07
0x30
campaign\expterran\terran08
0x31
campaign\expzerg\zerg01
0x32
campaign\expzerg\zerg02
0x33
campaign\expzerg\zerg03
0x34
campaign\expzerg\zerg04a
0x35
campaign\expzerg\zerg04b
0x36
campaign\expzerg\zerg04c
0x37
campaign\expzerg\zerg04d
0x38
campaign\expzerg\zerg04e
0x39
campaign\expzerg\zerg04f
0x3A
campaign\expzerg\zerg05
0x3B
campaign\expzerg\zerg06
0x3C
campaign\expzerg\zerg07
0x3D
campaign\expzerg\zerg08
0x3E
campaign\expzerg\zerg09
0x3F
campaign\expzerg\bonus
0x40
campaign\expzerg\zerg10