Live data from Hacker News

How Dwarf Fortress is built

stackoverflow.blog

11–20 of 407 posts

Re: How Dwarf Fortress is built

#11

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…

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

Re: How Dwarf Fortress is built

#12

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

Or any other is the point. I mean even locally I depend on commits as save points to just allow me to go crazy and experiment with the code. I mean you can just copy the codebase elsewhere as backup but using git or mercurial is easier than that.

Re: How Dwarf Fortress is built

#13

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

Actually extremely easy. Git add -a, git commit, git push.

It only gets complicated if you try to do complicated things.

Re: How Dwarf Fortress is built

#14

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

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

Re: How Dwarf Fortress is built

#15

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.

Well, if you deeply understand the code and reasons behind it (or it's superbly documented esp. with tests), the tool does not bring much beyond being a convenient backup or checkpoint system.

And especially if you don't have to work with a team.

Re: How Dwarf Fortress is built

#16

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.

I mean using SCM became the norm in maybe last 10-15 years ? When this was started I don't think using SCM was as ubiquitous as it is today, not to mention on a solo project. If you've been hammering away since then I can see how you might have missed it.

Re: How Dwarf Fortress is built

#17
post #12

Earlier quoted context omitted.

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

Or any other is the point. I mean even locally I depend on commits as save points to just allow me to go crazy and experiment with the code. I mean you can just copy the codebase elsewhere as backup but using git or mercurial is easier than that.

Not saying you're wrong, but to explain "how is that possible over 20 years without ever blowing things up": he says he uses visual studio since the beggining (the full blown ide).

Since he's working alone, he can easily use the local backup feature of it, which allow to easily rollback to automatically made copies of files, diff and cherry pick between current and backups, etc ... It's basically done automatically for you.

As long as you save your project regularly and don't need to merge code with anyone, it can go a long way.

Re: How Dwarf Fortress is built

#18
Df is just like OpenTTD. Both are like Chess, easy to start, fun to play casually but it takes years to master. Great games, complex if you want to and a time sink if you don't keep an eye on it. Have had many hundreds of fun hours in both games

Re: How Dwarf Fortress is built

#19

Earlier quoted context omitted.

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

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.
Post reply on HN