How Dwarf Fortress is built
stackoverflow.blog
How Dwarf Fortress is built
1–10 of 407 posts
Re: How Dwarf Fortress is built
#2Re: How Dwarf Fortress is built
#3Q: 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 started to get various functionality, and can now support anything from a stepladder to a beehive to a mortar (and pestle, separately, ha ha), and it just feels more flexible, and I wish every crafted item in the game were under that umbrella.
We do a lot of procedural generation, and if we wanted to, say, generate an item that acts partially like one thing and partially like another, it’s just way harder to do that when you are locked down in a class hierarchy.
Preach:
https://ericlippert.com/2015/04/27/wizards-and-warriors-part...
https://ericlippert.com/2015/04/30/wizards-and-warriors-part...
https://ericlippert.com/2015/05/04/wizards-and-warriors-part...
https://ericlippert.com/2015/05/07/wizards-and-warriors-part...
https://ericlippert.com/2015/05/11/wizards-and-warriors-part...
I have certainly committed all of these sins, too.
Re: How Dwarf Fortress is built
#4I read everything about this game I can get my hands on. I don’t fully understand why I find dwarf fortress so intriguing. It’s such a pure passion project… that actually made it.
Re: How Dwarf Fortress is built
#5Re: How Dwarf Fortress is built
#6Making 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…
Good point! Skimmed the blog posts, seemed to have useful enumeration of techniques with considerations.
Re: How Dwarf Fortress is built
#7I read everything about this game I can get my hands on. I don’t fully understand why I find dwarf fortress so intriguing. It’s such a pure passion project… that actually made it.
Re: How Dwarf Fortress is built
#8To 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.
P.S.: A lot of you are confusing "complicated" with "difficult".
Re: How Dwarf Fortress is built
#9To 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.
Re: How Dwarf Fortress is built
#10Making 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…