Live data from Hacker News

How Dwarf Fortress is built

stackoverflow.blog

391–400 of 407 posts

Re: How Dwarf Fortress is built

#392
post #252

Earlier quoted context omitted.

I guess the exception would be when you’re modeling a graph.

Hah, that's actually a good point. You still don't necessarily need to model the graph at the object level though. You could model your graph as a set of pairs, ie edges. If performance was more of a concern you could do it as a map where each object was a key and the values were a list of the connected objects. You could also separate out the value from the graph behavior and have a GraphNode object that wraps each…

Oh yes that is certainly sane.

> Once the interfaces between your objects are values instead of references you're free to connect your objects together in any way you need and are not stuck with the fixed graph as originally designed.

Absolutely, same can be said about relational data representation for example.

Re: How Dwarf Fortress is built

#393
post #240

Earlier quoted context omitted.

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…

Go has interfaces, but not inheritence. I'm slightly confused about what you're trying to describe, but maybe it's something like this? https://play.golang.org/p/smPyWvBvWWp We can make both Food and Animal statisfy the "Animateable" interface. Go also has a syntactic shortcut which is similar to inheritence, but more explicit. If you include a field in a struct without any name, it is considered "embedded", and you…

Thanks very much for the reply. Here's more of a clarifying example:

The idea I was going with Animateable was not animation (poor wording on my part), but effictively giving the properties of a creature to a thing, ie magically animating it. So I have an ability in-game that lets me turn anything into a creature, thus merging the Creature interface with whatever other interface this has. From what I'm getting from you, that means every single thing in the game must implement the Animateable interface.

Now lets do another one, I want a Metalic property. Say these are things that when hit by lightning will give off lightning damage. Then there's a curse called Midas that will let me turn anything metallic.

So I have a Wooden Hammer object which I midas curse mixing in metalic, then a wizard animates it so that it has the properties of a creature, and I have a creature that when I hit with lightning gives off sparks that I can also use to hammer nails.

Point being, in this world you're basically requiring every single thing to implement every single interface which sounds like a nightmare, where with more of an ECS style system, you just merge in the new behavior and call it a day.

Re: How Dwarf Fortress is built

#394
post #263

Earlier quoted context omitted.

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++?

For some reason I actually did not know this!

Re: How Dwarf Fortress is built

#395
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!

I love this. And I like it's also consistant with the findings of the natural semantic Metalanguage.

NSM would be the minimum element set of concepts shared by all human cultures, which can be used to derive the rest of concepts, and it's heavily based on anthropological field studies.

And it includes the numbers one, two and many, (also few, some & all). So that indicates some special meaningful distinction for us in that jump from two repetitions to start abstracting away.

Re: How Dwarf Fortress is built

#396
post #336
post #142

I tried to play DF. I even got over the ASCII interface. But honestly Rimworld is better and a bit deeper.

I really can't agree. Rimworld might be more accessible, but it lacks DF's depth of simulation. Even if you ignore details in DF that are generally unimportant (e.g. all the intricate details of a dwarf's personality and the precise genetics of their facial hair), Rimworld's lack of 3D and fluid simulation alone make it vastly simpler. But what really annoyed me about Rimworld, and why I never really got into it, was…

Yeah, I've gone through phases of almost loving RimWorld, but it really lacks the depth and cohesion of Dwarf Fortress' simulation.

There's a sense of something missing, and RimWorld tries to fill that void with its random event generator, the "storyteller system". A better game would at least give you ways to interact with them - to predict solar flares or prevent electrical shorts - and indeed there are mods which help with this. But it just underlines the shallowness of the simulation, how these events are truly random and not connected to the game world in any meaningful way.

Re: How Dwarf Fortress is built

#397

Earlier quoted context omitted.

> 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)

Your comment is true in a literal sense, but there are other games with very similar mind-boggling complexity that exist and thrive thanks to being open source. SS13 and CDDA jump to mind.

Re: How Dwarf Fortress is built

#398
post #197

Earlier quoted context omitted.

Yeah for sure, he didn't mean anything by it. I try not to be super sensitive, that makes interacting with people impossible. But sometimes it's hard :).

I have a similar sensitivity around my primary vocation: I'm an artist with a day job, like many others, but since my day job is programming and I take it seriously, a lot of people think of my art as a "hobby." Which it very much is not. FWIW I have found that three things help me deal with this sensitivity: 1) Take it as motivation to be more outwardly "professional" about my art. Improve the website, be more activ…

Yeah I just found out this year the William Carlos Williams was also, by the way, Chief of Pediatrics at Passaic General Hospital. What if people referred to his poetry as a hobby?

Re: How Dwarf Fortress is built

#399
post #373
post #285

Earlier quoted context omitted.

What op links actually describes a different issue than what is in the post. What I got from the article, instead, is the following: If entities could be IDs to which components are connected, or containers holding components. Either case has disadvantages. If entities hold components, then iterating over components means iterating over entities, which slows down all systems. A rare type of component still degrades w…

> Author proposes to use a graph structure between components, getting rid of entities-component duality. Proposes to use pointers which allows calling into any component and process then all required components. This is far from ideal, and is equivalent to a very naive implementation of ECS. Having the user have to use pointers is not ergonomic, and the random access of secondary components via those pointers destro…

Good to know. Just to be clear, I was not endorsing the article. As mentioned, I have doubts about using a graph structure of pointers for related reasons, most of all because I think handling relational paths will amount to more overhead than any ECS structure.

Nevertheless, I wanted to highlight that the quoted article clearly states that the proposal is not an ECS and is in fact superior to it.

Re: How Dwarf Fortress is built

#400
post #383
post #266

Earlier quoted context omitted.

>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 wit…

I think it’s more about internal consistency. If a world hasn’t said something about it (or hasn’t shown a derivation of it — e.g. gravity presumably exists, because all objects shown have been affected by it), then you’re free to do whatever (e.g. introduce magic as a mechanism). But once done, it must continue to hold true — else the rules are bullshit, and we expect nothing to behave in a manner that isn’t arbitrary.

Even fortnite has a kind of logic to it, haphazard as they may be (though it’s also so loosely defined, that I find it completely uninteresting — it’s a dumpster fire of cosmetic items with no real theme or nuance; this is because its more a modern shopping mall [ an arbitrary context for social groups ] than a game system).

It’s why simpsons can revert (nearly) all damages every episode (that’s simply the rule of the world), but if it tried to violate that rule and persisted those changes in any meaningful way, it would feel like complete nonsense. (They do however do it for self-referential jokes and such, but these aren’t persistence so much as temporary anomalies) At best, they’re allowed to forget something exists altogether.

Post reply on HN