Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Dissecting the development of Dwarf Fortress with creator Tarn Adams (2019) (gamasutra.com)
2 points by rntksi on March 24, 2021 | hide | past | favorite | 1 comment


I really liked this bit where he explains how the game creates the world for players to play on:

"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 weather variables.

History itself can begin at this point. Civilizations and caves are placed. It's a bit complicated to go into what happens after that, but the basic idea is that there's a giant zero-player strategy game going on with somewhat loose turn rules and bad AI (but thousands of agents), and history is just a record of that. Procedurally generating stories by recording a log of a simulation is a valid enough approach, though it has drawbacks, of course. It's a lot of work, you need to do post-processing or investigation to find any good moments you'd like to highlight, and if you don't have enough dynamics and mechanisms, the output can be boring (in any number of ways.)"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: