This question has popped up
here a while ago and I popped it up again
more recently.
Since nobody seemed to be interested in it, I decided it would be a nice project for me to code on my excessive spare time. But since I have a new job since this morning and I did not get past the initial theorycrafting, this might end up delayed by a few years so I would be glad if somebody more reliable than me addressed it.
Here are my thoughts on the project, very close to the ideas already mentioned in this thread but backed by looking at the current code and trying to minimize the changes to make.
- As MarvinPA mentioned, there are already two RNG states in the game, implemented in the 2-sized array asg_rng. The asg.cc source is quite daunting, and even more when you
read the explanations. But it already does everything that is needed. In particular, the second RNG is seeded by the first one, and deciding which one to use when computing a random value is simply a matter of putting the correct number in the argument of _random2.
Generalizing this to any number of different RNG states is really just a matter of changing the size of the array of asg_rng on line 13 of asg.cc
One can slightly modify every function in random.cc to use an optional argument for the choice of rng. The actual coding is then to chase every random instance in the code and decide which RNG one should use to do it.
- In that regard, for dungeon layout, the simplest choice to me looks to be to use a different RNG state for every branch, so that entering swamp before pan does not mix things up. The infiniteness of Pan and Zigs are
not an issue. Abyss seems to be much harder to tame though. I did not look at the code for two or more -level shafts, it might be necessary to edit it so that the intermediate levels get generated in the right order.
- Everything else you want to seed can be handled by adding yet another rng state (Ru's sacrifices, monster spawns, weapon branding).
- On the other hand, acquirements, gifts are ill-posed things to seed since they are modified by your current skills. Most things vary a lot with the way people play, so they are also unappropriate (Xom mood swings, miscasts, etc.)
TL;DR: This should be easy [edit:not too hard]. I will do it some day if nobody wants to.