Command & Conquer Tileset Format
| Format type | Tileset |
|---|---|
| Hardware | VGA |
| Max tile count | 254 |
| Palette | Shared between all tilesets in one theater |
| Tile names? | No |
| Minimum tile size (pixels) | 24×24 |
| Maximum tile size (pixels) | 24×24 |
| Plane count | 1 |
| Plane arrangement | Linear |
| Transparent pixels? | No |
| Hitmap pixels? | No |
| Metadata? | None |
| Supports sub-tilesets? | No |
| Compressed tiles? | No |
| Hidden data? | Yes |
| Games |
The Command & Conquer Tileset Format is an uncompressed tileset containing tiles with dimensions of 24x24. Technically, this tile size can be changed, but the game defines cells as 24x24, so changing it does not seem useful.
A single Command & Conquer "tileset" does not represent the tiles of an entire map environment; it only contains the terrain tiles of a single piece of terrain. The full collection of tileset files that comprise one map environment is called a "Theater", and is combined into one .mix archive together with its colour palette and the theater-dependent terrain objects, civilian buildings, and fading table files. Such a Theater also does not act as the tiles set for just one single map; the game only has a few Theaters, and each one is used by many maps in the game.
File format
Header
The header definition, called IControl_Type in the source code, can be found in the WIN32LIB code of Red Alert, as disabled section in TILE.H
| Offset | Data type | Name | Description |
|---|---|---|---|
| 0x00 | INT16LE | Width | Width of icons (pixels). Should always be 24. |
| 0x02 | INT16LE | Height | Height of icons (pixels). Should always be 24. |
| 0x04 | INT16LE | Count | Number of icons. While this is an Int16 value, the game's map format can only access tiles up to index 255. Since tiles can be marked as empty, this value can differ from the number of actual images stored inside the file. |
| 0x06 | INT16LE | Allocated | Used by the game to indicate whether this tile was allocated. In the file, it's always zero. |
| 0x08 | INT32LE | Size | Size of the entire file. |
| 0x0C | INT32LE | Icons | Offset from file start to icon data. |
| 0x10 | INT32LE | Palettes | Offset from file start to palette data. Obsolete leftover from Dune II; always empty. |
| 0x14 | INT32LE | Remaps | Offset from file start to remap index data. Obsolete leftover from Dune II; always seems to be 0x0D1AFFFF. |
| 0x18 | UINT32LE | TransFlag | Offset from file start for transparency flag table. This is an array containing one byte for each actual image in the file. Obsolete leftover from Dune II; all entries in the table are just 0x00. |
| 0x1C | UINT32LE | Map | Offset from file start for icon map offset. This is an index linking each tile to the index of an actual image at Icons. This index is a UINT8[Count]. Value 0xFF in the index indicates an empty tile. |
Generally, the order of the data after the index is:
- Icons
- Map
- TransFlag
Of course, since these are read from header values, their order has no real effect.
Note that there is no way to know the dimensions (Width and Height) of the full tileset. If there are 6 tiles it could be 6x1, 1x6, 3x2, or 2x3. The game doesn't actually need this information either, since the maps reference the individual tile indices inside the tileset files directly; the only tools that would actually need this information (besides image converters) are map editors.
The game's exe file does contain the dimension information of all tilesets, though, alongside the tilesets' other information, because the map editor used to be built into the game engine, and because the [Template] section in a mission file supports placing terrain tilesets from a mission file. This tileset information is available in the source code of the game, as 6th and 7th argument passed on to the TemplateTypeClass::TemplateTypeClass constructor.
Image Data
Since the tileset can contain empty entries, the actual amount of images following the Icons location should be determined by taking the maximum value (excluding any 255 values indicating empty tiles) in the the array at Map, and adding 1 to it. Note that like in the game's fonts, identical images are generally saved only once, with the data referenced in the index multiple times, which further reduces the actual amount of images.
The image data is located at Icons. To look up the image data of a specific tile N, first check in the array at Map what the image index of the tile is. If it is not 0xFF, the image data can be found at:
tileImageStart = Icons + (Width * Height * fileData[Map + N])
The image data will always be 24*24 bytes, and represents a simple 8-bit indexed image.
Tools
The following tools are able to work with files in this format.
| Name | Platform | View images in this format? | Convert/export to another file/format? | Import from another file/format? | Access hidden data? | Edit metadata? | Notes |
|---|---|---|---|---|---|---|---|
| Engie File Converter | Windows | Yes | Yes | Yes | No | N/A | Uses internal mapping based on the file name to show the tile in its correct dimensions. Automatically saves tiles containing nothing but colour 0x00 as empty tiles. |
| XCC Mixer | Windows | Yes | Yes | No | No | N/A | Does not attempt to show the actual shape of the tileset, and just shows a list of tiles. |
| Mix Manager | DOS | Yes | Yes | Yes | No | N/A | Conversion suite containing PCX2TMP and TMP2PCX tools for converting the tileset files. |
| RAMix | DOS | Yes | Yes | No | No | N/A | Contains a TMP2PCX tool that can visualize the tileset file to adjust dimensions before converting to PCX. Does not contain a tool to convert back; you just have to use the one from Mix Manager. |