Table of Contents

Class SceneObjectNameResolver

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

The pure half of scene-object naming: given settings, a race, a seed and a gender, produce the name. Both peers run exactly this from the same inputs, which is what lets the server ship a 4-byte seed instead of a string.

public static class SceneObjectNameResolver
Inheritance
SceneObjectNameResolver
Inherited Members

Methods

DeriveSeed(SceneObjectNamingSettings, string)

The seed a name is generated from. With a region seed it is a stable hash of region + object, so the same object gets the same name on every server start; otherwise it is a fresh draw per spawn. Never zero — zero is the wire's "no generated name" sentinel.

public static int DeriveSeed(SceneObjectNamingSettings settings, string fallbackObjectSeed)

Parameters

settings SceneObjectNamingSettings
fallbackObjectSeed string

Returns

int

GenderRng(int)

An RNG for the gender roll, kept apart from the name draw so changing the gender policy does not reshuffle names.

public static DeterministicRNG GenderRng(int seed)

Parameters

seed int

Returns

DeterministicRNG

ResolveBiome(SceneObjectNamingSettings, Vector3, WorldSceneSettings, out BiomeClimateVariant)

Builds the name. Returns false, with a reason, when the inputs cannot name the object — no templates loaded, no race for a race-driven mode, no biome for a biome-driven mode — so the caller can keep the authored name instead of guessing.

public static BiomeTemplate ResolveBiome(SceneObjectNamingSettings settings, Vector3 worldPosition, WorldSceneSettings scene, out BiomeClimateVariant variant)

Parameters

settings SceneObjectNamingSettings
worldPosition Vector3
scene WorldSceneSettings
variant BiomeClimateVariant

Returns

BiomeTemplate

ResolveGender(NamingGenderPolicy, RaceTemplate, DeterministicRNG)

Picks the gender for a name under the given policy. RaceModels draws only among genders the race actually has models for, so a male-only race never receives a feminine name; a race with no gendered sets falls back to a coin flip.

public static CharacterGender ResolveGender(NamingGenderPolicy policy, RaceTemplate race, DeterministicRNG rng)

Parameters

policy NamingGenderPolicy
race RaceTemplate
rng DeterministicRNG

Returns

CharacterGender

ResolveRace(SceneObjectNamingSettings, IFactionController)

The race a namer draws from: the explicit override when set, else the faction's race.

public static RaceTemplate ResolveRace(SceneObjectNamingSettings settings, IFactionController faction)

Parameters

settings SceneObjectNamingSettings
faction IFactionController

Returns

RaceTemplate

TryBuild(SceneObjectNamingSettings, RaceTemplate, int, CharacterGender, out string, out string, string, BiomeTemplate, BiomeClimateVariant)

public static bool TryBuild(SceneObjectNamingSettings settings, RaceTemplate race, int seed, CharacterGender gender, out string name, out string error, string autoProfession = null, BiomeTemplate biome = null, BiomeClimateVariant variant = null)

Parameters

settings SceneObjectNamingSettings
race RaceTemplate
seed int
gender CharacterGender
name string
error string
autoProfession string

Profession to use when the settings name none — the interactable's title, typically.

biome BiomeTemplate

The biome to name from, already resolved by ResolveBiome(SceneObjectNamingSettings, Vector3, WorldSceneSettings, out BiomeClimateVariant); null to use only the settings' explicit biome.

variant BiomeClimateVariant

The climate variant the place reads under; null for none.

Returns

bool

VariantAt(BiomeTemplate, WorldSceneSettings, byte)

The variant a wire index names, or null.

public static BiomeClimateVariant VariantAt(BiomeTemplate biome, WorldSceneSettings scene, byte index)

Parameters

biome BiomeTemplate
scene WorldSceneSettings
index byte

Returns

BiomeClimateVariant

VariantIndexOf(BiomeTemplate, WorldSceneSettings, BiomeClimateVariant)

Index of a variant in VariantsFor(BiomeTemplate, WorldSceneSettings) plus one; 0 when it is not one of them. What the wire carries.

public static byte VariantIndexOf(BiomeTemplate biome, WorldSceneSettings scene, BiomeClimateVariant variant)

Parameters

biome BiomeTemplate
scene WorldSceneSettings
variant BiomeClimateVariant

Returns

byte

VariantsFor(BiomeTemplate, WorldSceneSettings)

The variants a biome can show under a scene: its own, else the scene climate's defaults.

public static IReadOnlyList<BiomeClimateVariant> VariantsFor(BiomeTemplate biome, WorldSceneSettings scene)

Parameters

biome BiomeTemplate
scene WorldSceneSettings

Returns

IReadOnlyList<BiomeClimateVariant>