Jump to content


Photo

How Does A Map File Find Mcd Files?


  • Please log in to reply
3 replies to this topic

#1 mykbaker

mykbaker

    Rookie

  • Forum Members
  • Pip
  • 0 posts

Posted 02 February 2006 - 03:15 PM

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.

#2 Hobbes

Hobbes

    UFO2000 Staff

  • Moderators
  • PipPipPipPip
  • 719 posts

Posted 02 February 2006 - 05:44 PM

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.

#3 mykbaker

mykbaker

    Rookie

  • Forum Members
  • Pip
  • 0 posts

Posted 02 February 2006 - 10:35 PM

Thanks for the info, that really helped. It didn't occur to me that the EXE would be doing all that. Do the battle areas created by the EXE change in size or are they all the same size? Whether they change or not, what size are they?

thanks again.

#4 Hobbes

Hobbes

    UFO2000 Staff

  • Moderators
  • PipPipPipPip
  • 719 posts

Posted 03 February 2006 - 12:16 AM

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.