WLD & SWD File Format - Merri/map-generator GitHub Wiki
Here Map Editor always means S2EDIT.EXE that is bundled with the Gold Edition.
The Settlers II: Gold Edition has three play modes:
- Roman Campaign (10 missions, WLD)
- World Campaign (10 missions, WLD)
- Unlimited Play (to play SWD files made in Map Editor)
In general WLD and SWD are mostly compatible with each other. Below are some of the differences listed out.
This is the main campaign that is scriptable and allows for seafaring, thus it is possible to create harbors and ships. In general the map data is trusted less than what is in the RTX script files, the latter can be used to override contents of the WLD file.
These maps can use longer titles for maps because WIDTH_UI and HEIGHT_UI values are ignored, and map titles are automatically read until a null character is read, thus giving four bytes more to reach a total of 23 characters maximum length. This is used to advantage in some of the original WLD files.
For the most part this is just Unlimited Play with fixed set of maps. There is no seafaring as you can't build ships. The only specialty with World Campaign is that you can set leaders in the map data. The maps can also take advantage of longer titles.
No seafaring, which is a shame. The user interface for selecting maps reads WIDTH_UI and HEIGHT_UI values from the map thus limiting the length of titles to 19 characters.
SIZE CONTENT DESCRIPTION
10 WORLD_V1.0 File format identification
20 TITLE 19 bytes CP-437 string, ends with null terminator
2 WIDTH_UI Width for Unlimited Play (unused in Campaign Missions)
2 HEIGHT_UI Height for Unlimited Play (unused in Campaign Missions)
1 TERRAIN Switches between palette and textures.
0x00 = Greenland
0x01 = Wasteland
0x02 = Winter World
1 PLAYERS Number of players for Unlimited Play and Map Editor.
Campaign Missions prefer RTX files.
20 AUTHOR 19 bytes CP-437 string, ends with null terminator.
28 HQ_XY 7 16-bit X values followed by 7 16-bit Y values to
determine player Headquarters location.
0xFFFF = unset
1 INVALID The map is not playable in Unlimited Play if any bit is set.
0x01 = no players set (set by Map Editor if no HQ is set)
7 LEADER Sets face for each leader in World Campaign; human player is
always Octavianus.
0x00 = Octavianus
0x01 = Julius
0x02 = Brutus
0x03 = Erik
0x04 = Knut
0x05 = Olof
0x06 = Yamauchi
0x07 = Tsunami
0x08 = Hakirawashi
0x09 = Shaka
0x0A = Todo
0x0B = Mnga Tscha
2250 AREAS 250 values for separating each water and land mass, 9 bytes each.
1 TYPE 0x00 = unused, 0x01 = land, 0x02 = water
2 X X position for first node in order to be of this area.
2 Y Y position for first node in order to be of this area.
4 MASS Total nodes that exist in this area.
2 MAP_ID 0x11 0x27 Map File Identification, similar to how WORLD###.DAT
files begin.
4 SHORTBLOCK Always empty in WLD and SWD files. In WORLD###.DAT files indicates
short block headers.
2 WIDTH Width actually used by map loaders.
2 HEIGHT Height actually used by map loaders.
Header is followed by 14 blocks that contain block header and block data.
Last block may be followed by animal data footer. The game reads first for EOF indicator, but it isn't 0xFF then animal data is assumed. Each animal is 5 bytes and there can be virtually any amount of animals, and multiple animals can be set into the same X and Y location (unlike the animal data block).
SIZE DESCRIPTION
1 Animal type.
2 Animal X location.
2 Animal Y location.
File always end with 0xFF (EOF indicator).