Live data from Hacker News

How Dwarf Fortress is built

stackoverflow.blog

381–390 of 407 posts

Re: How Dwarf Fortress is built

#381
post #220

Earlier quoted context omitted.

Catplosions (Tarn loves cats, cats reproduce, too many cats kills DF performance) This was a particularly insidious one because the usual strategy of culling excess livestock doesn't work out when applied to dwarfs' pets (pets can't be designated for slaughter, and other means of making pets die will make their owners upset). With most animals, you can avoid the pet adoption issue by just not marking them as availabl…

Note that the obvious strategy of not having any cats at all doesn't work well because cats are the most/only easily-available HUNTS_VERMIN creature, so you need some around to protect your food stockpiles. A somewhat effective solution is to use male cats for stockpile protection, and keep female cats caged (which IIRC stops both adoption and breeding) and only let one out at time (cage any resulting (female) kitten…

I. M.> John, the kind of control you're attempting simply is… it's not possible. If there is one thing the history of evolution has taught us it's that life will not be contained. Life breaks free, it expands to new territories and crashes through barriers, painfully, maybe even dangerously, but, uh… well, there it is.

H. W.> You're implying that a group composed entirely of female animals will… breed?

I. M.> No. I'm, I'm simply saying that life, uh… finds a way.

Re: How Dwarf Fortress is built

#382

Earlier quoted context omitted.

Reminds me a little bit of something strange I saw in Rimworld - all of my dogs were developing liver cirrhosis! It turns out that my dogs weren't alcoholics - it just happened to be that beer was the only food source they had zoned access to, so they were drinking it out of hungry desperation, and while it gave them enough calories to live on, it also gave them cirrhosis.

In reality, the beer might have killed the dogs, since the hops in the beer is toxic to dogs.

Hops outside of beer is toxic to dogs, it causes malignant hyperthermia. It's a problem for brewers who leave their hops where the dog can get at them (usually spent hops in the trash or a compost heap).

Beer brewed from hops doesn't cause hyperthermia, it's harmful to dogs because they experience the same effects of ethanol poisoning that humans do (e.g. cirrhosis), at much smaller doses.

Re: How Dwarf Fortress is built

#383
post #266

Earlier quoted context omitted.

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.

I had a roommate in college who loved to play World of Warcraft.

At some point, we got into a discussion over art style and realism. He made an observation that still sticks with me.

"The style sets expectations. When something breaks a real world law of nature or logic because of a bug, it doesn't feel as jarring, because the style is already cartoon-y."

It made me think about just how malleable expectations are with regards to game systems. Train a player to expect realism, and breaches become infuriating. Train a player to expect the unexpected, and the unexpected becomes intriguing and fun.

(More modern tip of the hat to Fortnite)

Re: How Dwarf Fortress is built

#384

Earlier quoted context omitted.

In the Windows world SCM was not generally available until SVN was released as a File Explorer extension. This was sometime in the 2000s. Git took several years to become viable on Windows.

There were plenty of proprietary source control systems around. At my first job in 1998, we used Visual Sourcesafe, later switching to Perforce. At another job I had the misfortune to get to know Rational ClearCase.

I am absolutely stunned that people think that source control only came around recently in this thread. CVS came out in 1990, RCS... 1982, SCCS... 1972. Visual Source Safe was commonplace in the 1990s, as terrible as it was.

There may have been small teams that didn't use SC in the 1990s, but this has absolutely been a basic best practice for decades.

Re: How Dwarf Fortress is built

#385

I thought it was developed by the two brothers? I've seen talks and interviews by both brothers on DF. like this one https://www.youtube.com/watch?v=ZMRsScwdPcE and https://www.youtube.com/watch?v=HtKmLciKO30

One of the brothers is the main developer and ideas guy, the other is more the admin/idea control/art role

Re: How Dwarf Fortress is built

#386

Earlier quoted context omitted.

"Tool" is still a class, with perhaps very generic polymorphic methods (e.g. do_default_action() ). The problem is not polymorphism per se, but rather about having a deep class hierarchy aka lasagna code. 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.

Another good rule for OOP: Objects are fine, object graphs are a killer. Graphs are what get you into "all I wanted was a banana" territory. Objects should either be atomic, agrigated by simpler structures like maps and arrays, or if you absolutely must have objects pointing to objects, be sure that they form a tree and not a graph such that each object need only know about the things below them which can be encapsul…

Even a single object gets you into the "all I wanted was a banana territory. "

I have a gorilla class and a banana method on the class, can I ever use banana without the gorilla? No. The simple act of having a class screws it all up.

Make the banana a pure function, or one that is defined in terms of a polymorphic parameter that it mutates.

  func banana(x: animal){...}

  banana(gorilla);
The way to do it via OOP is base class methods and importing the method to all children via inheritance which is just bad and universally reviled among even practitioners of OOP.

  class Animal() 
  {
      banana()
  }

  class Gorilla() : Animal {
  
  }
Technically there are slight fair advantages and disadvantages to the OOP way when you don't account for inheritance and polymorphism but all that is gone once you do account for them.

Re: How Dwarf Fortress is built

#387
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…

I live in a city with a lot of stray cats and lemme tell you, "catsplosion" is pretty realistic. We narrowly averted one by getting the ones that live under our house fixed.

Re: How Dwarf Fortress is built

#388

IMO that's one of the best ways a single programmer can spend his career. No weird requirements, no deadlines, no nothing, nada. Just one's passion and a product. Whether it is successful is irrelevant. Kudos Mr. Adams for making the achievement and moves gaming history. Going back to the interview, I found this line (and the logic attached) interesting: >Making the item system polymorphic was ultimately a mistake, b…

I have a passion for programming but I need something to drive me. I'm useless when I try and make stuff on my own. But if I've got someone telling me "I need a system that does X", I just get highly motivated in delivering it. Like I need requirements.

I feel similarly, but I think working on a product that is used like this game is might be enough for folks like us. There are probably lots of features requests and bugs to focus motivation and the human usage driving emotional meaning of the work.

Re: How Dwarf Fortress is built

#389

Earlier quoted context omitted.

I am unaware of a single functional reactive UI library or framework that does not rely on other people's, most often object-oriented (or even *gasp* procedural) libraries to actually put anything on the screen. Of course it's relatively easy to build shiny clean wrappers around the dirty work that others have had to do on your behalf.

You're right you are unaware. This is not an insult and I'm not trying to offend you. This is a factual statement. You truly are unaware as you stated yourself, and I can prove it to you. First off FRP is actually a term. Functional Reactive Programming. It is 100% a functional paradigm that gasp by DEFINITION cannot be procedural. So you truly didn't know what you were talking about here: https://en.wikipedia.org/wi…

You mention React and Elm, which - as I said previously - both rely on other people's actual GUI work (the various browsers' rendering engines + DOM, the various platform-specific UI SDKs, etc) to actually put anything on the screen.

I can't speak to ReasonML, as I have not used it, but my impression also is that it takes advantage of other people's GUI libraries considering that I've heard Revery compared to Flutter (and Flutter outsources its rendering to Skia as well as relies on rather imperative RenderObjects beneath the functional reactive layers). Please correct me if I'm wrong.

I would be very interested indeed to see a GUI framework built from the actual ground level up in an entirely functional reactive manner. Do you know of any?

Re: How Dwarf Fortress is built

#390

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…

The Codeless Code #83 - Consequences http://thecodelesscode.com/case/83

is a good read on that... or rather, its a spot to start thinking from.

It ends with:

> A nun of the temple whispered to Jinyu: “This problem has several solutions, but I dislike all of them.”

> “Therein lies its value,” whispered the abbess in reply. “For we are all of us doomed in this profession: our designs may aspire to celestial purity, yet all requirements are born in the muck of a pig-sty. I trust that this monk can succeed when the stars align in his favor, but when they do not, how will he choose to fail? By cowardly surrender? By costly victory? By erroneous compromise? For it is not he alone but the temple that must bear the consequences.”

There are also a set of "topics" hidden with a mouseover at the bottom that can waste a day away without difficulty.

Post reply on HN