Live data from Hacker News

How Dwarf Fortress is built

stackoverflow.blog

261–270 of 407 posts

Re: How Dwarf Fortress is built

#261
post #40
post #28

Earlier quoted context omitted.

> My policy: OOP is like salt. Use little and that's great. I only allow a single inheritance layer, and ideally no inheritance at all. That's been my observation as well - there's no free lunch and DRY isn't free either, certainly not if you use inheritance chains to achieve it. I'm starting to think that the only programming axiom that will survive in the end is KISS.

KISS and YAGNI are like yin and yang for me.

they are yin and yin for me.

Re: How Dwarf Fortress is built

#262

Earlier quoted context omitted.

That's very interesting, because I had observed exactly the same when I tried to implement a rogue-like in Java some years ago. For example, I had to decide whether there should be different subclasses for spell books, the different weapon types (e.g bows vs swords), drinks, etc. or just one big Item class. Closely related to that, another decision I had to make was whether object or character properties should be im…

Mattias Johansson uses basically this example in his argument for composition over inheritance. You have humans, robots, and dogs all fitting into your nice class hierarchy. But now you need a robot dog that breaks everything. https://www.youtube.com/watch?v=wfMtDGfHWpA I think inheritance makes the most sense when your problem domain has been known for decades - like airline reservations. But for new blue sky projec…

Robot dogs inherit from robot and dog. Mammalian dogs inherit from mammal and dog.

Re: How Dwarf Fortress is built

#263

Making the item system polymorphic was ultimately a mistake, but that was a big one. Q: Why was this was a mistake? A: When you declare a class that’s a kind of item, it locks you into that structure much more tightly than if you just have member elements. It’s nice to be able to use virtual functions and that kind of thing, but the tradeoffs are just too much. I started using a “tool” item in the hierarchy, which st…

In the LPMud LPC language objects could inherit from multiple other objects, so they could combine behaviors. I haven’t really seen that in other languages.

like C++?

Re: How Dwarf Fortress is built

#264

Earlier quoted context omitted.

I think it's OK as long as they feel it's OK. We can say that his mother "sponsors" the project.

Edit: I was wrong about how much he is relying on his family - didn't realize how much Patreon support the project now has compared to when I last looked. My bad, should have checked. I still agree with the below in the abstract but I retract my criticism in this case I can get with that take when it comes to Patreon but it's harder to demonstrate ok-ness-with-it with family. Let's say she's really not all that jazze…

Maybe his mother enjoys paying her son to create one of humanity's great works of art.

Re: How Dwarf Fortress is built

#265
post #144

Earlier quoted context omitted.

I've been working on a project for a long time. It's not even yielding income, though I hope it will. A friend referred to it as a passion project. That hurt for some reason. I can't explain why.

Yeah I agree with this, I would feel hurt too. For some reason the word "passion" has this hidden connotation for me which makes me feel like the project isn't serious, isn't making money, isn't popular, and is just eating up all my time as it is something I constantly obsess over. In the case of Dwarf Fortress, I would say for him it is "the sole project he's been working on for 20 years now, which takes up $large_n…

Why can't a passion be serious or popular?

Re: How Dwarf Fortress is built

#266
post #33

> What’s your favorite bug and what caused it? > A: It’s probably boring for me to say, but I just can’t beat the drunken cat bug... That was the one where the cats were showing up dead all over the tavern floor, and it turned out they were ingesting spilled alcohol when they cleaned their paws. I think that bug explains very well just how deeply complex Dwarf Fortress really is. Drinks can be spilled. Some drinks ha…

Other amusing DF bugs: Dwarfs trying to clean their inner organs (dwarf wounded, doctor closes the wound, dirt stay inside) Undying children in the moat water (for years... just swimming there...) Killer carps (there was a long time during which carps were really overpowered because constant swimming was buffing them up really good, dwarfs getting close to water sources were eaten by carps) Catplosions (Tarn loves ca…

>Killer carps

TIL this was a bug and how it was a bug! Wow! Back when I played DF it really seemed like it was simply accepted folklore that the carps in DF were really strong and the common advice was don't build your base too close to rivers. Having not played in a long while, I had always thought this was intended.

Re: How Dwarf Fortress is built

#268
post #28

Earlier quoted context omitted.

> My policy: OOP is like salt. Use little and that's great. I only allow a single inheritance layer, and ideally no inheritance at all. That's been my observation as well - there's no free lunch and DRY isn't free either, certainly not if you use inheritance chains to achieve it. I'm starting to think that the only programming axiom that will survive in the end is KISS.

A few weeks ago some commenter here said they ascribe to WET - Write Everything Twice. Basically worry about abstraction when you get to number three. And what an acronym given the context!

That’s great, and jives with my experience. You probably don’t know the problem well enough to come up with the right abstraction until at least example #3.

Re: How Dwarf Fortress is built

#269
post #169

I love the idea of Dwarf Fortress and I think the internet purest mission is to disseminate works of passion such as this, not to sell me ads instead. That said, I can't get past the ASCII interface -- I'm a huge fan of IF games (which used to be called "text adventures" in the olden days) and I can deal with spartan UIs, but for real-time strategy/sandbox games, I absolutely need some sort of graphics. Tiles, at lea…

It is on steam and it will have a new UI with tiling.

Re: How Dwarf Fortress is built

#270
post #33

> What’s your favorite bug and what caused it? > A: It’s probably boring for me to say, but I just can’t beat the drunken cat bug... That was the one where the cats were showing up dead all over the tavern floor, and it turned out they were ingesting spilled alcohol when they cleaned their paws. I think that bug explains very well just how deeply complex Dwarf Fortress really is. Drinks can be spilled. Some drinks ha…

I don't know much about Dwarf Fortress, but why is that a bug? It sounds like it follows reasonably well from the behavior in the game.

It sounds like the actual bug was about quantity. Walking on the tavern floor resulted in 1 entire serving of beer on the paws, and cleaning resulted in ingesting that serving.
Post reply on HN