Table of Contents

Climates

Transport Fever 3 has the ability to define different climate zones. They vary in the look and feel of the environment, as they have different plants, colors, terrain textures and lighting.

Configuration

A climate zone is defined in a .clima.lua file. The file has the following setup:

function data() 
 
return {
  id = "temperate",
  desc = { 
    name = _("Temperate"),
    description = _("Mixed Forest Vegetation"),
    icon = "temperate.tga"
  },
  order = 1,
  category = "temperate.clima",
 
  defaultNames = "/names/europe/europe.names",
  economy = "/economy/temperate.eco",
  environment = "temperate.env",
 
  nodeTree = "temperate_clima.tree",
 
  audio = { environment = {...}},
  mapColoring = {...},
  groundTextures = {...},
  skirt = {...},
}
end

While id is a unique technical identifier, name and description are strings which can be translated in a strings.json file. The referenced ui icon for climates is used in some main menu dialogs and is 600x400 px in @2 resolution. The climate zones are ordered in the dialogs according to their order values and the category key is used to filter trees and other game resources properly.

To set the default game settings per climate zone, the following properties reference the equivalent game resources:

The nodeTree reference points to the node tree used for material distribution.

Environmental sounds can be configured in audio.environment.

The mapColoring struct defines the colors that are used for the map preview in terrain generator dialogs. It has several properties:

The groundTextures struct is used to assign special .gtex ground textures for several purposes:

The skirt struct is used to define the textures used for the edges of the game world:

1 colorTex is the texture map that is used as base colors for the edge faces.
2 detailTex is the texture map that is used as overlay to get some randomzation of colors at the faces.
3 waterText is the texture map that is used as base color for the areas of edge faces that touch water.

Environment Audio

The environmental sounds are configured in the audio.environment struct of the climate. There are different types of configurations, all basing on a few standard properties:

mountain = {
  sounds = { 
    { file = "::/climates/sound/environment/nature/mountain.wav" }
  },
  refDist = 15.0,
  height = 0.0,
  layer = 3,
  ambient = true,
  altitudeRange = { 200.0, 4000.0 },
},

The properties are:

The following keys can be used for the structs:

Additionally there are keys for every district in towns: residential, commercial and industrial. They each have a list of 4 entries describing the 4 building levels.

To add custom sound layers, the key terrainMasks holds a list with struct entries. The keys of the structs need to match the mask keys exported with Data Output nodes during map generation.

The sounds list contains substructs with two keys:

Only one matching sound out of the sounds list is played at a time.

The following tags are available:

Terrain Material Distribution

The nodeTree of climates is called after every change of terrain to recalculate the default terrain texture distribution over the map. It can be edited with the Terrain Generator Editor included in the Map Editor.

Inputs


layers generated by updateFn

The tree may get multiple inputs:

All three types of nodes can be used multiple times.

Output


no dithering and dithering

The tree may generate one or more terrain material masks. Each mask output is defined in a Material Output node that receives a Material Map as the map that will be used to draw the material (transparency value between 0 and 1). Additionally it receives several parameters:

To define the underlying base terrain material, a Material background output node needs to be added as well. It just has one parameter Material type to reference the terrain material.