← Back to query
RI-01 Namespace: Verse

Rand & RNG

Temperature dependency: equalizeCells.Shuffle() consumes global Rand state

Temperature → Rand Connection
On every room rebuild (wall/door built or removed), equalizeCells.Shuffle() is called. This consumes Rand calls from the global RNG state. If rooms are rebuilt at different times on different clients → different Rand sequence → desync.
#1 Global State Verse/Rand.cs:13-17

MP-Critical — Two fields define the entire RNG state: seed (uint) and iterations (uint). Every Value call increments iterations by 1. Determinism depends on all clients making exactly the same number of Rand calls.

Temperature link: equalizeCells.Shuffle() calls Rand.Range() once per cell. A room with 50 equalizeCells consumes 50 Rand calls on every rebuild.

#2 PushState/PopState — Isolation Verse/Rand.cs:440-454

Stack-based state management: PushState() saves current seed+iterations and sets new seed. PopState() restores old state.

Temperature link: The Shuffle in RegenerateEqualizationData does NOT use PushState — it consumes global Rand directly. That's why it's MP-critical. Had Ludeon used PushState, it wouldn't be a desync risk.