Seed Providers
Seed providers control how RNGNeeds generates new seeds. This page is most useful when you care about deterministic behavior, reproducible debugging, automated tests, or a custom game-wide randomness policy.
The two layers to understand
Global seed provider
Configured through RNGNeeds Core. This controls how RNGNeeds generates fresh seeds globally whenever a list asks for a new one.
Per-list seed behavior
Controlled on each ProbabilityList<T> through Seed, CurrentSeed, and KeepSeed. This controls whether a list keeps or regenerates its seed between picks.
ISeedProvider
Seed provider contract
ISeedProviderThe interface used by RNGNeeds to generate seeds.
NewSeedReturns a new seed value.
A custom seed provider only needs to supply new seed values, but that simplicity is exactly what makes it useful: you can plug in your own deterministic or centralized seed strategy without changing selection code elsewhere.
Default behavior
RNGNeeds ships with a default seed provider used by RNGNeedsCore unless you replace it.
Typical workflows
Common seeding scenarios
Keep the same seed per listSet KeepSeed = true on the list and assign a seed manually if you want reproducible repeated picks from that list configuration.
Generate fresh seeds automaticallyLeave KeepSeed = false. The list regenerates its seed before each pick using the current global seed provider.
Replace global seed generationRegister your own provider through RNGNeedsCore.SetSeedProvider(...).
Example custom provider
public class FixedSeedProvider : ISeedProvider
{
private uint current = 12345;
public uint NewSeed => current++;
}
RNGNeedsCore.SetSeedProvider(new FixedSeedProvider());
Related APIs
Related members
RNGNeedsCore.SetSeedProviderReplaces the global provider.
RNGNeedsCore.ResetSeedProviderRestores default behavior.
RNGNeedsCore.NewSeedReturns a new seed generated by the active provider.