Saturday, June 25, 2022

Hacking Dwarf Fortress

Dwarf Fortress is probably my favorite game. I have been playing it on and off for about a decade and its nuances and peculiarities are as well nestled into my brainspace as driving at this point. Over this time I have played an uncountable amount of hours, experienced dozens of unique stories, and built many a wild fortress that would succumb to the enemy.

For those who may only be tangentially familiar with the game, Dwarf Fortress is a management game/world generator/city builder/tactical RPG and so on and so forth. Started in 2002 by Tarn and Zach Adams it was first released in alpha form in 2006 where it began to grow a massive cult following. The foundation of the game is its world generation features. Whenever you start a new game you must first generate a world, and as the game has continued to update over the years this generation has gotten more and more complex. World generation, like most of the game, is highly configurable and starts with defining the landscape of the realm and then creating civilizations and beasts that populate it. The game then simulates history, generating individual historical figures and simulating interactions between civilizations and roving bands for as long as you have it set to run. This can be hundreds of years of unique history in the blink of an eye. 

Once the generation is complete, you choose to either view the Legends of the world and examine those unique events or you choose to play in Fortress or Adventure mode. In Adventure mode, you take up the role of one of the thousands of individual characters that populate the world and can interact with it at a ground level- taking on quests, singing songs and learning dances, slaying dragons and exploring the vast world. Each unit generated has a complicated needs system as well which defines what activities make them happy and focused, so fulfilling these becomes an emergent role play system that must be followed for any adventurer to succeed. 

The crux of the game however is in its Fortress mode. In this mode, you select an area on the world map and choose your specific civilization to play as. By default, these are all dwarven civilizations, and you are then able to configure your seven hardy dwarves' skillsets and the equipment they bring along with them before embarking. After that, you start to build a fortress, weather sieges from enemies, entertain visitors, craft masterworks, cater to nobles, even engage in worldspanning intrigue and warfare- or you can dig too deep as dwarves are wont to do and test your might against the many cave dwelling beasts that exist down in the deep stone caverns. At its heart though, Dwarf Fortress is about none of these modes and yet all of them. It's about the story that gets built by experiencing the clash of the underlying systems and experiencing the myriad tales and worlds that it allows. Each generated world becomes filled with stories- including those that you make by interacting with it. Emergent storytelling is king.

/u/leekeegan   

The game has been under continuous development for twenty years now by the team of Tarn and Zach Adams- and its been freeware this whole time. The pair has been sufficing off of monthly donations (Patreon here) and have even been drawing crayon depictions at request of the donators as a thanks. Over the years their passion project has accrued a dedicated following of fans who have taken the little ASCII game about dwarves and absolutely run wild, creating utilities for 3D visualizations, in-game lighting engines, beautiful tilesets, and of course they have been modifying the game to all hell with everything from dark cthulhu mythos worldsrealistic medieval combat and guns, Halloween horrors that assault your fortress, and even post-apocalyptic cyberpunk overhauls. The sheer imagination and creativity as well as craft displayed by the modding community, the artist community, and the writing community surrounding this game is a sight to behold and truly unique. 

One of the most popular mods when I started playing was Meph's Masterwork DF Mod, originally released in 2011 it added over 1100 creatures, 1000 new plants, 35 civilized races, 110 buildings, the ability to play as different and fully fleshed out races, and came with full graphic support and bundled with a number of utilities this mod was the work of many talented modders around the community and would continue to grow over the subsequent decade- adapting and updating as Tarn and Zach made steady updates to the base game as well- continuing to be one of the most popular mods to the game to this day.  

The reason that any of this could come about stems from how extremely hackable the base Dwarf Fortress game is. Inside your game folder you can edit almost every aspect of the game, from creating or removing creatures, setting to play as dragons, you name it and someone can probably do it. There's even a battle royale mode modded in. Certainly there are hard limits on some aspects of the game that cannot be changed by modders, but the sheer amount of variables that are open to us to modify make Dwarf Fortress one of the most hackable and accessible games that I know. That's not to say any of these modifications are easy- per se- or even the game itself. Dwarf Fortress was especially notable in its earlier days for having an exceptionally steep learning curve but being extremely rewarding once you get the basics down. With the upcoming Steam release Tarn and Zach look to make the game much more accessible than it is now (go ahead and check out the 15-30 part tutorials you can find plastered over YouTube), but I will always dwell fondly on how I was eventually able to learn the game mechanics and thrive in spite of the difficulty. 

Saber-Scorpion and Zippy

So we come to now, where over the past few weeks I have felt an itch to play a game about necromancers and wizards. Unsatisfied with my available options, I recalled the excellent Warlock mod created by Meph and previously integrated into Masterwork. Picking it up again I ran into some problems with stability and some features I liked from the current version of the game that were missing. I have very little experience with modding but do have a general familiarity with the game's raw files and so, I got to work. 

Surely there were better ways to go about it, but for many hours over the past week or so I have had thirty tabs of notepad opened to raw files of various versions of Masterwork, Warlock Tower, Old Masterwork, and a half dozen other mods that I dug through and analyzed to try and learn how the mods worked and implement the changes I wanted to make myself. Looking back at some of these older mods I used to enjoy and the depth of data to dig through it felt like doing archaeology, uncovering the hidden guts and gems that make the game tick in just the right way and then taking them back to a modern copy of the game and tinkering with it until I could make it work- recovering ancient technology- pondering the orb and divining its secrets. 

A random series of random design questions I had to solve when putting this all together: 

  • How expensive should skeletons be? 
  • Should imps be more or less of little bastards? 
  • Is stone_vapor_template more stable than a dfhack modtools/add-syndrome reaction trigger?
  • Are prisoners OP? 
    • Is it too macabre to farm babies for souls?
      • Is there a way to change the name of human leather to baby leather when made from babies and is it a valuable investment of my time to find out?
        • Would a baby leather jacket be more or less valuable than a human leather jacket?
  • Are ghouls cool? If not how do I make them cooler? 
  • What's the price of immortality?
  • If a ghoul was a letter what would it be and should it just be reusing the goblin 'g' or giant 'G'?
  • How easy should it be to make steel from the corpses of the dead?
  • If it shows up in the errorlog as an error but still works in game, is it really an error? 
  • What should it cost to gain infinite lava or water? 
  • How much slade (the literal rocks of hell)  should be made from a single soul?
  • Are sentient souls interchangeable with nonsentient ones? 
  • Should you keep playing around with playscii ineptly or go back to finding out how to tame werewolves? 
  • What's the balance of cohesion and complexity?

And ultimately, this is the result. Nowhere near perfect or finished, but it's working! Here we take the standard of dwarves on an expedition and this time make it about Warlocks harvesting souls and building their armies in a dark tower filled with twisted experiments and dark magics! Grind your enemies into pieces and use their souls to feed your infernal creations and learn powerful spells! Achieve immortality and rule the world, or just bathe it in chaos!



No comments:

Post a Comment