Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Worldgen from parameters  (Read 288 times)

lifayt

  • Bay Watcher
    • View Profile
Worldgen from parameters
« on: September 08, 2010, 07:42:23 am »

If I want to gen the same world someone else genned, do i have to input the exact same parameters he did or will inputting the seeds alone do it?
Logged

FleshForge

  • Bay Watcher
    • View Profile
Re: Worldgen from parameters
« Reply #1 on: September 08, 2010, 07:45:11 am »

As far as I've seen, if any parameter is different, then the world will be different (sometimes dramatically different).  There may be some params that are not included in the overall calculation but I don't believe so.
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Worldgen from parameters
« Reply #2 on: September 08, 2010, 08:44:28 am »

More or less as just said, but how I'd put it (not based on DF experience, just my understanding of world creation) there are the seeds which affect which random outcome is attempted, parameters which limit outcomes and others that extend it.  (And another type, but could get complicated.)

A specific seed will start off a chain of 'random' (pseudo-random) numbers that are used whenever a decision is made.  That 'stream' is invariable, but may be used differently within the limiting variables:
  • If a limiting variable says "only use values from 5 to 95", then the random-number-of-the-instant might be scaled back from being 0 to 2^32 down to 5..95.  (That'd be sensible, at that level of scaling.)
  • On the other hand, it might be say "Is that number within the allowed range?  If not, get another (and repeat until it is).".  Obviously that'd be silly (throwing away an awful lot of perfectly good random numbers while trying to one within a very narrow range) in the above case.
There'd probably be a combination of that, though.  The random number of 0 to 2^32 (or whatever size it is) might be requested and then scaled back into a 0..100 range (e.g. for percentage purposes), and then if the number happened to be the 1 in 10 out-of-limit numbers it would re-request another one.  Not really so bad when not intended for cryptographically secure[1] purposes.

Of course, setting a different limit in that circumstance would not only mean that this would reject (or not reject) a previously valid (or invalid) value for a hill height, but mean that all subsequent hill-heights/whatever are working on a different part of the PRNG series.

And if your worldgen (for example) fails because it had 17 volcanoes, instead of a param-requirement of 18, then the next world would end up starting at a different point in the PRNG stream... Completely different.


Tell you what, though, when I was trying to replicate an error, recently, and mistyped a NAME_SEED (transposed a couple of digits, I think) the main difference was between the world being "Sn–nstrasp: The Oracular Planet" and "Usnuspstrasp: The Ageless Planet".  Which seems to suggest that a ten-digit number was being used to 'power' a name generation process.  And unless I'd happened upon a happy accident, it possibly even took the first half and the second half of the number apart (or seperated it by div/mod means, to the same end) and used them respectively for the construction of the name.  (It did not effect the names of people or creatures or locations or various other entities mentioned in Legends, which I must therefore presume used one of the other seeds to generate.)  Didn't experiment with that, but would appear to be a bit wasteful of entropy.

But that was a sample of one.

Sorry, rushed this, needs editing down and making less... vaguely wrong..., but I'm needed to go out on a call...
Logged