40d:Advanced world generation
|This article is about an older version of DF.|
World generation allows advanced options for customizing worlds. These parameters are not all well understood, so please contribute here as you experiment. This forum post has additional information on the parameters.
 Advanced Parameters
To access advanced parameters, press 'e' when at the screen for creating new worlds with parameters screen. This will bring you to an editable list of various guidelines the world-gen process will use when creating your new world.
Parameter sets are stored in world_gen.txt in the \data\init folder, using world tokens. You can copy and paste other player's sets of parameters into your world_gen.txt to use their parameter sets, and some are provided at Pregenerated worlds. Another place to find parameter sets is the Worldgen cookbook thread on the official forums.
 Seed Parameters
 Use Seed
This determines the seed number that will be used by the random-number generator in determining the randomness factors that go into creating your world.
 Use History Seed
Same as above but instead of determining terrain and world structure it handles historical figures and event outcomes. Some experimenting will need to be done to see if the same seed and a different World seed produce different events and figures.
 Use Name Seed
Same as above but used to determine the randomly selected name used by the program.
 Terrain Parameters
 <REGION-QUALITY> <X/Y>-Variaton
The variation parameters control how much or how little elevation, rainfall, temperature, drainage, volcanism, and savagery change over distance along the world's X-axis (west-east) and Y-axis (north-south). High values will cause the things to change quickly over short distances, while small values means that it will take some distance for these to change. Setting all of these to their maximum value (1600) will make it more likely that lots of different biomes will fit into a single fortress site. (NOTE: Increasing variance increases the number of subregions generated, so you'll likely need to increase the Maximum Number of Subregions parameter to prevent too many (or all) worlds from being rejected, or reduce the world size if the maximum of 5,000 subregions is reached).
Setting an X variance to 0 will cause the elevation/rainfall/etc to be exactly the same for any world-spanning west-east strip of the world. Setting a Y variance to 0 will do the same, but for north-south strips. If you set both the X and Y variance for something (say elevation) to 0, then a single elevation will be randomly picked and applied to the entire world, resulting in one vast plain or ocean.
 <REGION-QUALITY> Weighted Ranges
Elevation, rainfall, temperature, drainage, volcanism, and savagery can vary from 0 to 100 (with a later noted exception for elevation). The weighted ranges parameters let you decide how common or rare different range of these value will be, with the five available ranges being 0-20, 20-40, 40-60, 60-80, and 80-100. For example, with the weighted temperature ranges, you could choose for 50% 0-20 and 50% 80-100, to have a world made up entirely of freezing tundra/glaciers and burning deserts, or you could set it to 100% 40-60, to have the entire world be temperate.
The value used for each range is not a percentage, but a relative weight: you add up all the values for a particular quality and then divide that sum into each individual value to get a percentage. Some examples (with "0" meaning "None"):
|1, 1, 1, 1, 1||20%, 20%, 20%, 20%, 20%|
|2, 1, 1, 1, 1||33%, 16%, 16%, 16%, 16%|
|1, 0, 0, 0, 1||50%, 0%, 0%, 0%, 50%|
|0, 0, 1, 0, 0||0%, 0%, 100%, 0%, 0%|
Note on elevation: The values the game uses for elevation don't actually stop at 100, but rather 400. For the Elevation Weighted Ranges parameters, 100 means "100% of the maximum possible elevation", 40 mean "40% of the maximum possible elevation", and so on.
 Minimum Savagery/Maximum Savagery
Defines the minimum and maximum savagery per tile.
- 0 - 32: Benign
- 33 - 65: Neutral
- 66 - 100: Savage
Humans and Dwarves will not settle in savage areas.
Note that this setting is closely tied to the savagery squares settings. If you increase this number beyond 25 or so but do not increase the minimum number of mid- and high-savagery squares for your map you will have endless world rejects. The opposite is also true. If you specify a large number of high-savagery squares and no low-savagery squares and then set the above Minimum Savagery/Maximum Savagery percentage to 0, you will also have endless map rejects.
 Minimum Volcanism/Maximum Volcanism
 Minimum Volcano Number
Places volcanoes on tiles with a volcanism of 100. If there are not enough viable tiles the world is rejected.
 Minimum Mountain Peak Number
Places mountain peaks on tiles with an pre-erosion elevation of at least 380. If there are not enough viable tiles the world is rejected.
I'm not exactly sure what effect the peaks have but I suppose they withstand erosion better.
 Minimum Initial <TERRAIN TYPE> Square Count
Sets the absolute minimum number of <TERRAIN TYPE> tiles on the map, pre-erosion. If the number is too few for any one of these, the map will be rejected and things will start over. This is a fairly powerful tool and is very closely related to the mesh sizes and weights if you use them. Remember that as you change the meshes, you also have to change these since your ratios will be very different!
 Minimum Initial <TERRAIN TYPE> Region Count
Sets the absolute minimum number of <TERRAIN TYPE> regions on the map at the start, pre-erosion. If the number is too few for any one of these, the map will be rejected and things will start over. Regions are the contiguous clusters of one terrain type. If you set this to be large, then aside from generating tons and tons of rejects, you'll get a map that's got a very broken appearance.
 Minimum Final <TERRAIN TYPE> Region Count
Sets the absolute minimum number of <TERRAIN TYPE> tiles on the map, post-erosion. If the number is too few for any one of these, the map will be rejected and things will start over. The difference between this and the above trait is dependent on what terrain type it is. Mountains get eaten and fractured by rivers and erosion. So, you should probably expect to GAIN mountain regions after erosion. Marshes tend to grow as rivers and lakes cut away at other terrains, so they become more contiguous and reach around other barriers. You should expect to LOSE marsh regions after erosion.
 Erosion Cycle Count
 Minimum Number of <REGION-QUALITY> Squares
A world will be rejected if there are less than the number of required squares for each different region type. This can lead to a huge number of rejections, so you might want to turn these all down to zero.
 Historical Parameters
 End Year
Used to determine when the program will cease its generation and allow for play. As of right now other factors prevent the generator from getting to this date and is often cut off long before reaching it. If you want to play a game while two particular civilizations are at war, you can create a world, look through its history, then regenerate the world with the exact same seed and history seed, but set the End Year parameter to the year the war started.
 Population Cap after Civ Creation
How many creatures can exist in the game once civilizations have been added into generation.
 Percentage Beasts Dead for Stoppage
Determines how many megabeasts need to be dead before the world gen stops creating history. Is one likely cause for why the generator rarely reaches the entered End Date.
 Year to Begin Checking Megabeast Percentage
Determines when the game begins checking for the above precentage to see when the game should stop generating the world.
 Cull Unimportant Historical Figures
Instead of listing every event that happens, this option removes those events without related importance to the wider world, effectively reducing the number of events reviewable in the Legends screen. Changing this setting to "Yes" will result in culled figures being referred to as "Unknown Creature" in the kill lists of other Historical Figures.
 Reveal All Historical Events
Determines whether all events are open to review in the legends screen when you choose to begin a game. Setting this to no would require the usual exploration, talking, and engraving searching as before.
 Creature Parameters
 Maximum Natural Cave Size
Determines the size and depth of caves formed by world-gen. A cave with a greater "size" will be deeper and more sprawling, and therefore have more and more dangerous creatures. It is believed that large caves increases the lifespan of megabeasts.
 Number of Mountain Caves
Determines the number of caves to be placed in mountain regions. It is believed that large number of caves increases the lifespan of megabeasts.
 Number of Non-Mountain Caves
Determines the number of caves to be placed in other regions. It is believed that large numbers of caves increases the lifespan of megabeasts.
 Make Caves Visible
Makes caves visible on the world location selection screen.
 Number of Civilizations
Determines how many civilizations will be seeded into the generated world. Five is the typical number to produce the usual Dwarves, Humans, Elves, Goblins, and Kobolds.
- Error Code: Not enough entity placement locations: Decrease the Number of Civilizations, edit the settings so proper biomes are generated or generate bigger map.
 Playable Civilization Required
If set, all worlds where the no playable civilization has been placed at the beginning of history are rejected.
- Error Code: No controllable entity definitions available: Add some high (mountain) elevations to the map. Dwarf civ's will only appear on these tiles.
 Influencing Non-parameterized Features
It is believed that there will be many less aquifers if you make sure that there are no oceans (set Elevation Weighted Ranges 0-20 and 20-40 to 0/None to ensure that the minimum elevation is above 100, and set Minimum Ocean Edges to 0/None). High drainage will also reduce aquifers, but with the side effect of reducing lakes and swamps. Also, widespread high draining might lead to too many worlds being rejected.
 Experimenting with Parameters
To experiment with the parameters and to effectively see why rejections are coming back because of changes to the parameters, first you need to edit your init.txt and set [LOG_MAP_REJECTS:NO] to YES. This will create a text document that will describe why each copy of the generated world is rejected.
By going back and forth between this document and the parameters, you can begin to get an idea as to why endless cycles of rejected worlds come up. As you experiment please share your findings under each heading.
You can also directly edit the world_gen.txt file in \data\init to get around limits in the Advanced world generator. For example, you are limited to having 5000 max subregions, but if you go into the aforementioned file, you can go over this limit. This is especially useful when you encounter map rejects that say, for example, too many subregions.
 World Painter Parameters
|Desert Badlands A||50-65|
|Desert Badlands B||66-100|
* The forest regions can be changed between conifer, to broadleaf types by varying the temperature (to around > 65, depending on rain value).
The magma value (at 100%) can produce volcanoes if painted on the same tile as a mountain.
|World Generation (Basic/Advanced) - Regions - Climate - Surroundings - Map legend|
|Civilizations - Sites ( Cave - Town - Fortress - Ruin ) - Calendar|
|Aquifer - Brook - Chasm/Pit - Island - Tunnel - Volcano - Waterfall|
|Biomes|| Badlands - Desert - Flatland - Forest - Glacier - Lake - Marsh - Mountain - Murky pool|
Ocean - River - Rocky wasteland - Sand desert - Swamp - Tundra