Siegurt wrote:Previously I had suggested using the global "game seed" to pregenerate (and store) level generation seeds for each level, that way you don't need to pregenerate each entire level, just the seeds from which the levels will be generated when you do eventually enter them. (You can pregenerate seeds for all levels including ones that won't occur, generating <100 random seeds should be trivial in terms of CPU time)
This is a common suggestion that I have ended up answering many times, so I guess the answer needs better telegraphing somehow
.
This doesn't work for dcss, because level generation choices are not independent between levels. Here's a toy example: suppose the player is on D:10, and both D:11 and D:12 will, given their preset seeds, try to place Erolcha in the first attempt to build a level. If the player goes down stairs from D:10, Erolcha will place on D:11, and then when the player goes to D:12, the attempt to place Erolcha will fail, and something else will happen -- and because of the nature of rng, this will have a snowball effect on every random decision that happens after that (especially if it changes the
number of random draws, not just the outcome of a single draw). Alternatively, if the player falls through a shaft on D:10 and goes to D:12 directly, then Erolcha
would place there, and when they go up to D:11, Erolcha won't place and most likely they get an entirely different D:11 than what would have happened if they'd taken the stairs. This situation pops up for many, many placement choices that can happen during level building, not just uniques, and often times the outcome could be a veto of an entire attempt to build a level, with something new starting from scratch.
There are some rng techniques that can smooth out some of this, and other aspects could be designed around preemptively if one were designing a game from scratch, but crawl wasn't designed with strong seeding in mind. Consequently the only really practical option for completely replicating a dungeon is to build all the levels in the same order each time. (Actually, right now each branch has its own seed, but there's really not much point in making it as fine-grained as per level given all the confounds. In terms of debugging, at the moment it would probably just make my life harder to go per-level, because it would make seed bugs more subtle.)