class

FRandomStream

Module
Core
Header
#include "Core/FRandomStream.h"
Namespace
Mowo

Constructors

SignatureNameDescription
FRandomStream() noexceptFRandomStreamSeeds from a baked constant — fine for tests / fixtures, NOT for "random enough" gameplay rolls.
explicit FRandomStream(uint32_t seed) noexceptFRandomStream

Public functions

ReturnsNameDescription
voidInitializeReseed in-place.
uint32_tGetGlobalSeedThe process's gameplay seed.
boolIsGlobalSeedPinnedTrue when the seed came from --seed=N rather than entropy.
uint32_tSeedForA seed for one named stream.
uint32_tSeedForInstanceA distinct seed per call, still reproducible under --seed: for objects that each own a stream (an emitter, a preview) and must not all roll the same sequence side by side.
uint32_tDeriveSeedPure form of SeedFor, for callers that carry their own base seed (a host-distributed match seed, a test comparing two seeds in one process).
uint32_tRandRange32
floatFRandFloat in [0, 1).
floatFRandRangeFloat in [min, max].
int32_tRandRangeInt in [min, max] inclusive both sides.
boolRandBool
uint64_tGetStateCurrent state (for save/load).
uint64_tGetInc
voidRestoreState

Function details

FRandomStream

C++
FRandomStream() noexcept

Seeds from a baked constant — fine for tests / fixtures, NOT for "random enough" gameplay rolls. Seed those explicitly.

FRandomStream

C++
explicit FRandomStream(uint32_t seed) noexcept

Initialize

C++
void Initialize(uint32_t seed) noexcept

Reseed in-place. Wipes any rolled state.

GetGlobalSeed

C++
static uint32_t GetGlobalSeed()

The process's gameplay seed. Every stream that should differ between runs yet replay exactly under --seed=N derives from it; without the switch it comes from entropy once per process. Identity (FGuid, UUID) must never come from here — two processes sharing a seed would mint the same ids.

IsGlobalSeedPinned

C++
static bool IsGlobalSeedPinned()

True when the seed came from --seed=N rather than entropy.

SeedFor

C++
static uint32_t SeedFor(std::string_view salt)

A seed for one named stream. The salt keeps streams independent — two systems drawing from one seed would otherwise replay each other's rolls — while the global seed keeps all of them reproducible together.

SeedForInstance

C++
static uint32_t SeedForInstance(std::string_view salt)

A distinct seed per call, still reproducible under --seed: for objects that each own a stream (an emitter, a preview) and must not all roll the same sequence side by side. Replays exactly when construction order does.

DeriveSeed

C++
static uint32_t DeriveSeed(uint32_t baseSeed, std::string_view salt) noexcept

Pure form of SeedFor, for callers that carry their own base seed (a host-distributed match seed, a test comparing two seeds in one process).

RandRange32

C++
uint32_t RandRange32() noexcept

FRand

C++
float FRand() noexcept

Float in [0, 1).

FRandRange

C++
float FRandRange(float min, float max) noexcept

Float in [min, max].

RandRange

C++
int32_t RandRange(int32_t min, int32_t max) noexcept

Int in [min, max] inclusive both sides.

RandBool

C++
bool RandBool(float trueProbability = 0.5f) noexcept

GetState

C++
uint64_t GetState() const noexcept

Current state (for save/load). Two streams with identical (state, inc) produce identical sequences from that point.

GetInc

C++
uint64_t GetInc() const noexcept

RestoreState

C++
void RestoreState(uint64_t state, uint64_t inc) noexcept
Generated from Core/FRandomStream.h via core.json · Nov 5, 2026Version 1.0.0