Stonesense - Old Official thread

/?topic=43260.0

  • Dwarf Fortress will crush your CPU because creating history is hard | Polygon
    http://www.polygon.com/2014/7/23/5926447/dwarf-fortress-will-crush-your-cpu-because-creating-history-is-hard

    In the beginning, when you first install the game, there is nothing.

    Then, at the push of a button a complex fractal generator divides the oceans from the land and calls into existence an area about twice the size of New Jersey.

    The software then throws it out, and keeps generating 16,000 square mile chunks of real estate, each one 250 miles thick, until it gets the right distribution of elevations. Adams is looking for just the right amount of high points and low points to make the place interesting.

    But this is just the shape of things. Adams has, over the years, developed an intricate process to simulate eons of complex geologic time, a way of stacking fractal layers and blending them with algorithms to give life to each world.

    IN AN INSTANT DWARF FORTRESS CALLS INTO EXISTENCE A REGION TWICE THE SIZE OF NEW JERSEY. AND THEN THROWS IT AWAY.

    The first layer plots the annual rainfall of each map location. Then a separate fractal simulates the deposition of mineral elements throughout the underground strata, giving the land itself a kind of texture. A temperature fractal is generated and rough biomes emerge as contiguous tiles on the map that contain a subset of closely related flora and fauna.

    The order here is important, because in the next step — drainage — Dwarf Fortress begins to simulate the complex forces of erosion. Only after the biomes have been created can the rivers run, slashing deep valleys as they flow toward unnamed oceans. When they finally meet the sea a salinity algorithm kicks in to define the areas for swampy river deltas, alluvial islands and mangrove swamps.

    At one time, Dwarf Fortress’ natural world stopped forming here, but Adams has added something in recent years to give each one a little something extra.

    THE LONE AND LEVEL SANDS
    In his research for the game Adams learned that in the real world when warm, wet air travels up the side of a mountain it loses moisture. Rain precipitates out creating areas like rain forests and snow capped peaks. On the other side of the mountain deserts form in areas that are called “rain shadows.”

    So Adams built a custom algorithm that simulates rain shadows in Dwarf Fortress, and if you watch carefully you can see it.

    The whole map will shudder and shift, just for a moment. All the biomes suddenly snap, a dramatic shift from east to west. Some shrink, others expand. Deserts appear out of nowhere. That’s the rain shadows kicking in.

    THE STORY OF SAZIR STOCKADEBOLT, THE “CONFINING SPELL”

    The land was called Teyo Quico in elvish. It means “The World of Cyclones.”

    Born into this world, in the year 89, was a dwarf named Sazir Stockadebolt. When she was just one year old she was abducted from her people, who were called The Ancient Spears, by a crazed dwarf woman.

    She was brought to live in the dark fortress called Dangleplague. There she was raised in the company of goblins.

    When she was 12 years old she was married to Onol Minedclapped, another dwarf who had been abducted and forced to live in Dangleplague. But just two years later, Minedclapped was murdered by the dwarf Ber Toursink.

    The horrible crime pushed Stockadebolt over the edge of madness. She joined the goblin hordes, trained as a sword fighter, and joined them when they marched into battle.

    The War of Ignition was fought over eight long years, ending in 149 in a cataclysmic battle against her own race.

    Together she and her goblin brothers killed every single member a dwarf people known as The Earth of Infamy. After that campaign Stockadebolt was promoted to be the general of the goblin army. Her faction became known as The Maroon Nightmares.

    After The War of Ignition, Stockadebolt journeyed to the depths of the world where she tamed a cave dragon, a beast which she rode into every subsequent battle she fought. Her victories include The War of Ignition, The Conflict of Growling and finally The Siege of Cuts.

    In 195 she was murdered, like her husband before her, by her own kind; a dwarf by the name of Urdim Passoars. She was 106.

    But her story lives on. Along with 57,283 other historical figures, all of whom have similar stories to share.

    In the future, Adams hopes to add plate tectonics. When he does entire regions of the map will be able to cleave against each other to create fissures, or smash into and over each other to become mountains.

    “If we had land going up and down,” Adams says with a sigh, “maybe none of this would be necessary.”

    By this point in world generation the game is using something like half of a modern quad-core computer’s total CPU power. It will hold there while it begins to spool up the maximum allowable amount of RAM that the game engine’s 32-bit software will allow. And it’s just getting started.

    After the map has been locked into place, the game assigns a kind of energy to each region, ranging from good to evil on a scale of one to 20. It then uses the positive and negative energy of each area to generate place names — The Ocean of Muting sit along the edge of The Jungles of Mire near the Ivory Hills — and on and on creating hundreds of uniquely named regions.

    But these are just the names as translated for the player. Adams says that each area of the map has been named by one of four cultures. Human, dwarven, elvish and goblin languages are actually programmed into the game.

    Eventually, he hopes that the game will be able to procedurally generate languages as part of world creation, but for now it’s working off very large lists of words.

    “There are evil words and good words in each language,” Adams says. “It chooses names based on those. The dwarf language will be used to name things that have more artifice, and the elf language will be used to name things that are more natural, and wild things and so on.”

    And it’s not done yet.

    “Then it places all the little features,” Adams says, “like the caves and monsters and the starting points of civilizations. And after that it gets significantly more complicated.”

    The world’s history begins to play out, a week at a time, for 250 years.

    Towns grow and flourish, only to expand into the wild and and conflict with their neighbors. Leaders rise to create dynasties, which then fall into ruin. And you can watch it all happen before your eyes; hundreds of thousands of creatures live and die in seconds as little more than flickering ASCII shapes.

    “They have their farms that all go on this yearly cycle and give them actual food numbers,” Adams says. “When you see a city shrink down in size, the people have either moved away or they ran out of food. Every object that is made is tracked.”

    It’s this kind of detail that gives Dwarf Fortress an impossible richness.

    For instance, when you travel to certain cities in the game and speak to a merchant they might tell you that their leather caps are made in an elvish city half a world away. And it will be true. They really were made there, during world creation, and traveled to this market for you to buy before you even started playing.