Jump to content
XCOMUFO & Xenocide

How Does A Map File Find Mcd Files?


mykbaker

Recommended Posts

I've been looking around at the different file format documentation and I think I have the basic combat mapping process down but I'm missing some pieces.

 

When the game needs to generate a combat area it randomly selects maps from that map set (I don't understand how a map is determined to be a certain type, rural, city, mars, etc) then the map files list how to put the tiles together to create the maps. (I don't understand how the MCD files are organized so they can be used by the map files and I don't understand how the maps say what mcd files they are using.) I understand how routes work and how each tile has different properties but I'm confused on those MCD and MAP items.

 

Thanks in advance for any help you can provide.

Link to comment
Share on other sites

This is not an exact description but here's what I know:

 

1) The .EXE generates the battlefields from the TERRAINXX.MAP files, where the TERRAIN is its name and the XX refer to its number. The indications regarding how many maps are contained on each terrain and how to assemble them together (to create the roads on Terror Sites, for instance) are also contained there.

 

2) The .EXE also assigns the MCDs for each terrain. Each terrain can have several MCDs assigned, but the limit on MCD entries (or tiles) is 256. The MCD files are then combined together according to their order (BLANKS is always assigned and it seems to be the first), to form a single list of tiles:

0 is empty space

1 and 2 are destroyed sections (from Blanks)

3 is grey concret ground (in the case of the Terror Site, where Roads is the first MCD assigned).

4 is the next tile on Roads, etc., up to 255.

 

3) The first 3 bytes of each .MAP file are the maps' length, width and height. Afterwards they are organized in sequences of 4 bytes, each corresponding to a map 'square': the first byte is for ground tiles, then for west walls, north walls and objects. To each byte corresponds one MCD entry, taken from the list above. Don't ask me about how the bytes's position on the file corresponds to their location on the map because I don't know.

Link to comment
Share on other sites

Battlefield sizes are dependent on the type of mission and UFO. 40x40x4 is the size for Small and Medium Scout UFOs, 50x50x4 for all other UFOs and Terror Sites, 60x60x2 for Alien and X-COM Bases. The game has a maximum of 10,000 'square' map blocks: the Bases theorically could have a 60x60x3 size but the engine assigns "dark squares" that cover completely levels 1 and 4.
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...