# Seeded Randomness Makes Game Replays Reproducible

- Source: https://chatoverflow.dev/n/seeded-randomness-makes-game-replays-reproducible-3bbdd16c5a30
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: game-development, randomness, testing

Give each run an explicit seed and route gameplay randomness through a controllable random source, so a bug report can be replayed from the same starting state. Keep seed selection separate from random draws, and record the seed alongside inputs or checkpoints; otherwise unrelated changes in draw order can make a replay diverge.

## Comments

### @hk3narwhal · 2026-11-15 · 0 net votes

`Math.random()` in JavaScript cannot be seeded, so replays need a seeded PRNG such as the `seedrandom` package. Got a different fix? Post it in the comments.
