Table of Contents

Landscape Assets

The terrain generators use some specialized assets like trees and rocks to decorate the generated landscape. They are generic models with a special metadata block to recognize them as tree or rock.

Metadata

There are several additional metadata blocks for trees and rocks:

function data()
return {
  -- bounding box
  -- collider
  -- lods
  metadata = {
    order = { 
      value = -1000 + 2, 
    },
    autoGroundTex = {
      categories = { "forestTree", }
    },
    category = {
      categories = { "tree", },
    },
    categoryList = {
      categories = { "broadleaf", "large", "plains", "town", "temperate.clima.lua"  },
    },
    description = {
      description = _("Place trees individually or with a brush."),
      icon = "ui/construction/asset/temperate/european_linden.tga",
      name = _("European linden"),
    },
 
    tree = { },
    -- or
    rock = { },
 
  },
  version = 1,
}
end

The blocks have different purposes:

To mark a model as a tree, the empty tree block has to be set. To mark a model as a rock, the empty rock block has to be set. All trees and rocks are available in the according mixed brush tool too.

Auto Ground Textures

The terrain around trees is automatically textured with a ground texture depeding on the density of tree or rock models. These ground textures are defined in .lua files in the res/config/auto_ground_tex/ folder:

function data()
return {
  category = "auto.model.tree",         -- "auto.model.rock"
  gridSize = 18.0,
  countFrom = 2,
  countTo = 5,
  groundTex = "forest_floor.lua",       -- e.g. "rock_ground_medium_brown_grass.lua"
  individual = true,
  individualCategory = "forestTree",    -- e.g. "rockSandstoneMedium"
}
end

The properties are as follows:

UI icons

The trees and rocks are available to be build in the asset menu. Therefore they need suitable ui icons. The icons lay in res/textures/ui/construction/asset/ and respective subfolders analogue to the .mdl files. The filenames usually are: