Cogito ergo caffeinatus

Dwarf Fortress and LLMs

[“video games”, “LLM”, “Bad ideas”,“dwarf fortress”]

DF is amazing. At one point fish with overbites killed dwarves through aggressive mastication. Or the absurd effort to take one dwarf and have them master all skills.

The new Steam release has done wonders. Many barriers have been removed, and the game is far easier to understand (no more ASCII), with great quality of life changes.

Fortress mode for me tends to gravitate to building mega projects. Something like an elevated mine craft railway made out of granite blocks.

This means I need to build each stone block of that highway. That’s thousands of blocks that have to be made out of stone that has to be mined. Very soon, you start needing a full logistics corps to transfer the heavy stones all the way to the active construction site.

Same construction site that is plagued by constant assaults from Giant Sparrows, giving construction a higher mortality rate than soldiering.

ANYWAY. Mega projects. Lots of work. Bad.

Adventure mode? The world map is far more alive now, with quests and goals cascading through the continents. You can hire troupes, sing, interact, and if I remember correctly, even settle.

DF Conversations though are simply canned. The side effect of pure generative world building: no RPG level scripts.

But that used to be the case.

Dwarf fortress is almost tailor made for LLMs. There are a plethora of stats, personality details and contextual information - all in text (well almost all).

You know what personas to emulate for a character. The character sheet tells you that NPC is an arrogant, creative persuader with a minor in lying.

You even have the current state of mind tracked by the game. Matter of fact, this solves one of the bigger issues from the Generative Agents paper - keeping track of the agent state. Dwarf Fortress already does that for you.

The blocker is that I do not have any idea how to make this happen.

There are text script files which you can modify. These are txt, so its not exactly the heights of interactive story telling.

On top of it, I would probably want to run a local LLM, instead of using an API. That would mean succeeding in getting Ooogaboog to work. A project in itself.

In theory, DF hack could help out. But the question is being able to change the state of text within the game interface.

That said, I am entirely sure someone is going to do this. I mean, just picture this:

Your half dead kobold adventurer stumbles into a dwarven fortress, bleeding. You look at your boon companion, and ask them how they feel the journey has been. They tell you with icy clarity, the many ways they want to see you dead.

Or more likely, your fortress crumbles under the onslaught of some forgotten beast and you read stories of valiance and trauma.

Hey, losing is fun. I will come back to this.