ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

TMP: Difference between revisions

From ModEnc
Jump to navigation Jump to search
Nighthawk200 (talk | contribs)
m Categorising.
Crimsonum (talk | contribs)
Expanded the article with known information.
Line 1: Line 1:
TMP files are the terrain files for C&C [[Tiberian Sun]] and C&C [[Red Alert 2]], in addition to their expansion packs, Firestorm and Yuri's Revenge, respectively. The TMP files used for TS and RA2 are diamond-shaped, and are designed to simulate a dimetric camera. It is a common misconception that the camera used in TS and RA2 is isometric, when it is in fact a dimetric camera.
TMP files are terrain files used in {{ts}} through {{yr}}. They constitute the solid, mostly indestructible terrain upon which [[TerrainTypes|every]] [[OverlayTypes|other]] [[TechnoTypes|game object]] is layered. TMPs come in various shapes, each comprised of one or more [[#tiles|tiles]]{{fnl|1}}. Furthermore, TMPs are divided into [[#TileSets|tilesets]], which define certain attributes that each TMP in the set should have.
 
TMP files use the same theater-specific file extensions as [[TerrainTypes]]: .tem, .sno, etc.
 
The maximum tile size of a TMP file is 10x10 tiles.
 
==Tiles==
 
Tiles are the diamond-shaped, single-[[cell]] pieces that make up a TMP file. Each tile is composed of two images: a normal image that covers the cell shape, plus an optional "extra" image perpendicular to the normal image. This extra image is essential for creating the illusion of a 3D-environment, as it allows for hiding terrain and objects behind it, thus creating a sense of depth, or the filling of space between tiles at different height levels.
 
In addition to graphics, each tile has several parameters that specify characteristics such as [[Height#In_Maps|height]], [[LandTypes|land type]] and slope type.
 
==File Format==
 
A TMP file consists of two parts, the file header and tile headers.
 
struct FileHeader
{
unsigned int BlockWidth; // size in blocks
unsigned int BlockHeight;
unsigned int BlockImageWidth; // size of each block
unsigned int BlockImageHeight;
};
 
Following the file header is an index of pointers to each tile header.
 
struct TileHeader
{
signed int TileX; // tile offset
signed int TileY;
unsigned int ExtraDataOffset;
unsigned int ZDataoffset;
unsigned int ExtraZDataoffset;
signed int ExtraX; // extra image offset
signed int ExtraY;
unsigned int ExtraWidth;
unsigned int ExtraHeight;
unsigned char Bitfield; // three of the bits specify whether the tile has an extra image, Z data, and damaged art (applies only to bridges), respectively.
BYTE padding[3];
unsigned char Height;
unsigned char LandType; // see [[LandTypes]]
unsigned char SlopeType;
RGB LowRadarColor; // color to show on the radar for this tile at the lowest map [[Height#In_Maps|height]]
RGB HighRadarColor; // color to show on the radar for this tile at the highest map [[Height#In_Maps|height]]
BYTE padding[3];
}
 
The graphics are encoded after the tile header.
 
For more information on the file format, see [http://xhp.xwis.net/documents/TMP_TS_Format.html TMP documentation].
 
==TileSets==
 
TileSets define certain characteristics to a group of TMP files, such as [[AllowTiberium|whether Tiberium/ore can grow on the tiles]], or whether they can be [[Morphable|deformed]] or [[AllowBurrowing|burrowed through]]. Each TileSet has its own section in the [[Terrain_Control_INI_files|theater control file]].
 
A TileSet has a practical limit of 99 TMPs.
 
==Footnotes==
{{fn|1|Confusingly, both TMPs and the tiles that make up a TMP file are both referred to as "tiles" in different contexts.}}
{{fn|2|Sometimes referred to as terrain type (not to be confused with [[TerrainTypes]])}}
 
[[Category:General_Editing_Information]] [[Category:Map_Information]]
 
[[Category:File Formats]]
[[Category:File Formats]]

Revision as of 15:58, 15 August 2019

TMP files are terrain files used in Tiberian Sun through Yuri's Revenge. They constitute the solid, mostly indestructible terrain upon which every other game object is layered. TMPs come in various shapes, each comprised of one or more tiles1. Furthermore, TMPs are divided into tilesets, which define certain attributes that each TMP in the set should have.

TMP files use the same theater-specific file extensions as TerrainTypes: .tem, .sno, etc.

The maximum tile size of a TMP file is 10x10 tiles.

Tiles

Tiles are the diamond-shaped, single-cell pieces that make up a TMP file. Each tile is composed of two images: a normal image that covers the cell shape, plus an optional "extra" image perpendicular to the normal image. This extra image is essential for creating the illusion of a 3D-environment, as it allows for hiding terrain and objects behind it, thus creating a sense of depth, or the filling of space between tiles at different height levels.

In addition to graphics, each tile has several parameters that specify characteristics such as height, land type and slope type.

File Format

A TMP file consists of two parts, the file header and tile headers.

struct FileHeader
{
	unsigned int BlockWidth; // size in blocks
	unsigned int BlockHeight;
	unsigned int BlockImageWidth; // size of each block
	unsigned int BlockImageHeight;
};

Following the file header is an index of pointers to each tile header.

struct TileHeader
{
	signed int TileX; // tile offset
	signed int TileY;
	unsigned int ExtraDataOffset;
	unsigned int ZDataoffset;
	unsigned int ExtraZDataoffset;
	signed int ExtraX; // extra image offset
	signed int ExtraY;
	unsigned int ExtraWidth;
	unsigned int ExtraHeight;
	unsigned char Bitfield; // three of the bits specify whether the tile has an extra image, Z data, and damaged art (applies only to bridges), respectively.
	BYTE padding[3];
	unsigned char Height;
	unsigned char LandType; // see LandTypes
	unsigned char SlopeType;
	RGB LowRadarColor; // color to show on the radar for this tile at the lowest map height
	RGB HighRadarColor; // color to show on the radar for this tile at the highest map height
	BYTE padding[3];
}

The graphics are encoded after the tile header.

For more information on the file format, see TMP documentation.

TileSets

TileSets define certain characteristics to a group of TMP files, such as whether Tiberium/ore can grow on the tiles, or whether they can be deformed or burrowed through. Each TileSet has its own section in the theater control file.

A TileSet has a practical limit of 99 TMPs.

Footnotes

1 Confusingly, both TMPs and the tiles that make up a TMP file are both referred to as "tiles" in different contexts.

2 Sometimes referred to as terrain type (not to be confused with TerrainTypes)