Table of Contents

Class TerrainDetailBiomes

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Which biome's spawn rule made each of a terrain's detail prototypes, beside the terrain (written by the scene cut's scatter, TerrainScatter). The scatter makes one prototype per rule and prefab, so the grass on a terrain is several prototypes of one prefab, each painted where its own biome grows it; with this the client knows which biome's look a prototype's blades take (Biomes.BiomeTemplate.GrassTypes), and that its healthy and dry tints are its rule's.

[DisallowMultipleComponent]
public sealed class TerrainDetailBiomes : MonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
TerrainDetailBiomes
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
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

Remarks

Keyed by the prototype's prefab name and noise seed, not its index: the scatter seeds every prototype from its rule (a distinct seed per rule and prefab), both survive any copy of the prototype, and a prototype added afterwards (a point of interest's wheat, a hand-painted one) simply has no entry. By name rather than by reference so the record pulls no prefab into a build the terrain's own prototypes do not (the server strips those).

A biome is its cached-object id (Biomes.BiomeRegistry.IDOf), as the scene's biome map stores it, never a reference: a scene reference to a template would pull its art into the scene's bundle.

A point of interest's prototypes (a herb grove's herbs and flowers, a cave mouth's growth, a field's wheat: prototypes a site adds to a tile after the scatter) are recorded too since 2026-10-16, for the biome the site stands in, marked Site: they take that biome's look of the prefab (or the old look where it has none), and keep their material's tints, as they had before, since no rule of the biome chose them.

A site paints its own biome's prototype (2026-10-16, I4b): it reuses a tile's prototype of the plant only when that prototype is its own biome's (a rule's or an earlier site's, SiteLayer(string, int, IReadOnlyList<string>, IReadOnlyList<int>, IReadOnlyList<Entry>, out int)); where the tile's prototype of the plant is another biome's, the site adds one of its own (a copy of that one, with a noise seed of its own, SiteSeed(int, int, string, IReadOnlyList<string>, IReadOnlyList<int>, IReadOnlyList<Entry>)), so the plant takes the look of the biome the site stands in rather than whichever biome's prototype came first. Its cover goes on as before, measured against the plant's prototype it used to paint into (SiteCover(int, int, bool, int)), so a plant is no thicker for being split between two prototypes.

Fields

Prototypes

[Tooltip("Each detail prototype the scatter made from a biome's rule: its prefab's name, its noise seed and the biome's id. Written by the cut; not edited by hand.")]
public List<TerrainDetailBiomes.Entry> Prototypes

Field Value

List<TerrainDetailBiomes.Entry>

Methods

BiomeOf(string, int)

The biome id whose rule made a prototype of this prefab and noise seed; 0 when none is recorded.

public int BiomeOf(string prefabName, int noiseSeed)

Parameters

prefabName string
noiseSeed int

Returns

int

BiomeOf(Terrain, DetailPrototype)

The biome id recorded for a terrain's prototype; 0 when the terrain has no record or none for it.

public static int BiomeOf(Terrain terrain, DetailPrototype prototype)

Parameters

terrain Terrain
prototype DetailPrototype

Returns

int

RecordSite(string, int, int)

Records a prototype a point of interest added for the biome it stands in (Site), unless one is recorded already under the same prefab and seed (a rule's, or an earlier site's: a site adds its own prototype, with a seed of its own, wherever the tile's is another biome's, SiteLayer(string, int, IReadOnlyList<string>, IReadOnlyList<int>, IReadOnlyList<Entry>, out int)). True when it added the entry.

public bool RecordSite(string prefabName, int noiseSeed, int biomeID)

Parameters

prefabName string
noiseSeed int
biomeID int

Returns

bool

SiteCover(int, int, bool, int)

The cover a site leaves in its own prototype of a plant at one detail cell, where it wants want and grows only ever more: measured, as it always was, against the plant's prototype it used to paint into (the tile's first of the plant, baseCover) together with its own (ownCover), and only the difference added to its own. sameLayer: its own is that first one (the tile had no other biome's prototype of the plant first), so the cell is simply raised to want. Either way the plant's cover in the two is what one prototype held before.

public static int SiteCover(int baseCover, int ownCover, bool sameLayer, int want)

Parameters

baseCover int
ownCover int
sameLayer bool
want int

Returns

int

SiteLayer(string, int, IReadOnlyList<string>, IReadOnlyList<int>, IReadOnlyList<Entry>, out int)

The prototype a point of interest of biome biomeID paints a plant (prefabName) into on a tile whose prototypes are prefabs (their prefabs' names, null for none) and seeds (their noise seeds), recorded in entries: the first prototype of the plant recorded for the same biome (a rule's or an earlier site's), or -1 when there is none and the site adds its own. first is the tile's first prototype of the plant whatever its biome (-1 when it has none): the one a site painted into before, which an added prototype copies. A site with no biome (0) takes the first, as before.

public static int SiteLayer(string prefabName, int biomeID, IReadOnlyList<string> prefabs, IReadOnlyList<int> seeds, IReadOnlyList<TerrainDetailBiomes.Entry> entries, out int first)

Parameters

prefabName string
biomeID int
prefabs IReadOnlyList<string>
seeds IReadOnlyList<int>
entries IReadOnlyList<TerrainDetailBiomes.Entry>
first int

Returns

int

SiteSeed(int, int, string, IReadOnlyList<string>, IReadOnlyList<int>, IReadOnlyList<Entry>)

The noise seed of a prototype a site adds for its biome: seed (the one it copied), unless a prototype of the same plant on the tile has it or the record names the plant with it, then hashed with the biome until neither does, so every prototype of a plant is told apart by its seed (TerrainDetailBiomes.Entry's key). Deterministic: a re-cut adds the same.

public static int SiteSeed(int seed, int biomeID, string prefabName, IReadOnlyList<string> prefabs, IReadOnlyList<int> seeds, IReadOnlyList<TerrainDetailBiomes.Entry> entries)

Parameters

seed int
biomeID int
prefabName string
prefabs IReadOnlyList<string>
seeds IReadOnlyList<int>
entries IReadOnlyList<TerrainDetailBiomes.Entry>

Returns

int

TryGet(IReadOnlyList<Entry>, string, int, out Entry)

The entry a list records for a prototype of this prefab and noise seed (the first); false when none is.

public static bool TryGet(IReadOnlyList<TerrainDetailBiomes.Entry> entries, string prefabName, int noiseSeed, out TerrainDetailBiomes.Entry found)

Parameters

entries IReadOnlyList<TerrainDetailBiomes.Entry>
prefabName string
noiseSeed int
found TerrainDetailBiomes.Entry

Returns

bool

TryGet(string, int, out Entry)

The entry recorded for a prototype of this prefab and noise seed; false when none is.

public bool TryGet(string prefabName, int noiseSeed, out TerrainDetailBiomes.Entry found)

Parameters

prefabName string
noiseSeed int
found TerrainDetailBiomes.Entry

Returns

bool

TryGet(Terrain, DetailPrototype, out Entry)

The entry recorded for a terrain's prototype; false when the terrain has no record or none for it.

public static bool TryGet(Terrain terrain, DetailPrototype prototype, out TerrainDetailBiomes.Entry entry)

Parameters

terrain Terrain
prototype DetailPrototype
entry TerrainDetailBiomes.Entry

Returns

bool