From UFOpaedia
Jump to navigation Jump to search

Talk Page Moved

I've moved the old contents of this page (which discussed MCD files) here. - Bomb Bloke 03:59, 27 June 2010 (EDT)

TERRAIN Content Files

Two things:

  • If you get all the MCD files from this folder, you will notice that there is no matching TAB and PCK for some of them. Any got a clue as to why?
  • Something that I haven't seen mentioned is that, if you count the number of pixels that you put into your image while converting the bytes of the RLE image data, you will notice that there are a few at the end that must be set to transparent for the image to display correctly when overlayed. I am using 32x40 pixel images. I found that size on the site.

- Sidewinder58

Some of the MCD files just aren't used at all. The first game, UFO, also has entire map files that get ignored.
As for the PCK images, the idea is that the game draws them straight onto the screen - the transparency effect is achieved simply by leaving the pixels that aren't mentioned within the PCK data completely untouched. If you pre-render all your images into sprites, then yes, you'd need to use a transparency flag of some sort, but you can actually just keep parsing the raw RLE stream over and over faster and with less memory usage. Why process transparent bytes when you can simply skip them?
By the way, on these wiki talk pages you can sign your comments by entering four tildes (~~~~). :) -  Bomb Bloke (Talk/Contribs) 19:30, 17 January 2011 (EST)

Perceivably, the only reason that they would ignore those pixels is if they were using straight mem copy... ? Sidewinder58 12:19, 18 January 2011 (EST)

Hmm, I'm not sure whether we're on the same page here. You initially said "if you count the number of pixels that you put into your image while converting the bytes of the RLE image data, you will notice that there are a few at the end that must be set to transparent for the image to display correctly when overlayed" - are the "few at the end" you're referring to BYTES or PIXELS?
If pixels, then it's just a matter of skipping them; when the game run out of image data to draw, it just stops, and so the image underneath gets left untouched. A 32x40 sprite doesn't mean the game draws 1,280 pixels, it only processes the amount of pixels the RLE data tells it to (which can be any figure UP TO 1,280 pixels). If, on the other hand, you meant bytes, then you should be skipping everything once you hit a value of 255 (though this IS specifically mentioned, hence why I'm assuming you're talking about pixels). -  Bomb Bloke (Talk/Contribs) 19:22, 18 January 2011 (EST)

Potential maximum MCD record

First I must say that I'm really impressed with the work that you guys put on the Terrain files - I am relearning a few things and learning some new! :)

My question is this: how were the values for the 'Potential maximum MCD record count' calculated? I can't seem to find the logic behind it. My understanding was that for all terrains with X-COM craft and UFOs, you added the total of MCD records of BLANKS (2) plus the count for the biggest X-COM and Alien crafts, the Skyranger (65) and the Harvester/Supply Ship (106), giving you a total of 173 predetermined records and leaving 83 free MCD slots for the terrain. So the theoretical maximum should always be 256 for any terrain, unless it is proven that the game crashes if an MCD file (like has more records than it is supposed to.

My 2nd issue is that there are 2 terrains (Forest and Jungle) which have 85 and 84 MCD records, which likely means that those UFOs (Supply Ship/Harvester) will never appear over those terrains (they will be swapped by Farm or another terrain) OR there's some sort of exception to the 256 limit that is being explored by the engine. I can't remember if I ever saw those UFOs on those terrains though. Hobbes 11:48, 9 January 2012 (EST)

Your train of thought is mostly correct, only mistake you're making is to add "blanks" twice. It's already included in the total figures listed for each terrain, as it's always the first file to be loaded. That means that yes, the two UFOs with 106 records can and will land in jungle/forest areas - just.
So the maximum amount of records the game should ever try to load is indeed 256. Trying to load more then that will cause a crash (the CE version of the game will even tell you you've gone past the mapcode limit, explaining what "MCD" stands for). No practical way to extend it, at least, not with the original game EXEs.
With a bit of trickery it'd be quite possible to remove the X-COM dropship from certain UFO recovery missions, instantly giving you an extra 65 tile types to play with. It's not inconceivable that certain terrains would be too difficult to land in and must be approached by foot; heck, Apocalypse got away with never showing us a dropship in a mission. -  Bomb Bloke (Talk/Contribs) 18:04, 9 January 2012 (EST)
Ah, thanks for pointing me out my mistake. :) I've seen the 'mapcode limit' message quite a lot (happens on DOS as well) - it can also happen if you are loading too many .map files.
So, it really is that the theoretical maximum is always 256, maybe some rewording is necessary 'total tiles used' or something, to make it less confusing. I'm not really looking into adding more tiles than 256 (designing new ones takes way too long). I've thought in the past to replace the dropship with a clear map file with only the spawn points for X-COM soldiers, freeing the extra tiles. The problem, however, is that you will start the game completely unprotected and out in the open! :) Hobbes 10:29, 10 January 2012 (EST)