News for hackers. Stuff that matters.
Re:Dwarf Fortress has sold half a million copies by moritonal on Friday January 06, 2023 @01:09PM (#34278529)
So they've used some of this to hire a second developer.

I wish them the best of luck, entering a codebase developed by a single dev for 15 years.

Re:Dwarf Fortress has sold half a million copies by ttctciyf on Friday January 06, 2023 @01:25PM (#34278752)
Re:Dwarf Fortress has sold half a million copies by warent on Friday January 06, 2023 @01:33PM (#34278853)
I never played this game, but heard it described as "vast".

Was curious what programming language it was written in, and instead found this: https://www.dwarffortresswiki.org/index.php/Language

WTF is this game?

Re:Dwarf Fortress has sold half a million copies by metiscus on Friday January 06, 2023 @01:44PM (#34279013)
Dwarf Fortress is an almost two decade project of interactive storytelling in the form of a video game. They've modeled the world down to an incredible level including personal relationships between people, races, and nations, skill growth, a mostly correct geologic model, the depth of this game is immense. The lives of each person alive in the simulated world are recorded and details are explorable etc. They model the languages spoken by the various races, basically an incredibly creative group of people just recursively modeled the world for something like 15 years adding depth where they wanted and the result is Dwarf Fortress.
Re:Dwarf Fortress has sold half a million copies by zhynn on Friday January 06, 2023 @01:55PM (#34279161)
DF is a procedurally-generated colony sim (build a colony in the wilderness and survive/thrive/die in an entertaining way).

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.

Re:Dwarf Fortress has sold half a million copies by SkyBelow on Friday January 06, 2023 @02:19PM (#34279484)
While you go into detail on the generation of the world, I think the simulation is another major factor that goes into it.

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.

Re:Dwarf Fortress has sold half a million copies by Scarblac on Friday January 06, 2023 @03:01PM (#34280160)
And that several internal organs of a dwarf are simulated separately. Some of them are fat, and fat has a relatively low melting point. Some rooms got warm enough (because lava was running through nearby rock) to melt the fat, killing the dwarves.

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...

Re:Dwarf Fortress has sold half a million copies by Arrath on Friday January 06, 2023 @04:17PM (#34281231)
IIRC, it used to be that very rarely a dwarf might survive the process of having all their fat melted off. This served to turn them into little Terminators, as they had little left that could catch fire again and their nerves were cauterized by the experience so they couldn't feel pain any more.
Re:Dwarf Fortress has sold half a million copies by Arrath on Friday January 06, 2023 @03:14PM (#34280359)
Another unexpected interaction (I hesitate to call it a bug) that I very much enjoyed was The Possessed Adventurer.

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, a lil 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.

Re:Dwarf Fortress has sold half a million copies by archon810 on Friday January 06, 2023 @08:47PM (#34284149)
This is even more fascinating than the drunk dead cats story.
Re:Dwarf Fortress has sold half a million copies by pms on Saturday January 07, 2023 @09:51PM (#34295522)
Is this mechanism still in the game? That is, in Adventure Mode the player is supposed to steer the character in a way that is aligned with the character's personality, or else the character will get depressed? I imagine this could be turned off as an option.
Re:Dwarf Fortress has sold half a million copies by pavel_lishin on Friday January 06, 2023 @10:38PM (#34284907)
Rimworld, another "story generator", is a game that my wife refers to as the "drunken dog" simulator - because at one point, the only source of calories on the world map was some beer, and so my colony's pet dogs were drinking it to stay alive, causing them to deliver cirrhosis and die.
Re:Dwarf Fortress has sold half a million copies by Sharlin on Friday January 06, 2023 @01:56PM (#34279186)
And the current languages are pretty much just Markov-chain-based placeholders for an eventual much more complex system with, presumably, actual grammar and all. Procedurally generated for every new world created.
Re:Dwarf Fortress has sold half a million copies by kibwen on Friday January 06, 2023 @03:34PM (#34280644)
Don't miss the investigation into Dwarven grammar: http://www.bay12forums.com/smf/index.php?topic=173289
Re:Dwarf Fortress has sold half a million copies by suby on Friday January 06, 2023 @03:54PM (#34280916)
To answer the question for anyone interested of what programming language it is written in, Stack Overflow did a Q&A with Tarn Adams (developer) where they asked this, among other things.

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...

Re:Dwarf Fortress has sold half a million copies by __MatrixMan__ on Friday January 06, 2023 @04:49PM (#34281718)
Take a look at this bug, perhaps it'll give you an idea: http://www.bay12games.com/dwarves/mantisbt/view.php?id=9195
Re:Dwarf Fortress has sold half a million copies by sli on Friday January 06, 2023 @08:41PM (#34284098)
This is the first thing I tell people about DF's simulation detail. Even my mother knows about this bug.
Re:Dwarf Fortress has sold half a million copies by __MatrixMan__ on Friday January 06, 2023 @11:10PM (#34285111)
If every bug I wrote were as thoroughly mired in the business logic as this bug, I'd consider myself a good developer.
Re:Dwarf Fortress has sold half a million copies by topologie on Friday January 13, 2023 @05:14PM (#34374640)
It's freaking awesome is what it is.

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...

Re:Dwarf Fortress has sold half a million copies by sushisource on Friday January 06, 2023 @01:44PM (#34279014)
DF's codebase is honestly the closed-source code I'm most interested in seeing.

My expectation is it's just an absolute mess, but I'm so curious.

Re:Dwarf Fortress has sold half a million copies by umvi on Friday January 06, 2023 @02:44PM (#34279885)
Especially since it's developed without Git or any sort of version control...
Re:Dwarf Fortress has sold half a million copies by 0cf8612b2e1e on Friday January 06, 2023 @03:15PM (#34280377)
I fail to see how "real" version control would significantly alter this project. He's a solo developer, so the history is likely going to be a linear series of commits. That's not to say that there are not quality of life gains to be made, but dated backups of the repository would be fine.
Re:Dwarf Fortress has sold half a million copies by Retric on Friday January 06, 2023 @05:17PM (#34282067)
It’s not that version control is the only viable option, just not using it suggests he’s not doing many other things.

As you say there’s quality of life improvements to be had. If he’s not aware of them I suspect he’s reinventing the wheel in new and interesting ways.

Re:Dwarf Fortress has sold half a million copies by flippinburgers on Friday January 06, 2023 @07:20PM (#34283396)
The devil is in the details. Being able to see a comment history alongside file level changes is very powerful over time. Version control is priceless.
Re:Dwarf Fortress has sold half a million copies by SahAssar on Friday January 06, 2023 @08:16PM (#34283913)
Tagging changes with messages is a huge plus. Seeing when each line changed instead is another. Being able to group changes into bundles/commits is another.

Even on solo projects with linear history some sort of version control is valuable.

Re:Dwarf Fortress has sold half a million copies by mrmuagi on Friday January 06, 2023 @10:33PM (#34284863)
I would still use version control since it's literally a zero cost addition and can help with things like bisecting issues. Sometimes I do mini self code reviews via "git add -p" anyways too. Plus it's easier to copy the files/folders from one spot to another without losing any files to data corruption or forgetting to copy a file.
Re:Dwarf Fortress has sold half a million copies by stronglikedan on Friday January 06, 2023 @03:11PM (#34280320)
Well, they certainly didn't need distributed version control, but I'm sure there was some sort of version control used, even if it was daily backups, or just copies upon copies of files.
Re:Dwarf Fortress has sold half a million copies by Scarblac on Friday January 06, 2023 @02:48PM (#34279963)
Well they did manage to get this new much improved UI for the Steam version, in reasonable time. Seems it's much better than I feared.
Re:Dwarf Fortress has sold half a million copies by sowbug on Friday January 06, 2023 @03:12PM (#34280341)
This is an interview with Tarn Adams about the DF codebase: https://stackoverflow.blog/2021/12/31/700000-lines-of-code-2...
Re:Dwarf Fortress has sold half a million copies by jskulski on Sunday January 08, 2023 @03:09PM (#34302566)
Great read, thanks!
Re:Dwarf Fortress has sold half a million copies by hinkley on Friday January 06, 2023 @07:48PM (#34283647)
Does anyone know how they implemented the graphics for the new DF version? I'm still hoping for a Mac or iOS version, but that would be much easier if they used OpenGL ES, which they might not have with only one developer.

> but this should eventually help with bug fixes, ports

eeeeeeeeee

Re:Dwarf Fortress has sold half a million copies by Thorentis on Friday January 06, 2023 @08:05PM (#34283829)
This would be a lot of fun for most seasoned engineers. Tbh I'd rather enter a 15 year old code base written by a single person (who is still contactable and available) than a 15 year old code base written by hundreds of people, some of whom have died, moved on, or are others unreachable, and the inevitable bad patterns being followed thanks in part to Conway's law. A monolith made by a single dev is likely in my opinion to be much more approachable.
Re:Dwarf Fortress has sold half a million copies by kupopuffs on Saturday January 07, 2023 @01:44AM (#34285815)
Surely he'd have a much better understanding of the bigger picture, but there would be soo much code forgotten if it were me!