Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 4

Author Topic: Advanced World Gen !Science!  (Read 22130 times)

SAFry

  • Bay Watcher
  • Call me Seb
    • View Profile
Advanced World Gen !Science!
« on: June 25, 2012, 12:00:22 pm »

I've been messing around with the advanced world generation parameters quite a bit lately and I'd like to share a few observations and invite any comments or suggestions.

Firstly, I've been reading about what we already know in the Wiki http://dwarffortresswiki.org/index.php/Advanced_world_generation but to summarise there are 3 main types of controls regarding geography.

These are:

Minima and Maxima - for Elevation, Rainfall, Temperature, Drainage and Savagery. The world automatically goes from hot to cold along the Y axis and has random distribution of the other attributes but it always stays within the minimum and maximum values although the end result can be altered by other factors later on.

Weighted Distribution Meshes - this is a way to influence the distribution of attributes within the minima and maxima, there is the mesh size and then you can set the frequency of the five 20% percentile ranges. One hypothesis I wanted to test was if these percentile ranges fit themselves to the minima and maxima range. Also one might assume that a 2x2 mesh size is like a small brush and a 16x16 is a large brush but is that true?

Minimum Counts - then there is a bunch of different minimum square and region counts, these are for the basic attributes and for terrain types which are derived from the actual combination of attributes. These however do not influence the generation of the map, they just reject the map for a 'reroll' until one is finally generated that has the required minimum count. One exception to this is possibly river count which might actually set the number of rivers.

So in order to do some actual !science! I started off by making a blank world which has the minima and maxima from pre-set medium region, I'll take these to be the default values. The meshes are all set to 'ignore' so they aren't in use. The minimum counts have all been disabled so we're just looking at what the first world we generate is, not scumming for an unlikely world.

Here is the blank world gen recipe with a pre-set seed so it always makes the same world, this can be used as the baseline:

Spoiler (click to show/hide)
« Last Edit: June 25, 2012, 03:04:43 pm by SAFry »
Logged

SAFry

  • Bay Watcher
  • Call me Seb
    • View Profile
Re: Advanced World Gen !Science!
« Reply #1 on: June 25, 2012, 12:13:14 pm »

The first thing I do is a little experiment, according to the Wiki any square with a rainfall of less then 10 should be a desert although they did note this isn't always the case. So I set the min rainfall to 0 and max to 10, generate the world and I notice 2 things:

1, it didn't generate the same world, I assumed it would be the same world but with no rain, nope. There were no rejections so that wasn't it.

2, it wasn't all desert, there is badlands and even some forest but it was definitely dryer.

OK, so this is a problem, I can't directly compare what different setting do because it generates a different world when you change the settings. Well I guess I can still make some comparisons.

Then I set the the rainfall to 0-0, the world STILL has some forest so I try another experiment, I turn off the 'Do Orographic Precipitation and Rain Shadows' and notice 2 things:

1, it's the same world, 'Do Orographic Precipitation and Rain Shadows' doesn't change the 'seed' as it were.

2, there is now no trees, so the 'Do Orographic Precipitation and Rain Shadows' (OPRS) can add rain where there would have been none according to the minima and maxima.

Well, there is a little bit of knowledge gained form !science! already, back later for more. 

Some illustration;

Zero rain with OPRS

Spoiler (click to show/hide)

Zero rain without OPRS

Spoiler (click to show/hide)




 
« Last Edit: June 25, 2012, 01:21:14 pm by SAFry »
Logged

Hanslanda

  • Bay Watcher
  • Baal's More Evil American Twin
    • View Profile
Re: Advanced World Gen !Science!
« Reply #2 on: June 25, 2012, 12:31:12 pm »

This is highly useful science and I applaude your efforts.
Logged
Well, we could put two and two together and write a book: "The Shit that Hans and Max Did: You Won't Believe This Shit."
He's fucking with us.

vidboi

  • Bay Watcher
    • View Profile
Re: Advanced World Gen !Science!
« Reply #3 on: June 25, 2012, 12:59:35 pm »

The first thing I do is a little experiment, according to the Wiki any square with a rainfall of less then 10 should be a desert although they did note this isn't always the case. So I set the min rainfall to 0 and max to 10, generate the world and I notice 2 things:

1, it didn't generate the same world, I assumed it would be the same world but with no rain, nope. There were no rejections so that wasn't it.

2, it wasn't all desert, there is badlands and even some forest but it was definitely dryer.

OK, so this is a problem, I can't directly compare what different setting do because it generates a different world when you change the settings. Well I guess I can still make some comparisons.

Then I set the the rainfall to 0-0, the world STILL has some forest so I try another experiment, I turn off the 'Do Orographic Precipitation and Rain Shadows' and notice 2 things:

1, it's the same world, 'Do Orographic Precipitation and Rain Shadows' doesn't change the 'seed' as it were.

2, there is now no trees, so the 'Do Orographic Precipitation and Rain Shadows' can add rain where there would have been none according to the minima and maxima.

Well, there is a little bit of knowledge gained form !science! already, back later for more.

The presence of deserts, badlands etc. is decided by both the rainfall and the drainage. A desert needs both very low rainfall and high drainage to appear which explains why not all low rainfall regions are deserts. There are some parameters (min-maxes) which will completely change a world, whereas others such as the rainfall and erosion parameters will create a world that looks the same (same region placement) but with different terrain on embark (such as trees, layer minerals [which aren't changed by mineral scarcity] and magma pipe placement [including volcanoes]).

It's good that someone's doing some good science on advanced world gen as there are a lot of myths out there.
Logged

SAFry

  • Bay Watcher
  • Call me Seb
    • View Profile
Re: Advanced World Gen !Science!
« Reply #4 on: June 25, 2012, 01:41:27 pm »

Added some screen shots to my last post to spice it up a bit. By the way I'm using Phoebus tileset and 34.11.


The presence of deserts, badlands etc. is decided by both the rainfall and the drainage. A desert needs both very low rainfall and high drainage to appear which explains why not all low rainfall regions are deserts. There are some parameters (min-maxes) which will completely change a world, whereas others such as the rainfall and erosion parameters will create a world that looks the same (same region placement) but with different terrain on embark (such as trees, layer minerals [which aren't changed by mineral scarcity] and magma pipe placement [including volcanoes]).


Interesting considering the Wiki suggests that drainage isn't a factor in desert formation http://dwarffortresswiki.org/index.php/Advanced_world_generation#Biome_Type_Requirement_Table time for some empirical research!

First I'm using the zero rainfall and no OPRS and I set the drainage to 100-100 and here is the result:

Spoiler (click to show/hide)

So we have a LOT of badlands and note that the world has changed again.

Next we have zero rainfall, no OPRS and drainage of 0-0:

Spoiler (click to show/hide)

and we have all nice multicoloured deserts! But also interesting to note, it's the same world!? So drainage 0-100 = world A, drainage 0 = world B and drainage 100 = world B, that was unexpected.

Oh well, another glistening lump of knowledge ripped from the earth and a possible revision to the Wiki. Good call Vidboi.
« Last Edit: June 25, 2012, 03:42:01 pm by SAFry »
Logged

vidboi

  • Bay Watcher
    • View Profile
Re: Advanced World Gen !Science!
« Reply #5 on: June 25, 2012, 01:46:28 pm »

Oh well, another glistening lump of knowledge ripped from the earth and a possible revision to the Wiki. Good call Vidboi.

Well that's odd, I'm sure I found that out from the wiki in the first place. I guess there are quite a lot of inconsistencies with the wiki, so it's good you're sorting them out for good.
Logged

SAFry

  • Bay Watcher
  • Call me Seb
    • View Profile
Re: Advanced World Gen !Science!
« Reply #6 on: June 25, 2012, 01:53:27 pm »

Oh looking at the wiki the chart says "N/A" but the footnote says it relates to drainage but needs verification, I'd say we just verified it. In fact you could change the chart to include both desert and badlands as separate biomes and the formula for each.

khearn

  • Bay Watcher
    • View Profile
Re: Advanced World Gen !Science!
« Reply #7 on: June 25, 2012, 02:11:22 pm »

I suspect the reason you're seeing different results with drainage 0-100 but the same between 0-0 and 100-100 is because of the way "random" numbers work. The program starts with a seed value, and uses it to create a new "random" number and a new seed. Then the next time it needs a random number, it uses the new seed and creates another new seed, which it uses next time. The sequence of numbers will always be the same given the same initial seed. So if you always do the same set of calculations and ask for the same number of random numbers, you'll always get the same results. But if you need to make more decisions in one step, then any later steps will get different numbers.

So if you have a range of values for drainage, there will have to be a random number generated for each region to determine its drainage. That gives you the first world. The second world requires no random numbers to determine the drainage, since it is set to 0, so subsequent stages of the gen get different numbers than the first world. The third world also has no decisions to make regarding drainage because it is set to 100, so all later random numbers are going to be the same as they were for the second world.

If you make a world with drainage set to 0-1, I suspect it will look like the first world because there are the same number of random numbers generated to determine the drainage, so subsequent stages will get the same sequence of numbers. This assumes that it takes the same number of random numbers to come up with a value in the 0-100 range as it takes to make one in the 0-1 range. That's probably true, but it's conceivable that Toady does something more complicated.
Logged
Have them killed. Nothing solves a problem quite as effectively as simply having it killed.

SAFry

  • Bay Watcher
  • Call me Seb
    • View Profile
Re: Advanced World Gen !Science!
« Reply #8 on: June 25, 2012, 03:01:00 pm »

If you make a world with drainage set to 0-1, I suspect it will look like the first world because there are the same number of random numbers generated to determine the drainage, so subsequent stages will get the same sequence of numbers. This assumes that it takes the same number of random numbers to come up with a value in the 0-100 range as it takes to make one in the 0-1 range. That's probably true, but it's conceivable that Toady does something more complicated.

OK, I think I get what you're saying but; drainage 0-100 = world A, drainage 0-0 = world B, drainage 100-100 = world B and drainage 0-1 *drumroll* = world C!

Yeah so drainage range of 0-1 makes a 3rd world:

Spoiler (click to show/hide)

what if I do one with drainage 99-100?

Spoiler (click to show/hide)

It's world C again!

So it seems like the size of the range is the factor in the seed generation you describe Khern. A range of 100 gives world A, a range of 1 (0-0 & 100-100) gives world B and a range of 2 (0-1 & 99-100) gives world C.

khearn

  • Bay Watcher
    • View Profile
Re: Advanced World Gen !Science!
« Reply #9 on: June 25, 2012, 03:04:09 pm »

I'm mildly surprised. I was expecting that any range would give world A. But I'm not exactly shocked.
Logged
Have them killed. Nothing solves a problem quite as effectively as simply having it killed.

SAFry

  • Bay Watcher
  • Call me Seb
    • View Profile
Re: Advanced World Gen !Science!
« Reply #10 on: June 25, 2012, 03:37:00 pm »

Right, onto the next experiment, rainfall set to 0, no OPRS then it's time to try different drainages with the Min-Max the same:

00-32 sand desert
33-49 - rocky wasteland
Spoiler (click to show/hide)
50-65 - rocky wasteland but different characters/appearance
Spoiler (click to show/hide)
66-100 - badlands

OK, well that's the desert sub-categories split down by drainage. Good old world B throughout again too so that adds more data to that hypothesis.

Wannabehero

  • Bay Watcher
    • View Profile
Re: Advanced World Gen !Science!
« Reply #11 on: June 25, 2012, 04:26:57 pm »

I know you are just getting started, but this is excellent !SCIENCE!  I am watching your outcomes with great interest.
Logged

darkrider2

  • Bay Watcher
    • View Profile
Re: Advanced World Gen !Science!
« Reply #12 on: June 25, 2012, 05:28:49 pm »

I think the world genning differently is due to the way procedural generation works.

The seed remains the same but the way the seed gets manipulated to create the world is altered by the range of available drainage/rainfall levels. And thus a different world.
Logged

SAFry

  • Bay Watcher
  • Call me Seb
    • View Profile
Re: Advanced World Gen !Science!
« Reply #13 on: June 25, 2012, 06:10:27 pm »

I think the world genning differently is due to the way procedural generation works.

The seed remains the same but the way the seed gets manipulated to create the world is altered by the range of available drainage/rainfall levels. And thus a different world.

It must be something like that, not really worth digging into it too deeply but it was unexpected that changing one of ranges would effectively change the seed of the world.

I've done a bit of investigation as to what you can and can't change without changing the bare bones of the world and I'll write that up tomorrow but it looks like some things are safe whilst others definitely aren't.

knutor

  • Bay Watcher
  • ..to hear the lamentation of the elves!
    • View Profile
Re: Advanced World Gen !Science!
« Reply #14 on: June 25, 2012, 11:41:57 pm »

What I would like the most out of Adv Worldgen SCIENCE! is if someone could define the range of possible entities that occupy the sites in the [SITE_CAP:1040].  Just who and how many civilizations can settle in these 1040 sites?  I'm positive the two newest occupiers Kobolds and Undead have their own place at the dinner table with the legacy civilizations(human, goblin, elf and dwarf).  But do they use SITE_CAP, to determine their location, or some other mysterious mystery.

But just what does the civilization dinner table look like?  Must [SITE_CAP] > Caves + Evil regions, to provide for the full variety of Civilization options?  It would appear so, if we are to expect Kobolds and Undead ARE actual civilizations, and not just figments of our imagination. 

The fact that the default map SITE_CAP hasn't been altered since these two new civilizations have been entered makes me believe, that their placement is not by mere chance alone, but a constraint of CAVE mins and Evil region mins.  Thanks, Knutor
Logged
"I don't often drink Mead, but when I do... I prefer Dee Eef's.  -The most interesting Dwarf in the World.  Stay thirsty, my friend.
Shark Dentistry, looking in the Raws.
Pages: [1] 2 3 4