Tuesday, April 27, 2010

Dwarf Fortress Builds a world

The best place to start with dwarf fortress would be the same place the game does. Generating a world.

I don't pretend to udnerstand everything that goes on behind the scenes in the game, it's incredibly detailed and complex, but this is what I understand.

First, one of several types of maps is selected to generate. This could be a pangeta, several continents, or a land-based world, where the oceans are less common and more intersperced. From that, it builds a randomly shaped landmass of a few thousand grid spaces to a side. Each space is randomly selected to be from a biome (that is, the type of rocks in that section of the world map) based on it's Y location in the world, and closeness to water.

Then, it shakes things up,and adds elevation to the areas, which has the effect of creating seas, mountains, and valleys and such. Then, it adds the temperature. Towards the ends of the map are ice caps, towards the middle it's much hotter. This will effect the creatures and plants found in that area.

Next, it adds rivers, by selecting coastlines, and basically blasting inwards randomly, creating very river-like rivers. They sway all over the map, and it's pretty cool. Then, it does lakes. I'm pretty sure all lakes are tied to rivers, but like I said, I don't know everyting.

After it does that, it actually generates the specific content of those tiles. It determines the exact stone, plants, wildlife and so on in each area of the world. It decides if an area is full of predators, or calm. If the area is evil or good, and if evil whether or not it's a full-undead map.

Then, it creates civilizations, and megabeasts like dragons. And if that's not enough, it simulates a thousand (by default) game years of cities rising, falling, killing and being killed by beasts. Heroes rise and fall, gods fight demons and demons eat civilians. The races war it out and make peace. And it writes it all down so that you can look t it later, and your dwarves can talk and write about it in the game. They do a lot of writing.

I don't think Tinygame would need this level of detail, but a good degree of it can't hurt, eh?

No comments:

Post a Comment