Terrain Development Guide


Chapter 3: Optional Terrain Development


Road Networks

To add a road system to your terrain, you first need to generate a Layer Map of the same size and resolution as your elevation and ecology maps. The generated map will be "empty" except for the path of the roads. As with the ecology map, the road map uses palette indices to determine which road texture gets placed at any given point on the map. For example, color index 1 might point to a road running east-to-west, while color index 2 might indicate a road starting in the west, and curving northwards; etc.

Here is a snippet from a Road Network Map:

The road network is added to the terrain by creating it as a separate layer in the Terrain Descriptor File:

[Layer 4]
map = pngsolomons_road.tga
scale = 1
height = 0
blend = 0
num_textures = 15

Note that the scale is set to "1". This is important, since each road is unlikely to exceed the grid resolution, each texture should be put into only one grid square of the terrain, not span several as in the case of the ecology textures.

Each road texture is assigned to the road layer just as we do in the ecology layer:

[Layer 4 Texture 1]
value = 1
texture = _roads/n_s.tga
rotation = 0

Unlike the Ecology Layer, however, not every color index in the Road Network Map is assigned. The background color of the map (the places where no road texture is present; the white areas in the picture above) is not assigned a texture. If a color index is not assigned in the Terrain Descriptor File it will be ignored. This way only the roads are placed.

For the road textures, you will need to create several texture files depicting roadways. Each one needs to match up with all possible neighbors. In other words, the point the road intersects the edge of the texture must in the same vertical (or horizontal) position as the tile you place next to it, or there will be a gap in the roadway when viewed from the air.

Also, each texture will need an alpha channel applied to it, so that only the road portions of the texture shows when overlaid on the main terrain. Below are two images, a road (with transparency) and a base ecology layer texture:

When the road layer is overlaid upon the ecology layer, the road and ecology tiles merge seamlessly into the following:


Hint: Roads tend to be negatively affected by mipmapping. It is recommended that you disable this feature (mipmap=0) for road layers in the Terrain Descriptor File.