Warzone 2100 Resurrection

Terrain textures

From WarzoneWiki

Jump to: navigation, search

The terrain textures for a terrain set are stored in data/texpages as a radar file and a set subdirectories with the same base name.

This is what the tertilesc1 set looks like:

 data/texpages/tertilesc1hw.radar
 data/texpages/tertilesc1hw-16/
 data/texpages/tertilesc1hw-32/
 data/texpages/tertilesc1hw-64/
 data/texpages/tertilesc1hw-128/

The radar file contains the radar colours for a texture set, with each line containing the colour for the corresponding tile number (but since tiles start counting from zero, line 3 would correspond to the file tile-02). The colours are defined as 3 hex numbers of size 2, with each component defining the red, green and blue colour components, respectively. This is the same way colours are usually defined in HTML pages. For example, a radar colour 'FFFFFF' would mean that each of the red, green and blue colour components have intensity 255 (the maximum possible). Water tiles in the alpha campaign has the value '000041' which gives water tiles a soft blue colour in the radar view.

The directories with eg a '-64' suffix behind them contain a set of tiles in equivalent width and height size to the number in the suffix. Each terrain set must contain 16, 32, 64 and 128 size tiles, and these are used for generating mipmaps. Each tile file must be suffixed with a zero padded number that identifies which tile it is. The tile contains a one-pixel border which is not displayed, but only used for linear filtering.

The tile must be rotationally seamless. This means that the texture will tile perfectly even if flipped and rotated in any direction. This may be quite challenging to accomplish, but one way to do it is to generate a texture one forth of the real size, put it in a corner, then copy it, rotate and flip it to mirror the original texture, then paste it into the other corners. You can see how in Grim's tutorial.

To add to the difficulty, the tile must be rotationally seamless without the above-mentioned one-pixel border. You can achieve this by first making a 126x126 size tile, then copying the outermost pixels to generate a border that is practically identical to the outermost pixels of your 126x126 tile, then combining the two to make a 128x128 tile, like this:

Image:Tile-interior.png -> Image:Tile-border.png -> Image:Tile-whole.png