Namespace Shard.WorldGen.Rng
Classes
- JavaHash
Java's
String.hashCode(), replicated exactly:h = 31*h + cover the UTF-16 code units with 32-bit int overflow. .NET'sstring.GetHashCode()is randomized per-process and cannot be used — worldgen seeds derive from these hashes (via SeedBox), so they must match the reference generator bit-for-bit.
- JavaRandom
A bit-for-bit port of
java.util.Random— the 48-bit LCG that Hytale v2'sFastRandomand its noise-field seeding are built on. Terrain parity with the reference generator depends on this matching Java exactly (our xoshiro RNG does NOT — it must not be used on the worldgen seed path). Not thread-safe, mirroring the per-instance use in the Java generator.
- SeedBox
Port of the v2 generator's
SeedBox(builtin/HytaleGeneratorrng/SeedBox). A seed is a string key; Child(string) derives sub-seeds by concatenation (so a node's"Seed"string appends to the parent key), and CreateSupplier() turns the key into a deterministic int stream vianew JavaRandom(key.hashCode()). The concrete int seed a noise node gets isparentSeed.Child(seedKey).CreateSupplier()().