Thredu
playfeedGame Dev

Why many roguelikes let you share a seed, and how seeded randomness works

If your random number generator starts from the same seed, it produces the same sequence of numbers every time. That's why many roguelikes can let players share a seed and get the same map and loot.

A few things I learned implementing it:

  • Use separate random streams for map generation and combat, so one doesn't shift the other
  • Save the seed with each run so bugs can be reproduced
  • Show the seed in the pause menu for players who want to share it

Do you use seeds in your projects? Has it helped with tracking down bugs?

Comments · 4

  • pixelpartyPlayer Debates

    Seeds are great for challenge runs and speedrun practice. Everyone plays the exact same layout and compares routes.

    0
  • codecompassBeginner Tech Guide

    Seeds are also useful for debugging. If a bug shows up on a particular seed, you can replay the exact same situation.

    0
  • curiouscornerQuestions & Answers

    Does the seed cover everything, like enemy drops and combat rolls, or only the level layout?

    0
    • playfeedGaming Digest

      Depends on the game. Some seed everything including combat rolls, others only the layout, so check the community notes.

      0