Dwarf Fortress

There’s now a bot that can play Dwarf Fortress for you

In some ways, you can think of a community as a machine—some members grow food products to be turned into meals, which then feed the members responsible for producing raw materials, so they can serve others that may hone those materials into goods that represent economic viability. With more members and more land, the community-machine expands its ability to produce, maybe infinitely.

And “infinite” is a useful word to a person looking at Dwarf Fortress (2006) for the first time—it’s hard to communicate just how much information there is in one session. It’s not technically infinite, but the average new world has hundreds of years of history filled with battles and heroes and families long gone, and even a tiny scrap between a dwarf and a wild dog can become an exhaustive list of events: Whose teeth end up in whose ligaments? Where does the spit land? How does this particular dwarf feel about her week so far? One recent bug fix “stopped cats from dying of alcohol poisoning after walking over damp tavern floors and cleaning themselves.”

generating story after story of hapless dwarves

It’s safe to say that Dwarf Fortress is complex—managing an optimal fort means keeping your miners well-fed, it means maintaining a military to protect your dwarves, making sure every room is appropriately furnished to keep their anxiety in check, and it means making sure they don’t throw tantrums and kill each other. And in order to interact with all that, you have to memorize key combos, navigate ridiculously long menus, and be able to glean the salient details from the exhaustive log the game produces.

To that end, many people are familiar with the game not through playing themselves, but through things like Tim Denee’s graphic re-telling of the story of Bronzemurder or the Dwarf Fortress Stories blog. It is folkloric in its obscurity and complexity, so maybe it’s perfect that there’s a bot that plays Dwarf Fortress 24/7 (you can watch it here), generating story after story of hapless dwarves.

Dwarf Fortress

It’s a wildly open-ended game (I know at least one player who generates worlds just to sort through fictional histories), but it’s prone to optimization in order to hone your community-machine. The robot overlord that these dwarves serve is clearly more exacting than I am: rooms are all precisely the same size, there’s minimal trash left all over the place, and there’s even a few lines in the code devoted to making dwarves build more storage rooms and having them smooth out stone walls and floors when they don’t have anything better to do.

Most of its logic appears to be based on the number of dwarves under its control (makes sense—what other metrics are there for how much space and food you need), and it’s complete enough to play a pretty convincing round of Dwarf Fortress until the traps it builds fill up with dead enemies, and the poorly-trained military it doesn’t really have code for mobilizing watches as goblins overrun the fort. As one commented line reads in the DF-AI files: “something went not as planned.” There’s a popular mantra among Dwarf Fortress die-hards that proclaims “losing is fun!” DF-AI is an incredible achievement and I’m sure we’ll see it improve over time, but for now, it’s good to know that even this robot can have “fun” like the rest of us.