Was curious what programming language it was written in, and instead found this: https://www.dwarffortresswiki.org/index.php/Language
WTF is this game?
But that's not _why_ it is vast. The vastness comes from three main things, I think:
1. the number of distinct procgen systems. Creatures have procgen phenotypes and personalities. The landscape, biomes, and simulated geology/hydrology. Biomes. The civilizations and simulated history. The names of things. Religion, Instruments, cultural songs and dances, masterwork items and treasures, legendary forgotten beasts, and a bunch of stuff that doesn't come immediately to mind.
2. the inter-relatedness of the procgen systems. In many procgen games, the different systems do not affect each other. Systems that affect each other multiply the possibilities. And if they all affect each other, it's exponential. They all multiply each other. It's hard to describe how hard this would be to build in a way that wasn't just a mess of nonsense, but they did it by focusing entirely on the underlying systems and the UI was impenetrable ASCII with baffling UX. That has changed with the steam edition.
3. This game was written by two guys over the course of more than a dozen years funded by donation. It is an exceedingly rare and towering artistic achievement. This game should not exist, and will almost certainly never be surpassed (at least not in the same artisanal way).
One of the goals that was mentioned as a north star was that they wanted this game engine to be able to generate any fantasy story that has ever been told. But that none of those stories would be explicitly coded in, the world was just capable of making it happen.
You know, I probably could have just linked to their roadmap. The game is only halfway complete by the creator's opinion: https://www.bay12games.com/dwarves/dev.html
That will give you some idea of the INSANE ambition of this game.
Once you start playing the game, the level of detail used in generating the world is now used applied locally to simulating it. An example I like to use is to explain a bug where people's games were ending poorly (or with lots of FUN in dwarf fortress speak) because dwarfs were having mental breakdowns because their pet cats were dying. Which was because the game simulated the cats well enough that they could get alcohol poisoning and die. But why were the cats drinking that much alcohol? Because when they walked through dining rooms, the game simulated the dwarves getting drunk and spilling alcohol which stayed on the floor for some amount of time. If a cat walked over it, it got on their fur. When the cat cleaned themselves, which was also simulated, they would consume some of the alcohol on their fur. The bug was that each micro-dose of alcohol from licking themselves was accidentally being calculated like a full flagon of ale providing the small cat with far too much alcohol.
The level of the world generation with the level of simulation create a basis for a fantasy immersion that you cannot find elsewhere. The UI limitations, even with the steam version, do prevent most from becoming immersed into the world, but there seems to be a crowd who are brought in by the fidelity of the simulation and who can get past the UI that let's them experience something that cannot be found elsewhere.
You see, in Adventure Mode (akin to a traditional Roguelike in your created DF world, rather than the Colony Sim that is Fortress mode) you can create a character out of whole cloth that gets plopped into the world, or take over an extant character created through world generation. Either way, both characters are fully initialized within the systems of the game, having their own personalities, likes, dislikes, quirks, moral codes, emotional trauma thresholds, etc.
Well, one player noticed over a few runs that their character's eyes were coated with tears. Odd, they thought, so they posted on the Bay12 forums about it. After some investigation, Toady confirmed that the full personality system was still running in the background, and the character was effectively possessed by an out-of-context demon, the player. The character's consciousness was stuck watching utterly helpless as their body did all manner of unspeakable acts (assuming the player was acting as a typical murder-hobo) that conflicted with their innate personalities, were horrified at what they saw, and could do nothing but cry about it.
It's absolutely insane, equal parts disturbing and chilling and, as far as I am aware, an outcome totally unique to Dwarf Fortress created by the ridiculous depth and detail of the interwoven systems.
The bug was, iirc, that the AI didn't route around this effect.
Of course, for a long time making rooms like this and leading enemy armies through them was an important part of fortress defense, because actual militias were so bugged at the time...
Also insanely strong carps that drag dwarves into the water, killing them. After all, swimming is exercise, it trains strength, and carp swim all day long...
Q: What programming languages and other technologies do you use? Basically, what’s your stack? Has that changed over the 15-20 years you’ve been doing this?
A: DF is some combination of C and C++, not in some kind of standard obeying way, but sort of a mess that’s accreted over time. I’ve been using Microsoft Visual Studio since MSVC 6, though now I’m on some version of Visual Studio Community.
I use OpenGL and SDL to handle the engine matters. We went with those because it was easier to port them to OSX and Linux, though I still wasn’t able to do that myself of course. I’m not sure if I’d use something like Unity or Unreal now if I had the choice since I don’t know how to use either of them. But handling your own engine is also a real pain, especially now that I’m doing something beyond text graphics. I use FMOD for sound.
All of this has been constant over the course of the project, except that SDL got introduced a few years in so we could do the ports. On the mechanical side of the game, I don’t use a lot of outside libraries, but I’ve occasional picked up some random number gen stuff—I put in a Mersenne Twister a long while ago, and most recently I adopted SplitMix64, which was featured in a talk at the last Roguelike Celebration.
https://stackoverflow.blog/2021/12/31/700000-lines-of-code-2...
Seriously, one of the most fascinating games ever.
I'd recommend checking the following articles to get a good overview of the whole thing:
- https://www.nytimes.com/2011/07/24/magazine/the-brilliance-o...
- https://stackoverflow.blog/2021/12/31/700000-lines-of-code-2...