Back

Map Topography

Written By: DF Wiki

Fiction
First Dwarf Fortress generates the map topography. This process is generally much faster than history generation (unless you've specified parameters that lead to constant map rejections).

In an interview[1] , Toady One described map generation:

    "It allocates the memory for the map. Then it chooses what sort of pole (e.g. north, south) it is going to have (or respects the parameters fed by the player, throughout.) The basic map field values (elevation, rainfall, temperature, drainage, volcanism, wildness) are seeded along a grid of variable size, respecting various settings (oceans, island sizes, other variances, etc.), and then filled in fractally. The poles vary the temperature, and it selects some points for the highest peaks. Here it does a first pass to see how it is doing, and attempts to adjust some altitudes to fit the map within the desired parameters if it missed. The world can be rejected at this point if it is unfixable, and it tries again.

    The first derived field, vegetation,
     is then set based on elevation, rainfall, temperature, etc., and it tests for biome rejections if the map's biomes don't satisfy the ranges set in the parameters. The mid-level elevations are smoothed at this point to make more plains areas, and volcanoes are placed respecting the hot spots in the volcanism field.

    Then we enter the erosion and river stage. Small oceans are dried out, and it locates edges of mountain sides where it can run test rivers. It also places the camera on one of these so the player can watch the process. Many fake rivers flow downward from these points, carving channels in the elevation field if they can't find a path to the sea. Extreme elevations differences are often smoothed here so that everything isn't canyons. Ideally we'd use mineral types for that, but we don't yet. Lakes are grown out at several points along the rivers.

     Elevations are smoothed again from the mountains down to the sea, and the peaks and volcanoes do some local adjustments. Now that the elevations are finalized, it makes adjustments to rainfall based on rain shadows and orographic precipitation. Temperatures are reset based on elevation and rainfall and the dampening effects of forests, and it uses the new values to set the vegetation level one final time. Salinity values are set for the ocean and tiles neighboring the ocean.

    Now that everything has settled down, we can detect the limits of the final biome regions and give them names and their own identity. We also add the geological layers and the underground layers here, though the geological stuff should really be earlier, as previously mentioned. There's a final verification process against the parameters here, to make sure it hasn't drifted too far afield from what the player wanted. Once that's done, it generates the initial wildlife populations in each region, and sets some weath
er variables.