Live data from Hacker News

How Dwarf Fortress is built

stackoverflow.blog

241–250 of 407 posts

Re: How Dwarf Fortress is built

#241

Earlier quoted context omitted.

This is one of the things I like about Go. Just structs with methods. You can embed them but it seems to hedge against deep nesting and creates simple code

Then how would you model composing behaviors in Go. Say for example I have a representation of Food and a representation of Animal. I then want an ability that will "animate" things, so I can animate Food to give it the behaviors of Animal. I'm not being critical either, I'm seriously curious how somebody would implement this behavior in Go. Like you say, just struct with methods is a very appealing mental model sinc…

I am not a Go programmer but I would assume that each behaviour of Animal would be a struct with one or more methods. Those behaviours are added to the agent to make it an animal. Composition. If you want your Food item to walk like a duck and quack like a duck you just add Walk and Quack to it. Presumably some other system would take care of identifying those behaviours and calling them as needed.

Re: How Dwarf Fortress is built

#242

To me what was most surprising about Dwarf Fortress, given the complexity, is that Tad didn’t use git or any other code repository until more recently.

Why would that be surprising? For a single programmer working alone Git is an incredibly complicated tool. P.S.: A lot of you are confusing "complicated" with "difficult".

I can't imagine working on any personal project without git. How often have you been working on something for a while, noticed part of it that was working before was now broken and had no idea why. If you'd been making regular commits to git you could go through recent/pending changes and work out was was different trivially.

Git is also incredibly simple on single person personal projects, just git init, git add, git commit and some way to view the history and pending changes (either the command line, or most editors have a built in viewer).

Re: How Dwarf Fortress is built

#243

Earlier quoted context omitted.

Is it? That's when git is simplest, having a single branch and never merging removes most of the complexities of git.

Sure, but it also removes most of the reason to use Git.

When I'm hacking away on a personal project a huge amount of value in git (probably moreso than any other feature) just comes from having "what's in the repo" and "what I've changed today" (uncommitted changes) visible as diffs.

Re: How Dwarf Fortress is built

#244

Earlier quoted context omitted.

Solo workflow is as simple as write code, git commit, repeat. Throw in a git push every once in a while. All on master, no branching or forking.

That's a lot of commandline I don't normally have to bother with. And if I'm not living in the commandline then I only end up running git when I reach some milestone I want to back up... which I can do just as easily with 7zip without installing anything I don't already have, and I can copy archives to my NAS without having to set up some remote repo. You can try and convince me until you're blue in the face dude, bu…

You don't have to use the command line, most code editors have built in UI for this, especially when you're only using these basic git features.

Re: How Dwarf Fortress is built

#245

Earlier quoted context omitted.

https://www.joelonsoftware.com/2000/08/09/the-joel-test-12-s... I've seen this post brought up as relevant regularly up till 2010. You may have been lucky to avoid the dredges but SW industry in the 2000s was a copy-paste fest (not in the "copy from stack overflow" sense but as in "copy paste instead of creating a function"), PHP with SQL in templates and string concat queries all over the place, MVC was a revolution…

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 others far before Windows. In the 1980s I used Polytron version control system and the MKS port of RCS on MS-DOS.

Re: How Dwarf Fortress is built

#246
post #23

Dwarf Fortress consumed hundreds of hours of my life in high school, I have so many fond memories of it. Every year or so I come back to it and I'm always surprised that they've managed to add another mechanic or feature that just makes the game feel even more like its own little universe. After enough time in the game there really is a moment like that scene in the Matrix - "I don't even see the ASCII anymore. All I…

> That said, I've always wondered if Dwarf Fortress would be a more smooth experience if it had more developers Maybe, but only if it was under the benevolent dictator model.

There exists at least one Dwarf Fortress done in Tarn’s model - it seems there exist zero done via any other method.

He perfected a Patreon-style support system before Patreon was really a thing, and he keeps plugging away at it, keeping people interested.

(Dirty secret - he’s found ways to let people access parts of the code he doesn’t care about such as the sound or SDL)

Re: How Dwarf Fortress is built

#247

Earlier quoted context omitted.

Part of the issue is that it is difficult to come up with problems worth solving. I think Joel and Fogcreek is a great example. He started out with the premis that you don't need an idea for a successful software company, you just need to find great devs and create the best working conditions and then success would come. This was a novel idea at the time since Apple was the only FAANG that even existed and this was t…

Is having deep knowledge of the problem domain you're solving a blessing or a curse? Personal attachment to the problem domain?

Neither. It's a sign of time spent navigating an information gradient. Nothing more, nothing less. Encyclopedic knowledge of obscure topics isn't good or bad, just a data point as to what is capable of holding your interest.

Re: How Dwarf Fortress is built

#248
post #212

Earlier quoted context omitted.

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…

> You have humans, robots, and dogs all fitting into your nice class hierarchy. But now you need a robot dog that breaks everything. I like the way you put that. Though humans and dogs are 85% similar at a DNA level, so makes sense for them to inherit from a common parent. And my guess is robots and robot dogs would be ~85% similar at a building block level, so dog would inherit from robot. I think go easy on levels…

Heh, I actually had that wrong. I probably should have watched the video instead of going by my recollection. He has a mix of robots and animals. Same concept.

Re: How Dwarf Fortress is built

#249
post #23

Dwarf Fortress consumed hundreds of hours of my life in high school, I have so many fond memories of it. Every year or so I come back to it and I'm always surprised that they've managed to add another mechanic or feature that just makes the game feel even more like its own little universe. After enough time in the game there really is a moment like that scene in the Matrix - "I don't even see the ASCII anymore. All I…

Even if it were open source I doubt there would be enough impetus to implement multithreading. It would literally be easier to completely make a new game from scratch with async and threading designs taken into account, instead of trying to adapt an existing monolith. Async and multithreading are complex and introduce many subtle bugs. It's not so easy to just move to that from a single-thread event loop.

I would hope there would be low hanging fruits. Pathfinding for example causes huge huge issues late in the game, same with the fluid calculations. Of course we have no idea how Tarn implemented these things, but I would have to guess if you need to do pathing for 50 entities in a single frame, you could probably parallelize them?!

Re: How Dwarf Fortress is built

#250

Earlier quoted context omitted.

That's a lot of commandline I don't normally have to bother with. And if I'm not living in the commandline then I only end up running git when I reach some milestone I want to back up... which I can do just as easily with 7zip without installing anything I don't already have, and I can copy archives to my NAS without having to set up some remote repo. You can try and convince me until you're blue in the face dude, bu…

You don't have to use the command line, most code editors have built in UI for this, especially when you're only using these basic git features.

I just use Notepad++. I like to keep my development environment simple.
Post reply on HN