Forest Data

From Silent Wings Wiki
Jump to: navigation, search

(Work in progress)


Tree Types

A tree type defines which 3D model is used for this tree when rendering. There should be two different 3D models, one for up close rendering (model), and one for far away rendering (bb_model). The second should be only a flat billboard model.

Example:

tree_type {
   id = 0
   model = fir.gng
   bb_model = fir_flat.gng
}

These models look for their texture files in the forest folder together with the .gng file.

Forest classes

The forest classes tie the various tree types to different forest themes in the forest geodata. Each forest class consists of an optional code tieing it to the geodata and two arrays linking tree types to probabilities. If no code is given for the geodata, this class is used for all areas that have forest, regardless of the data value of the forest area. Here are a couple of examples:

forest_class {
   code       = 2
   tree_types = [ 0 ]
   tree_prob  = [ 1.0 ]
}

forest_class {
   code       = 3
   tree_types = [ 0 1 ]
   tree_prob  = [ 0.5 0.5 ]
}

In this case we have one class that is used for the value 2 in the forest map data. This class consists only of tree type 0. We also have a class that is used for the data value 3 in the forest maps. Here we have a 50/50% chance of either tree type 0 or 1 in each tree cell.

Another example:

forest_class {
   tree_types = [ 0 1 ]
   tree_prob  = [ 0.8 0.2 ]
}

Here we have only one forest class that is used regardless of the value in the map data. We have 80% chance of type 0 trees and 20% chance of type 1. As long as there is data, this class is used. (This methid is only useful for polygonal forest maps).