Talk:MAP.DAT

From UFOpaedia
Revision as of 14:45, 27 June 2010 by Hatfarm (talk | contribs)
Jump to navigation Jump to search

Just recalling years ago when I was exploring the map files to see how they were put together, I seem to recall that there were a few extra bytes beyond the end of the map data. Does anyone what these were for or were they just extraneous bytes that never got used? -NKF 03:53, 19 May 2009 (EDT)

The description of this file makes it really hard to understand. How does it know which MCD file to link to? Where is that information stored? Is that just from GEODATA.DAT? What about when there are multiple MCD's used? Hatfarm 13:19, 26 June 2010 (EDT)

No it's not the easiest thing to read. Basically each tile is 4 bytes in length, detailing the two wall, floor and object space (for walls, furniture, etc), and the tiles are stored like a bitmap, similar to the lightmaps, etc. Now, what MCD records to use I'm not entirely sure, so this is just conjecture on my part. All of the map sets that are used for the current map are recorded in Geodata.dat. Since each tile set has an associated MCD file, the game might set up its own tile/MCD lookup table based on the tilesets that it is using for the current map.-NKF 17:22, 26 June 2010 (EDT)
Yes, the actual MCD file used by a map is a composite of the terrain, UFO, and X-COM tilesets. I think the order of tile set indexes is terrain, then UFO, then X-COM. You have problems if there are more than 253 non-blank tiles (0 and 1 are reserved indexes). -- Zaimoni 19:32, 26 June 2010 (CDT)

BB you've outdown yourself with this redo, really well done. REALLY clear now, thanks for the info. I think I had put it all together after looking at all of the files together, but having it all here makes it a lot easier to refer to. Hatfarm 22:03, 26 June 2010 (EDT)

Regarding where the MCD array, it's always made up of BLANKS.MCD first, followed by the MCD files for the terrain, the X-COM dropship, then the UFO. This "collated" table never gets saved to the HDD, as it's always possible to re-assemble it from scratch when loading a save game, based on the terrain and what craft are present.
Some terrains and UFOs are, themselves, made up of multiple MCD files. For example, the Battleship uses U_Ext02, U_Wall02, U_Pods and U_Bits. An urban map uses Roads, Urbits, Urban and Frniture. All of these "mini-sets" are hardcoded into the Tactical executable and aren't yet documented on this wiki. If you look at the file "TilesetLister.java" in my toolkit you'll see these listed out. The one method in that file, "String[] getList(int[], int)", expects the entire contents of GEODATA.DAT as the int[], and offset 20 of MISDATA/MISSION.DAT as the int.
The details on the MCD stuff really belong on a dedicated MCD page, which I'll make at some point. - Bomb Bloke 22:41, 26 June 2010 (EDT)
How do you know which value points to U_Ext02 and which value points to U_Wall02? I mean, is a value of 15 for U_Ext02 and then 62 is U_Wall02? Is it just alphabetical? Hatfarm 10:45, 27 June 2010 (EDT)