ForestBiome
A class in Root.Township, the global namespace.
A forest generation biome asset, with weighting and noise settings used to score which biome wins at a point. Looked up by hash like other HashedGeneralValue assets.
- Listed in Global namespace: E to H
- Inherits or implements
HashedGeneralValue<ForestBiome> - Derived types
ForestBiome,ForestBiome.Create - Nested types
Create
Constructors
| Member | What it is |
|---|---|
ForestBiome() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private Biome biomeDefinition | Backing field for BiomeDefinition, the biome this forest biome spawns. |
private Color color | Backing field for Color, probably for debug views. Default white. |
private float maximumRadius | Backing field for MaximumRadius. Default 500. |
private float minimumRadius | Backing field for MinimumRadius. Default 100. |
private ForestBiome parent | Backing field for Parent. |
private ForestBiome[] parents | Backing field for Parents. |
private float randomExtraWeight | Backing field for RandomExtraWeight: up to this much random weight is added in GetScore. Default 0.2. |
private float simplexScale | Backing field for SimplexScale: noise coordinates are divided by this in GetScore. Default 100. |
private float weighting | Backing field for Weighting, multiplied into the noise score. Default 1. |
private int wOffset | Backing field for WOffset, the noise's fourth coordinate. OnValidate picks a random one when it's 0 or less. |
Properties
| Member | What it is |
|---|---|
Biome BiomeDefinition { get; } | The Biome this forest biome is tied to. |
Color Color { get; } | Display colour for the biome, probably for debug maps. |
float MaximumRadius { get; } | Largest radius setting for a patch of this biome (500 by default). |
float MinimumRadius { get; } | Smallest radius setting for a patch of this biome (100 by default). |
ForestBiome Parent { get; } | A single parent biome. |
ForestBiome[] Parents { get; } | Parent biomes this one can appear inside. |
float RandomExtraWeight { get; } | Most random weight added to the score per call (0.2 by default). |
float SimplexScale { get; } | Noise scale. Larger values make bigger, smoother patches. |
float Weighting { get; } | Multiplier on the noise when scoring. |
int WOffset { get; } | Fourth noise coordinate (divided by 10000), so each biome gets different noise. |
Methods
| Member | What it is |
|---|---|
float GetScore(SimplexNoise noise, Random random, Vector3 point, float strengthMultiplier = 1) | Simplex noise at the point (scaled by SimplexScale, offset by WOffset) times the weighting plus a random extra. |
protected override void OnValidate() | Editor: gives the biome a random noise offset if it has none. |
Used in
Members of other types that take, return or hold a ForestBiome: