Table of Contents

Class BiomeTemplate

Namespace
FishMMO.Shared.Biomes
Assembly
FishMMO.Shared.dll

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
Object
ScriptableObject
BiomeTemplate
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.name
Object.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

List<BiomeClimateVariant>

Description

[TextArea]
public string Description

Field Value

string

DisplayName

[Header("Identity")]
[Tooltip("Shown in tools and generated names, e.g. 'Alpine Meadow'. Defaults to the asset name.")]
public string DisplayName

Field Value

string

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

int

GizmoColor

[Tooltip("Colour used for scene gizmos.")]
public Color GizmoColor

Field Value

Color

MaxHeight

[Range(0, 1)]
public float MaxHeight

Field Value

float

MaxHumidity

[Range(-1, 1)]
public float MaxHumidity

Field Value

float

MaxTemperature

[Range(-1, 1)]
public float MaxTemperature

Field Value

float

MinHeight

[Tooltip("Normalised height band the biome occupies (0 sea floor, 1 highest peak).")]
[Range(0, 1)]
public float MinHeight

Field Value

float

MinHumidity

[Range(-1, 1)]
public float MinHumidity

Field Value

float

MinTemperature

[Header("Climate envelope — where generation chooses this biome")]
[Range(-1, 1)]
public float MinTemperature

Field Value

float

Naming

[Header("Naming")]
public BiomeNamingData Naming

Field Value

BiomeNamingData

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

float

Properties

CliffTextureLayers

public List<CliffTextureLayer> CliffTextureLayers { get; }

Property Value

List<CliffTextureLayer>

DetailTextureLayers

public List<TerrainTextureLayer> DetailTextureLayers { get; }

Property Value

List<TerrainTextureLayer>

IsSelectable

True when climate-driven generation may pick this biome.

public bool IsSelectable { get; }

Property Value

bool

Key

Normalised registry key: the asset name, lowercase letters only ("Alpine Meadow" → "alpinemeadow").

public string Key { get; }

Property Value

string

LakebedTextureLayer

public TerrainTextureLayer LakebedTextureLayer { get; }

Property Value

TerrainTextureLayer

MainTextureLayer

public TerrainTextureLayer MainTextureLayer { get; }

Property Value

TerrainTextureLayer

ResolvedDisplayName

Display name, falling back to the asset name.

public string ResolvedDisplayName { get; }

Property Value

string

RiverbedTextureLayer

public TerrainTextureLayer RiverbedTextureLayer { get; }

Property Value

TerrainTextureLayer

RoadTextureLayer

public TerrainTextureLayer RoadTextureLayer { get; }

Property Value

TerrainTextureLayer

SmallPathTextureLayer

public TerrainTextureLayer SmallPathTextureLayer { get; }

Property Value

TerrainTextureLayer

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

temperature float
humidity float

Returns

float

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

temperature float
humidity float

Returns

float

ContainsClimate(float, float)

public bool ContainsClimate(float temperature, float humidity)

Parameters

temperature float
humidity float

Returns

bool

ContainsHeight(float)

public bool ContainsHeight(float height)

Parameters

height float

Returns

bool

FindOwnVariant(string)

The template's own variant with this key, or null.

public BiomeClimateVariant FindOwnVariant(string variantKey)

Parameters

variantKey string

Returns

BiomeClimateVariant

GetAllTextureLayersInOrder()

All texture layers in painting order: main, details, roads, cliffs, riverbed, lakebed. Cached.

public List<TerrainTextureLayer> GetAllTextureLayersInOrder()

Returns

List<TerrainTextureLayer>

HasValidTextureLayers()

True when at least one layer has a texture to paint with.

public bool HasValidTextureLayers()

Returns

bool

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

typeName string

The name of the type (e.g., "RaceTemplate") under which the object is currently being cached.

resourceName string

The name of the ScriptableObject asset (e.g., "HumanRace").

resourceID int

The 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

typeName string

The name of the type (e.g., "RaceTemplate") from which the object is being removed from cache.

resourceName string

The name of the ScriptableObject asset (e.g., "HumanRace").

resourceID int

The 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

rng DeterministicRNG

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

temperature float
humidity float

Returns

BiomeClimateVariant

TierName(int)

Human name of an elevation tier, for tools.

public static string TierName(int tier)

Parameters

tier int

Returns

string