IsoMapPack5
This section contains the data that is used to create terrain to play on, meaning information about tiles, which for 99% are located in <game.mix>/iso<theater>.mix/*.<theater extension>, for Red Alert 2 temperate for example, in ra2.mix/isotemp.mix/*.tmp.
The data is encoded using base64 and chunked LZO compression. Decompression process looks like this:
- Combine all the values in this section into one long string.
- Base64-decode it into a byte array.
- Read two bytes from this array into an unsigned int16 value - call this InputSize.
- Read two bytes into an unsigned int16 value - call this OutputSize. This will typically be 8192 for all except the last pass.
- Read InputSize bytes into a buffer.
- Use lzo1x_decompress to decompress this buffer.
- It should decompress into OutputSize bytes.
- Repeat steps 3-7 until the whole array from step 2 has been read, combining all the decompressed bytes into one long array.
This resulting array will contain a list of tile declarations. Each declaration takes up 11 bytes:
struct IsoMapPack5Tile { __int16 X, Y; __int32 TileTypeIndex; byte TileSubtypeIndex; byte Level; byte Unknown; }
- The X and Y coordinates are given in cells.
- TileTypeIndex refers to the index of the IsometricTileType that should be used for this cell - the first TMP in the first tileset for this theater is index 0, the next is index 1...
- TileSubtypeIndex refers to the index of the tile in that TMP to actually use in this cell.
Because of 3 always-zero values used in each of these 11 byte chunks, map storage isn't quite optimal. XCC Map Encoder greatly exploits this, to compress this section greatly.
It is often advised to delete this section for TS maps, because of filesize limitations, however all terrain data gets lost.
External Links
- LZO compression: http://www.oberhumer.com/opensource/lzo/