Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Sugestion for WorldGen Rejections  (Read 444 times)

Zemat

  • Bay Watcher
  • Zemat, programmer, cancels coding: Too insane.
    • View Profile
Sugestion for WorldGen Rejections
« on: July 22, 2008, 01:37:20 am »

I don't know how a new world starts generating after a rejection but I thought that probably Toady continues with the next values of the previously initialized RNG.

But then I tough... why not use the next RNG value from a rejected world as the seed for a new RNG and continue that way? This way when the worldgen successfully generates a world, the system can return the last seed used and the player could use it as a zero rejection seed instead of the faulty initial one.

Of course this has some mathematical and performance drawbacks since the Mersenne Twister uses the seed to fill a long list of numbers which are to be used to generate every pseudorandom returned by the RNG. Once this list is initialized there's no need to recalculate it's values until the list is exhausted, which enhances the performance of the RNG. But if the RNG where to be initialized with a new seed with every rejection this initialization process would induce a performance hit.

Also, mathematically, by resetting the RNG, the system would effectively kill maybe millions of possible RNG sequences that would generate valid worlds impossible to obtain thru zero-reject seeds. But since the number of zero-reject seeds is probably quite large I don't think this would be much of a problem for most players who anyway are already scouting to obtain zero-rejects seeds.

Maybe an option could be added to the worldgen configuration so that the player can decide if he wish to reset the RNG with every rejection using the last random number generated in worldgen as a seed (thus collecting in the end a zero-reject seed) or continue with the original seed.
« Last Edit: July 22, 2008, 01:41:13 am by Zemat »
Logged
You too can help bring to life the RogueLife Project!