Class BiomeTemplate
A biome. The asset is the identity — its cached-object ID is what references, biome maps and race affinities carry — and everything the biome means is data on it: the elevation tier and climate envelope it is chosen for during generation, the colour that identifies it on a biome map, the terrain textures and spawn rules that paint it, the climate variants it can be experienced under, and the naming data dungeons and points of interest are named from. Registers with BiomeRegistry when loaded.
Nothing here restricts where a biome may be used. A cave biome and a grassland are the same kind of asset; a biome that should never be picked by climate simply has a SelectionWeight of zero and is placed by hand.
[CreateAssetMenu(fileName = "New Biome", menuName = "FishMMO/Biomes/Biome", order = 1)]
public class BiomeTemplate : CachedScriptableObject<BiomeTemplate>, ICachedObject
- Inheritance
-
ObjectScriptableObjectBiomeTemplate
- Implements
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Fields
BiomeColorId
[Tooltip("Colour that identifies this biome on a biome map and in the terrain painter.")]
public Color BiomeColorId
Field Value
- Color
ClimateVariants
[Header("Climate variants")]
[Tooltip("How this biome reads under different climates. Empty uses the scene's default variants.")]
public List<BiomeClimateVariant> ClimateVariants
Field Value
Description
[TextArea]
public string Description
Field Value
DisplayName
[Header("Identity")]
[Tooltip("Shown in tools and generated names, e.g. 'Alpine Meadow'. Defaults to the asset name.")]
public string DisplayName
Field Value
ElevationTier
[Header("Elevation")]
[Tooltip("Elevation tier this biome belongs to: 0 deep ocean … 8 nival, 9 for biomes that can appear at any elevation.")]
[Range(0, 9)]
public int ElevationTier
Field Value
GizmoColor
[Tooltip("Colour used for scene gizmos.")]
public Color GizmoColor
Field Value
- Color
MaxHeight
[Range(0, 1)]
public float MaxHeight
Field Value
MaxHumidity
[Range(-1, 1)]
public float MaxHumidity
Field Value
MaxTemperature
[Range(-1, 1)]
public float MaxTemperature
Field Value
MinHeight
[Tooltip("Normalised height band the biome occupies (0 sea floor, 1 highest peak).")]
[Range(0, 1)]
public float MinHeight
Field Value
MinHumidity
[Range(-1, 1)]
public float MinHumidity
Field Value
MinTemperature
[Header("Climate envelope — where generation chooses this biome")]
[Range(-1, 1)]
public float MinTemperature
Field Value
Naming
[Header("Naming")]
public BiomeNamingData Naming
Field Value
SelectionWeight
[Tooltip("Relative chance among biomes whose envelopes fit. 0 = never chosen by climate; placed by hand only.")]
[Min(0)]
public float SelectionWeight
Field Value
Properties
CliffTextureLayers
public List<CliffTextureLayer> CliffTextureLayers { get; }
Property Value
DetailTextureLayers
public List<TerrainTextureLayer> DetailTextureLayers { get; }
Property Value
IsSelectable
True when climate-driven generation may pick this biome.
public bool IsSelectable { get; }
Property Value
Key
Normalised registry key: the asset name, lowercase letters only ("Alpine Meadow" → "alpinemeadow").
public string Key { get; }
Property Value
LakebedTextureLayer
public TerrainTextureLayer LakebedTextureLayer { get; }
Property Value
MainTextureLayer
public TerrainTextureLayer MainTextureLayer { get; }
Property Value
ResolvedDisplayName
Display name, falling back to the asset name.
public string ResolvedDisplayName { get; }
Property Value
RiverbedTextureLayer
public TerrainTextureLayer RiverbedTextureLayer { get; }
Property Value
RoadTextureLayer
public TerrainTextureLayer RoadTextureLayer { get; }
Property Value
SmallPathTextureLayer
public TerrainTextureLayer SmallPathTextureLayer { get; }
Property Value
Methods
ClimateCentrality(float, float)
How central a reading is within the envelope, 1 at the centre falling to 0 at its edge; used to break ties between biomes that all contain the reading.
public float ClimateCentrality(float temperature, float humidity)
Parameters
Returns
ClimateDistance(float, float)
How far a climate reading is from this biome's envelope, 0 when inside. Temperature and humidity each span 2 units, so the distance is in the same units as the ranges.
public float ClimateDistance(float temperature, float humidity)
Parameters
Returns
ContainsClimate(float, float)
public bool ContainsClimate(float temperature, float humidity)
Parameters
Returns
ContainsHeight(float)
public bool ContainsHeight(float height)
Parameters
heightfloat
Returns
FindOwnVariant(string)
The template's own variant with this key, or null.
public BiomeClimateVariant FindOwnVariant(string variantKey)
Parameters
variantKeystring
Returns
GetAllTextureLayersInOrder()
All texture layers in painting order: main, details, roads, cliffs, riverbed, lakebed. Cached.
public List<TerrainTextureLayer> GetAllTextureLayersInOrder()
Returns
HasValidTextureLayers()
True when at least one layer has a texture to paint with.
public bool HasValidTextureLayers()
Returns
InvalidateTextureLayerCache()
Call after editing layers at runtime.
public void InvalidateTextureLayerCache()
OnLoad(string, string, int)
Virtual method called when a ScriptableObject is successfully added to the cache. Derived classes can override this method to add custom logging, initialization, or other specific logic that should occur upon caching.
public override void OnLoad(string typeName, string resourceName, int resourceID)
Parameters
typeNamestringThe name of the type (e.g., "RaceTemplate") under which the object is currently being cached.
resourceNamestringThe name of the ScriptableObject asset (e.g., "HumanRace").
resourceIDintThe deterministic ID generated for the resource instance.
OnUnload(string, string, int)
Virtual method called when a ScriptableObject is successfully removed from the cache. Derived classes can override this method to add custom logging, cleanup, or other specific logic that should occur upon uncaching.
public override void OnUnload(string typeName, string resourceName, int resourceID)
Parameters
typeNamestringThe name of the type (e.g., "RaceTemplate") from which the object is being removed from cache.
resourceNamestringThe name of the ScriptableObject asset (e.g., "HumanRace").
resourceIDintThe deterministic ID of the resource instance.
RandomizeNoiseOffsets(DeterministicRNG)
Gives every layer a fresh blend-noise offset so tiled biomes do not repeat.
public void RandomizeNoiseOffsets(DeterministicRNG rng = null)
Parameters
rngDeterministicRNG
ResolveOwnVariant(float, float)
The first of this template's own variants that fits the reading, or null.
public BiomeClimateVariant ResolveOwnVariant(float temperature, float humidity)
Parameters
Returns
TierName(int)
Human name of an elevation tier, for tools.
public static string TierName(int tier)
Parameters
tierint