![]() ![]() |
|||||||
|
Map File FormatWolfenstein 3D maps are always 64 x 64 squares, or tiles. For each map there are two planes. One plane identifies the walls, doors and floors. The other plane identifes the position of other objects. Each map plane is a two dimensional array of tilevalues.The mapdump program may be used to extract the map data and produce pictures of them. File FormatThe map data is contained in the file GAMEMAPS.xxx. Each map compressed and preceeded by a header. The offset to each header is given in another file MAPHEAD.xxx. This file is defined by this structure in id_ca.c:
The RLEWtag is used in the RLE compression. The headeroffsets are the file offsets for each map to the headers in the GAMEMAPS.xxx file. The tileinfo is not used. The headers in the GAMEMAPS.xxx file are defined by this structure from id_ca.h:
planestart and planelength are indexed by the plane number. The structure allows for three planes, but only two are ever used. planestart gives the offset into the GAMEMAPS.xxx file for each plane. planelength gives the (compressed) length of the data in the file. width and height give the dimensions of the map, which is always 64 x 64. The map data is compressed with a run length encoding scheme, and then, depending on the game version, possibly compressed with another encoding scheme, referred to in the code as CARMACIZED. CARMACIZEDCARMACIZED data is decoded with the function CAL_CarmackExpand in id_ca.c. Analysis to follow later.RLEWContinuous runs of the same value are replaced with a tag followed by a count and then the value. The scheme used encodes the data as a sequence of 16 bit words (hence the W in RLEW). Decoding the RLEW stream is straightforward, and is done by the function CA_RLEWexpand in id_ca.c. |