v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "40d:World generation"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m
 
(81 intermediate revisions by 32 users not shown)
Line 1: Line 1:
[[Category:World]]
+
{{av}}{{Quality|Exceptional}}
 +
:''For information on advanced parameters, see [[Advanced World Generation]].''
  
To begin playing Dwarf Fortress, you must first create a world to play in. When you enter the world creation screen, you are presented with a screen full of options:
+
To begin playing Dwarf Fortress, you must first '''create a world''' to play in. When you enter the world creation screen, you are presented with a screen full of options:
  
== World Creation Options ==
+
== World creation options ==
  
Once you choose, 'Create World' you will be brought to the parameters screen. Pushing '''<tt>ENTER</tt>''' will start creating a world using the default (or selected) parameters. At the upper left hand corner, you will notice several settings. Here is a quick overview:
+
[[Image:Worldgen_advanced.png | none | frame | 500px | Opening world generation screen.]]
  
[[Image:World_creation_screen1.png]]
+
Once you choose "Design New World With Parameters" you will be brought to the parameters screen. (Choosing "Create New World Now! instantly creates a new world with the parameters which are listed second in the world_gen.txt file). Pushing {{k|Enter}} will start creating a world using the default (or selected) parameters. At the upper left hand corner, you will notice several settings. Here is a quick overview:
  
 
* '''[[#Title|Title]]''' - Where the title of your parameter type will be displayed
 
* '''[[#Title|Title]]''' - Where the title of your parameter type will be displayed
 
* '''[[#Seed|Seed]]''' - A random or predetermined number to be used in the process of world creation.
 
* '''[[#Seed|Seed]]''' - A random or predetermined number to be used in the process of world creation.
* '''[[#Name|Name]]''' - The name of your world, either random or predetermined.
+
* '''Dimensions''' - The size of your world
* '''[[#Parameter Selection|Parameter Selection]]''' - If you have saved different world generation parameters, they will be listed here.
+
* '''Random Name''' - The name of your world. In this example, the world's name will be generated randomly.
* '''[[#Options|Options]]''' - This is where you can choose to alter the various parameters for world generation.
 
  
 
=== Title ===
 
=== Title ===
  
This is just a name for your world generation template. Once you have multiple templates, you can [[#Parameter Selection | select]] the template you wish to use using the arrow keys or the numeric keypad.
+
This is just a name for your world generation template. Once you have multiple templates, you can [[#Parameter selection|select]] the template you wish to use using the arrow keys or the numeric keypad.
  
* To edit the name of your parameter template, press the '''<tt>'t'</tt>''' key.
+
* To edit the name of your parameter template, press the {{k|t}} key.
  
 
=== Seed ===
 
=== Seed ===
  
Generating [http://www.random.org/ a true random number] is an impossible task for a computer. Typically, an operating system or programming language uses the value in a quasi-random memory address to create what appears to be a random number. By feeding the same seed as another player directly into the generator, a player starts world generation on the same random number and theoretically should result in an identical world for both players. ''(Click the following link for more information on [http://en.wikipedia.org/wiki/Random_seed random seeds.])''
+
Generating [http://www.random.org/ a true random number] is an impossible task for a computer. Typically, a pseudo-random number generator uses a specially selected mathematical sequence to create what appears to be a random number. By feeding the same seed as another player directly into the generator, a player starts world generation at the same point in the sequence, which theoretically should result in an identical world for both players. ''(Click the following link for more information on [http://en.wikipedia.org/wiki/Random_seed random seeds.])''
  
* To use a random seed, press the '''<tt>'S'</tt>''' (i.e. '''<tt>SHIFT + S</tt>''' key. To use a specific seed, press the '''<tt>'s'</tt>''' key.
+
* To use a random seed, press the {{K|S}} key. To use a specific seed, press the {{k|s}} key.
  
 
=== Name ===
 
=== Name ===
  
This is where the name for your world will be displayed.  
+
This is where the name for your world will be displayed. You can enter a name or choose to have one randomly generated.
* To change the name of your world press the '''<tt>'n'</tt>''' key and typing in a name.
 
* To have the game select a name for your world press the '''<tt>'N'</tt>''' key.
 
  
=== Parameter Selection ===
+
* To change the name of your world press the {{k|n}} key, and type in a name.
 +
* To have the game select a name for your world press the {{K|N}} key.
  
On the right hand side of the screen will be a list for all of your saved parameter templates. By default, there is only one parameter set labeled '''<tt>'STANDARD'</tt>'''. You can select which parameter set you would like to use for world creation using the arrow keys ('''&uarr;''' and '''&darr;''') or the numeric keypad ('''<tt>8, 4, 9,</tt>''' and '''<tt>3</tt>''').
+
=== Parameter selection ===
  
* To save your current settings as a parameter set, press '''<tt>F6</tt>'''.
+
On the right hand side of the screen will be a list for all of your saved parameter templates. By default, there are five parameter sets labeled '''<tt>LARGE</tt>''', '''<tt>MEDIUM</tt>''','''<tt>SMALL</tt>''','''<tt>SMALLER</tt>''', and '''<tt>POCKET</tt>'''.  Smaller worlds are generated more quickly, but have less civilizations and less chance of generating an [[embarkment]] site with the combination of features you'd like.  You can change the world size to something other than a square using the keys {{k|i}}, {{k|u}}, {{k|p}}, and {{k|o}}.  Note that only available world widths/heights are 17, 33, 65, 129, and 257; even directly editing the <tt>world_gen.txt</tt> file will not let you use other sizes than these.
* To reset the parameters to the default settings, press '''<tt>F1</tt>'''.
+
 
* To create a new set of parameters, press '''<tt>a</tt>'''. To delete the current set of parameters, press '''<tt>d</tt>'''.
+
You can select which parameter set you would like to use for world creation using the arrow keys ( {{K|&uarr;}}  and {{K|&darr;}} ) and the page-up-/page down keys, or the numeric keypad ( {{k|8}} {{k|2}} {{k|9}} {{k|3}} ).
 +
 
 +
* To save your current settings as a parameter set, press {{K|F6}}.
 +
* To reset the parameters to the default settings, press {{K|F1}}.
 +
* To create a new set of parameters, press {{k|a}}. To delete the current set of parameters, press {{k|d}}. To copy the current set of parameters, press {{k|c}}.
  
 
=== Options ===
 
=== Options ===
Line 47: Line 50:
 
! Key !! Function !! Description
 
! Key !! Function !! Description
 
|-
 
|-
| '''<tt>a</tt>''' || New parameter set || Create a new parameter set
+
| <center>{{k|a}}</center> || New parameter set || Create a new parameter set
 +
|-
 +
| <center>{{k|d}}</center> || Delete parameter set || Delete the currently selected parameter set
 
|-
 
|-
| '''<tt>d</tt>''' || Delete parameter set || Delete the currently selected parameter set
+
| <center>{{k|c}}</center> || Copy parameter set || Creates a copy of the currently selected parameter set
 
|-
 
|-
| '''<tt>8293</tt>''' || Navigate the parameters || '''<tt>8</tt>''' and '''<tt>2</tt>''' &rarr; move up and down  
+
| {{K|&uarr;}} {{K|&darr;}} {{K|PgUp}} {{K|PgDown}} ({{k|8}} {{k|2}} {{k|9}} {{k|3}}) || Navigate the parameter sets || {{k|8}} and {{k|2}} → move up and down  
'''<tt>9</tt>''' and '''<tt>3</tt>''' &rarr; page up and down
+
{{k|9}} and {{k|3}} → page up and down
 
|-
 
|-
| '''<tt>t</tt>''' || Enter title || Edits the name of your parameter set
+
| <center>{{k|t}}</center> || Enter title || Edits the name of your parameter set
 
|-
 
|-
| '''<tt>N</tt>''' || Use random name || Sets your world to generate a random name upon creation
+
| <center>{{K|N}}</center> || Use random name || Sets your world to generate a random name upon creation
 
|-
 
|-
| '''<tt>n</tt>''' || Enter custom name || Prompts the user to input a name for their world
+
| <center>{{k|n}}</center> || Enter custom name || Prompts the user to input a name for their world
 
|-
 
|-
| '''<tt>S</tt>''' || Use random seed || Uses a random seed to generate a world.
+
| <center>{{K|S}}</center> || Use random seed || Uses a random seed to generate a world.
 
|-
 
|-
| '''<tt>s</tt>''' || Enter custom seed || Prompts the user to input a custom seed for world creation
+
| <center>{{k|s}}</center> || Enter custom seed || Prompts the user to input a custom seed for world creation
 
|-
 
|-
| '''<tt>F1</tt>''' || Reset world parameters || Resets the world parameters to their default values
+
| <center>{{K|F1}}</center> || Load world parameters || Resets the world parameters to their default values
 
|-
 
|-
| '''<tt>F6</tt>''' || Save world parameters || Saves the world parameters under the current [[#Title | title]]
+
| <center>{{K|F6}}</center> || Save world parameters || Saves the world parameters under the current [[#Title|title]]
 +
|-
 +
| <center>{{K|e}}</center> || Enter advanced parameters || Lets you edit advanced options for generating the world
 
|}
 
|}
  
== World Generation ==
+
== World generation ==
 +
 
 +
When you are ready to create your world, push {{k|Enter}}. You may be prompted to save your parameters if you have changed them from the default. The generator then begins to generate a world based on fractal algorithms. The process of creating a world can be very time-consuming, as any invalid maps are thrown out upon detection. Do not be surprised if it generates over a hundred separate worlds before creating one that is acceptable. Generating a world with advanced parameters that are very far from the default can cause many worlds to be generated and rejected for not meeting the requirements.
 +
 
 +
[[Image:Worldgen advanced progress.png | none | frame | 400px | World creation screenshot.]]
 +
 
 +
[[Image:Worldgen_advanced_finished.png | none | frame | 400px | World creation screenshot.]]
 +
 
 +
When the world is created, you will be given the option to export the map to a graphic file by pressing {{k|p}}. This will create a '''large''' BMP format [[Main:CP437|ASCII]] graphic of the created world. You can run the compress_bitmaps.bat batch file that comes included with the game (as of 33g) in the main dwarf fortress folder to convert the bitmap files to about 90% smaller .png files.
 +
 
 +
When you are finished, press {{k|Enter}} or {{k|Space}} to return to the title screen.
 +
 
 +
 
 +
=== Batch processing ===
 +
 
 +
==== In Windows ====
 +
 
 +
You can use this example to use the [[command line]] to create many worlds at once, without all the hassle. Copy the following code and save it as a batch (.BAT) file. This file will create 7 regions using random names and random seeds. It will also automatically output the parameters and an ASCII and detailed map for each of your worlds.
 +
 
 +
:'''Note:''' ''Make sure you don't already have region 1-7 in your save directory.''
 +
 
 +
<pre>
 +
for /L %%i in (1,1,7) do start /wait /high dwarfort -gen %%i RANDOM MEDIUM
 +
</pre>
 +
 
 +
:'''Note:''' ''If you are using a version of Dwarf Fortress that includes a space in the .exe name, use the following command to achieve the same results.
 +
 
 +
<pre>
 +
for /L %%i in (1,1,7) do start /wait /high "" "dwarf fortress" -gen %%i RANDOM MEDIUM
 +
</pre>
 +
 
 +
:'''Note:''' ''If you are typing this into a command prompt rather than making a batch file use %i rather %%i''
 +
 
 +
==== In Linux ====
 +
 
 +
Copy the following code into a file, and then make sure it can be executed by doing the [http://en.wikipedia.org/wiki/Unix_shell shell] command <tt>chmod +x filename</tt>.  It should be placed in the same directory as <tt>dwarfort.exe</tt>, and also be run in that directory.
 +
 
 +
:'''Note:''' ''Make sure you don't already have region 1-7 in your save directory.''
 +
 
 +
<pre>
 +
#!/bin/sh
 +
 
 +
for i in `seq 1 7`; do
 +
    ./df -gen $i RANDOM MEDIUM
 +
done
 +
</pre>
 +
 
 +
You can also type (or copy-and-paste) this file into an interactive shell (if you use [http://en.wikipedia.org/wiki/Bash Bash]).  If you type it in by hand, you can leave out the line with <tt>#!</tt> and the following blank line, since they won't do anything.
 +
 
 +
=== How World Generation Works ===
  
When you are ready to create your world, push '''<tt>ENTER</tt>'''. The generator then begins to generate a world based on fractal algorithms. The process of creating a world can be very time consuming, as any invalid maps are thrown out upon detection. Do not be surprised if it generates up to and over a hundred seperate worlds before creating one that is acceptable.
+
You may be curious about what's happening behind the scenes while your world is being generated, these are the steps the program goes through:
  
[[Image:World_creation_screen2.png]]
+
:'''Note:''' ''Information on this list is largely taken from the [http://www.gamasutra.com/view/feature/3549/interview_the_making_of_dwarf_.php?page=7 10 page interview] of [[Main:Toady|Toady]] at Gamasutra''
 +
# '''Preparing Elevation/Setting Temperature:''' Fractal maps are generated, laying out basic information about the world:
 +
#* Four main maps, used to generate biomes:
 +
#** Elevation: A process called Midpoint Displacement is used to plot out the lay of the land.
 +
#** Temperature: The temperature map is biased according to latitude and elevation.
 +
#** Rainfall: Later in the simulation, this map is biased according to factors such as [http://en.wikipedia.org/wiki/Rain_shadow rain shadow].
 +
#** Drainage: This tells how quickly [[water]] drains from an area.
 +
#* Four others:
 +
#** Vegetation: How dense the vegetation is in an area. This is later edited during history generation as [[civilization]]s log away at forests.
 +
#** Salinity: Differentiates saltwater/freshwater [[marsh]]es and other such things. Areas below a certain elevation (oceans) automatically get a salinity of 100.
 +
#** Savagery: How dangerous wildlife is in an area.
 +
#** Good/Evil: This affects the type of wildlife in an area.
 +
# '''Creating Biomes:''' Biomes are created based on elevation, temperature, rainfall, and drainage (for instance, if rainfall is >=66/100 and drainage is less than 50, then an area is a swamp).
 +
# '''Running Rivers:''' Now erosion and the creation of [[river]]s are simulated.
 +
#* To quote [[Main:Toady|Toady]]:  "It picks out the bases of the mountains (mountains are all squares above a given elevation), then it runs temporary river paths out from there, preferring the lowest elevation and digging away at a square if it can't find a lower one, until it get to the ocean or gets stuck. This is the phase where you see the mountain being worn away during world creation. I have it intentionally center on a mountain at that point so you can watch. ... This will generally leave some good channels to the ocean, so it runs the real rivers after this."
 +
# '''Forming Lakes:''' Lakes are created and rivers are finalized.
 +
#* River loops created by the previous step are fixed.
 +
#* Flow amounts are calculated to determine which rivers are tributaries.
 +
#* Rivers are also named during this step.
 +
# '''Forming Regions:''' Now the generator looks at the major [[biome]] that occupies each square, and forms [[regions]], or connected areas on the map that contain the same major biome type. Each region gets its own name via the [[Random Name Generator]].
 +
# '''Growing Vegetation:''' Vegetation populations are calculated for each area.
 +
# '''Verifying Terrain:''' At this time, the world is probably checked for consistency.
 +
# '''Recounting Legends:''' The history of the world is simulated up to the end year or until the 'Percentage Beasts Dead for Stoppage'-parameter is met.
 +
# '''Finalization:''' World generation variables are reviewed and finalized.
 +
# '''Upon Exit:''' All world information is exported to a "region" folder in 'data/save/'
  
[[Image:World_creation_screen3.png]]
+
====Rejects====
  
When the world is created, you will be given the option to export the map to a graphic file by presing '''<tt>p</tt>'''. This will create a large BMP format ASCII graphic of the created world.
+
Rejects can occur at any step up to terrain verification. They are the result of certain world variables going outside of ideal conditions, and result in the currently generating world being "tossed out" and another rolled up.  
  
[[Image:World_creation_screen4.png]]
+
The number of potential rejects is arbitrary, so if you are using a slow computer, or simply don't want to wait through world generation, you can download one of the [[Pregenerated Worlds]]. However, some find watching their world unfold to be a worthwhile experience. Also note that as Dwarf Fortress rises in versions, world generation will most likely become more interesting, particularly once overland armies are implemented.
  
When you are finished, press '''<tt>ENTER</tt>''' to return to the title screen.
+
{{World}}

Latest revision as of 20:30, 23 June 2017

This article is about an older version of DF.
For information on advanced parameters, see Advanced World Generation.

To begin playing Dwarf Fortress, you must first create a world to play in. When you enter the world creation screen, you are presented with a screen full of options:

World creation options[edit]

Opening world generation screen.

Once you choose "Design New World With Parameters" you will be brought to the parameters screen. (Choosing "Create New World Now! instantly creates a new world with the parameters which are listed second in the world_gen.txt file). Pushing Enter will start creating a world using the default (or selected) parameters. At the upper left hand corner, you will notice several settings. Here is a quick overview:

  • Title - Where the title of your parameter type will be displayed
  • Seed - A random or predetermined number to be used in the process of world creation.
  • Dimensions - The size of your world
  • Random Name - The name of your world. In this example, the world's name will be generated randomly.

Title[edit]

This is just a name for your world generation template. Once you have multiple templates, you can select the template you wish to use using the arrow keys or the numeric keypad.

  • To edit the name of your parameter template, press the t key.

Seed[edit]

Generating a true random number is an impossible task for a computer. Typically, a pseudo-random number generator uses a specially selected mathematical sequence to create what appears to be a random number. By feeding the same seed as another player directly into the generator, a player starts world generation at the same point in the sequence, which theoretically should result in an identical world for both players. (Click the following link for more information on random seeds.)

  • To use a random seed, press the S key. To use a specific seed, press the s key.

Name[edit]

This is where the name for your world will be displayed. You can enter a name or choose to have one randomly generated.

  • To change the name of your world press the n key, and type in a name.
  • To have the game select a name for your world press the N key.

Parameter selection[edit]

On the right hand side of the screen will be a list for all of your saved parameter templates. By default, there are five parameter sets labeled LARGE, MEDIUM,SMALL,SMALLER, and POCKET. Smaller worlds are generated more quickly, but have less civilizations and less chance of generating an embarkment site with the combination of features you'd like. You can change the world size to something other than a square using the keys i, u, p, and o. Note that only available world widths/heights are 17, 33, 65, 129, and 257; even directly editing the world_gen.txt file will not let you use other sizes than these.

You can select which parameter set you would like to use for world creation using the arrow keys ( and ) and the page-up-/page down keys, or the numeric keypad ( 8 2 9 3 ).

  • To save your current settings as a parameter set, press F6.
  • To reset the parameters to the default settings, press F1.
  • To create a new set of parameters, press a. To delete the current set of parameters, press d. To copy the current set of parameters, press c.

Options[edit]

Key Function Description
a
New parameter set Create a new parameter set
d
Delete parameter set Delete the currently selected parameter set
c
Copy parameter set Creates a copy of the currently selected parameter set
PgUp PgDown (8 2 9 3) Navigate the parameter sets 8 and 2 → move up and down

9 and 3 → page up and down

t
Enter title Edits the name of your parameter set
N
Use random name Sets your world to generate a random name upon creation
n
Enter custom name Prompts the user to input a name for their world
S
Use random seed Uses a random seed to generate a world.
s
Enter custom seed Prompts the user to input a custom seed for world creation
F1
Load world parameters Resets the world parameters to their default values
F6
Save world parameters Saves the world parameters under the current title
e
Enter advanced parameters Lets you edit advanced options for generating the world

World generation[edit]

When you are ready to create your world, push Enter. You may be prompted to save your parameters if you have changed them from the default. The generator then begins to generate a world based on fractal algorithms. The process of creating a world can be very time-consuming, as any invalid maps are thrown out upon detection. Do not be surprised if it generates over a hundred separate worlds before creating one that is acceptable. Generating a world with advanced parameters that are very far from the default can cause many worlds to be generated and rejected for not meeting the requirements.

World creation screenshot.
World creation screenshot.

When the world is created, you will be given the option to export the map to a graphic file by pressing p. This will create a large BMP format ASCII graphic of the created world. You can run the compress_bitmaps.bat batch file that comes included with the game (as of 33g) in the main dwarf fortress folder to convert the bitmap files to about 90% smaller .png files.

When you are finished, press Enter or Space to return to the title screen.


Batch processing[edit]

In Windows[edit]

You can use this example to use the command line to create many worlds at once, without all the hassle. Copy the following code and save it as a batch (.BAT) file. This file will create 7 regions using random names and random seeds. It will also automatically output the parameters and an ASCII and detailed map for each of your worlds.

Note: Make sure you don't already have region 1-7 in your save directory.
for /L %%i in (1,1,7) do start /wait /high dwarfort -gen %%i RANDOM MEDIUM
Note: If you are using a version of Dwarf Fortress that includes a space in the .exe name, use the following command to achieve the same results.
for /L %%i in (1,1,7) do start /wait /high "" "dwarf fortress" -gen %%i RANDOM MEDIUM
Note: If you are typing this into a command prompt rather than making a batch file use %i rather %%i

In Linux[edit]

Copy the following code into a file, and then make sure it can be executed by doing the shell command chmod +x filename. It should be placed in the same directory as dwarfort.exe, and also be run in that directory.

Note: Make sure you don't already have region 1-7 in your save directory.
#!/bin/sh

for i in `seq 1 7`; do
    ./df -gen $i RANDOM MEDIUM
done

You can also type (or copy-and-paste) this file into an interactive shell (if you use Bash). If you type it in by hand, you can leave out the line with #! and the following blank line, since they won't do anything.

How World Generation Works[edit]

You may be curious about what's happening behind the scenes while your world is being generated, these are the steps the program goes through:

Note: Information on this list is largely taken from the 10 page interview of Toady at Gamasutra
  1. Preparing Elevation/Setting Temperature: Fractal maps are generated, laying out basic information about the world:
    • Four main maps, used to generate biomes:
      • Elevation: A process called Midpoint Displacement is used to plot out the lay of the land.
      • Temperature: The temperature map is biased according to latitude and elevation.
      • Rainfall: Later in the simulation, this map is biased according to factors such as rain shadow.
      • Drainage: This tells how quickly water drains from an area.
    • Four others:
      • Vegetation: How dense the vegetation is in an area. This is later edited during history generation as civilizations log away at forests.
      • Salinity: Differentiates saltwater/freshwater marshes and other such things. Areas below a certain elevation (oceans) automatically get a salinity of 100.
      • Savagery: How dangerous wildlife is in an area.
      • Good/Evil: This affects the type of wildlife in an area.
  2. Creating Biomes: Biomes are created based on elevation, temperature, rainfall, and drainage (for instance, if rainfall is >=66/100 and drainage is less than 50, then an area is a swamp).
  3. Running Rivers: Now erosion and the creation of rivers are simulated.
    • To quote Toady: "It picks out the bases of the mountains (mountains are all squares above a given elevation), then it runs temporary river paths out from there, preferring the lowest elevation and digging away at a square if it can't find a lower one, until it get to the ocean or gets stuck. This is the phase where you see the mountain being worn away during world creation. I have it intentionally center on a mountain at that point so you can watch. ... This will generally leave some good channels to the ocean, so it runs the real rivers after this."
  4. Forming Lakes: Lakes are created and rivers are finalized.
    • River loops created by the previous step are fixed.
    • Flow amounts are calculated to determine which rivers are tributaries.
    • Rivers are also named during this step.
  5. Forming Regions: Now the generator looks at the major biome that occupies each square, and forms regions, or connected areas on the map that contain the same major biome type. Each region gets its own name via the Random Name Generator.
  6. Growing Vegetation: Vegetation populations are calculated for each area.
  7. Verifying Terrain: At this time, the world is probably checked for consistency.
  8. Recounting Legends: The history of the world is simulated up to the end year or until the 'Percentage Beasts Dead for Stoppage'-parameter is met.
  9. Finalization: World generation variables are reviewed and finalized.
  10. Upon Exit: All world information is exported to a "region" folder in 'data/save/'

Rejects[edit]

Rejects can occur at any step up to terrain verification. They are the result of certain world variables going outside of ideal conditions, and result in the currently generating world being "tossed out" and another rolled up.

The number of potential rejects is arbitrary, so if you are using a slow computer, or simply don't want to wait through world generation, you can download one of the Pregenerated Worlds. However, some find watching their world unfold to be a worthwhile experience. Also note that as Dwarf Fortress rises in versions, world generation will most likely become more interesting, particularly once overland armies are implemented.

Worlds