How the game loads a map
StarCraft reads a map up to three times, and each read uses only the sections it needs: a
short read for the map list, a longer one when a game starts, and one more for the
briefing. Before each read it checks VER, which must be 59, 63 or 205.
Remastered also accepts 64 and 206; see Revisions.
| Read | When | Sections, in the order the game handles them | Fails with |
|---|---|---|---|
| Map list | When the map list shows the map, when a game is created, and again when it starts | VER␠, DIM␠, ERA␠, OWNR, SIDE, STR␠, SPRP, FORC, VCOD |
Invalid Scenario |
| Melee start | When a game of any type but Use Map Settings starts | VER 59 and 63: STR␠, MTXM, THG2, UNITVER 205: STR␠, MTXM, THG2, UNIT, COLR |
Error loading scenario file. |
| Use Map Settings start | When a Use Map Settings game starts | VER 59 and 63: STR␠, MTXM, THG2, MASK, UNIS, UPGS, TECS, PUNI, UPGR, PTEC, UNIx (if present), UPGx (if present), TECx (if present), PUPx (if present), PTEx (if present), UNIT, UPRP, MRGN, TRIGVER 205: STR␠, MTXM, THG2, MASK, UNIx, UPGx, TECx, PUNI, PUPx, PTEx, UNIT, UPRP, MRGN, TRIG, COLR |
Error loading scenario file. |
| Briefing | When the briefing room of a Use Map Settings game opens | STR␠, MBRF |
Nothing. The game continues without a briefing |
A read fails at the first required section that is missing, or at the first copy of a section that the game rejects. Sections read before the failure stay loaded, but loading stops there.
The map list read runs again when a game is created and when it starts, so every map needs its nine sections. A map that lacks one is shown in the list but cannot be selected.
Melee and Use Map Settings#
The game type decides which sections the second read uses. Every type except Use Map Settings (Melee, Free for All, One on One, Capture the Flag, Greed, Slaughter, Sudden Death, Top vs Bottom and the team types) reads four sections: the strings, the terrain, the sprites and the units, plus the colours in a Brood War file. It never reads the map's triggers, locations, fog, unit settings, upgrades, abilities or availability.
Of the placed units, such a game keeps only the start locations and Player 12's mineral
fields, geysers and critters (UNIT). Of the unit sprites, it keeps only Player
12's (THG2).
Use Map Settings reads all the other sections that affect play.
What a map needs#
The smallest file each kind of game will load:
| A map for | Needs |
|---|---|
| Melee and the other game types | VER, DIM, ERA, OWNR, SIDE, STR, SPRP, FORC, VCOD, MTXM, THG2 and UNIT, and COLR in a Brood War file (VER 205). Remastered also needs TRIG, and accepts STRx in place of STR in a VER 64 or 206 file. |
| Use Map Settings | All of those, and MASK, PUNI, UPRP, MRGN, TRIG and five settings tables: UNIx, UPGx, TECx, PUPx and PTEx in a Brood War file (VER 205 or 206); UNIS, UPGS, TECS, UPGR and PTEC in a VER 59, 63 or 64 file |
THG2 can be empty when the map has no sprites. Every other section is optional or for
editors.
When a map will not load#
What a player sees, and what causes it:
| The player sees | When | Why |
|---|---|---|
| Invalid Scenario, with "This scenario is unreadable because it is invalid or corrupted." | In the map list | The map list read failed, and the file's VER is 59 or lower, or could not be read at all. |
| Invalid Scenario, with "This scenario is intended for use with a StarCraft Expansion Set." | In the map list | The map list read failed, and the file's VER is above 59. The game gives this message whatever the fault: a Brood War map in the original StarCraft, but also a missing section, a section of the wrong length, a failed VCOD check or a VER the game does not know, such as Remastered's 64 and 206. |
| "This map can only be played with the 'Use Map Settings' game type." | Making a game | The tileset is Installation and the game type is not Use Map Settings. |
| "Error loading scenario file." | Starting a game | A section this game type needs is missing, the wrong length, or runs past the end of the file. The same map may still start as melee. |
| "WARNING: Unit unplaceable! (name) (x,y)" | The first moments of a game | A placed unit had no room where it stands, and was removed (UNIT). |
| No briefing | The briefing room | MBRF is missing or not a whole number of records. |
| The file name in place of the map's name | In the map list | The name in SPRP is string 0, or an empty string. |
Where Remastered differs#
This reference describes StarCraft: Brood War 1.16.1, the last version before Remastered.
Remastered loads a map almost exactly as 1.16.1 does: it walks the sections the same way,
runs the same reads in the same order, and applies the same length checks, the same
VCOD check and the same rules for repeated sections. These are the differences.
Each is described in the entry of the section it affects, and the differences in how
Remastered runs triggers are in the trigger
reference.
- Two more revisions. Remastered also accepts
VER64 and 206, the two revisions that can carry theSTRxstring table. It reads a 64 file like a hybrid 63 file, and a 206 file like a Brood War 205 file (Revisions). - Every map needs
TRIG. The map list reads the triggers, to see whether the map uses EUD triggers: Deaths conditions and Set Deaths actions that reach outside the table of death counts. A map with noTRIG, or one whose length is not a multiple of 2400, is Invalid Scenario for every game type. 1.16.1 lists such a map and plays it as melee. - The map list reads
CRGB, the player colours, in a file of any revision. ACRGBthat is not exactly 32 bytes makes the map Invalid Scenario. - Size. A map whose
DIMwidth or height is above 256 is Invalid Scenario. 1.16.1 does not check the values. - Strings (
STR,STRx):- A
STRcopy shorter than 2 bytes, or aSTRxcopy shorter than 4, is skipped. 1.16.1 accepts a copy of any length. - In a 64 or 206 file a
STRxreplacesSTRwhatever their order. Such a file with neither table, or with only copies too short to be accepted, is Invalid Scenario. - The encoding is detected for each string: UTF-8, then Korean (CP949), then Windows-1252. 1.16.1 reads every string in the code page of the machine it runs on.
- A string number past the count, or an offset outside the section, shows as
<MISSING>. - The map list shows the whole name and description, where 1.16.1 cuts them at 31 and
255 bytes (
SPRP). - A colour code carries over to the next line of the same string. In 1.16.1 each line starts in the default colour again.
- A
- Colours.
COLRvalues of 12 and up are skipped, where 1.16.1 shows a wrong colour. - Terrain. A tile whose group is past the end of the tileset's table is drawn as plain
ground, where 1.16.1 reads past the end of the table (
MTXM). - Fog. Only the first 65,536 bytes of
MASKare used, one for each tile of a 256 × 256 map. 1.16.1 has no limit. - Start locations. One owned by a player above Player 8 is ignored (
UNIT). - Negative lengths. A negative section length that jumps back past the start of the file ends the walk there. 1.16.1 reads on from memory outside the file.
- Sound. Remastered plays Ogg Vorbis files as well as WAV files (
WAV).
A map loads in both games if 1.16.1 accepts it, it has a TRIG section, it is no wider or
taller than 256 tiles, and its CRGB, if it has one, is 32 bytes long.