Live data from Hacker News

How Dwarf Fortress is built

stackoverflow.blog

321–330 of 407 posts

Re: How Dwarf Fortress is built

#321

Earlier quoted context omitted.

> For games that want this level of complex interaction between components, entity component systems are the way to go. Entity component systems are still in a half-baked state, with everyone rolling their own slightly different conceptual model. They're solving a problem, but not solving it well. One promising direction is getting rid of entities. Components need to link to entities and other components anyway, so o…

I think this is more of a language paradigm problem. Game programming is very much tied up in C++ and C# for historical and performance reasons, ECS is a way to try and graft what is entirely natural in a more value-based language into OOP mechanics and C++/C# type systems. ECS is so common and easy in lisps that it doesn't even warrant its own name.

Ironically, the ECS advocates kind of miss the part that ECS models are based on OOP literature.

https://en.wikipedia.org/wiki/Component-based_software_engin...

"Component Software: Beyond Object-Oriented Programming"

https://www.amazon.com/Component-Software-Beyond-Object-Orie...

Re: How Dwarf Fortress is built

#322
post #137

Earlier quoted context omitted.

Basic git-fu (init, add, clean, commit, pull, push, branch, merge, stash, log) goes a long way to make your life easier. You can leave the fancy stuff for later. There are even git repos of 99% done .gitignore files for most needs [1], which is most of the setup work for a solo project. [1]: https://www.toptal.com/developers/gitignore

The official github desktop app is really nice to use as well. At least on a Mac.

The best graphical Git client I know about is Sublime Merge, if you want to try something new.

Re: How Dwarf Fortress is built

#323
post #313
post #260

Earlier quoted context omitted.

Games are interactive simulations, by nature. DF is an honest attempt at simulating things thoroughly. Therefore, DF is an honest attempt at making a thorough game. Very few games can make such a claim

Your reply is somewhat self-contradictory. If games are interactive simulations by nature, why is DF so unusual? There is a trend to call many modern games "immersive sims" and somehow they don't produce such stories. In my opinion game developers have mostly stopped trying to simulate things. The focus is on clothes, rigid crafting systems, skill trees, storyline, cutscenes, vehicles, item collection. It's sandboxes…

> If games are interactive simulations by nature, why is DF so unusual?

It’s an honest attempt at making a thorough simulation. Most games attempt only shallow rules and simulations — nearly everything that happens in Witcher 3 is encoded precisely, with few knock-on effects (because there’s nothing underneath the immediate effect + visualization — what’s modeled is precisely what you see); leading to the lack of emergent behavior. You’re dealing with a fairly rudimentary and static system. GTA is more flexible, but ultimately nothing follows any particular logic that doesn’t revolve around the player. More notably, in both games, if the player doesn’t exist, the world can no longer reasonably operate.

Simulation is inherent to game design, but very few games actively work towards it, as you’ve seen.

The simulation games of the 90’s were in the right vein — they faltered for practical reasons. As a result, they often make for thorough simulations that are dishonest — the internal logic of the simulation is violated for reasons of hardware limitations, UX simplicity, fun, etc. Tornados happen because it’s fun. DF is honest in the sense that it is only compromised by Tarn’s inability to implement something (and practical impact — it’s not worth trying to model atoms when fluid dynamics will suffice).

I don’t mean that DF produces a “realistic” simulation (as a climate scientist might) but that he produces a uncompromisingly logically consistent one (as a fiction author might)

Re: How Dwarf Fortress is built

#324

Earlier quoted context omitted.

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

Personally, I started using git for my projects after I accidentally deleted a good chunk of source code and my closest backup was several weeks old.

How? It’s very hard to completely lose code in git. Did you know about the reflog?

Re: How Dwarf Fortress is built

#325

Earlier quoted context omitted.

Yeah that's the one downside of not doing OOP. OOP is the only way to do GUI stuff. Nobody on the face of the earth has ever used Functional Reactive Programming. It's a made up concept. In fact it's also definitely not one of the concepts that inspired the most popular pattern in React.

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/wiki/Functional_reactive_programmin...

Second there are many languages/frameworks that use this paradigm. React partially uses this paradigm. But I will list two popular ones that strictly follow it... just note that there are more. Much more.

Take a look at elm. Elm is a fully functional UI library and language that is 100% pure, functional and has no OOP. Believe it or not ELM is not some toy, it is production ready and actually measurably faster than react. This language is what popularized the FRP pattern which is partially used by React today. See here: https://elm-lang.org/examples/mario

Note the load time and latency on the mario game. React doing the same thing will be slower.

Another language is ReasonML. ReasonML is essentially a language that compiles to the browser and has one to one correspondence with another functional language... OCaml.

ReasonML is Created by the creator of React, Jordan Walke. Coupled with React as framework, ReasonML is essentially the ideal GUI paradigm that Jordan would recommend everyone to use in the ideal world. However due to the fact that everyone is use to javascript, Jordan instead as a first step, ported FRP concepts over to a language called JSX (essentially JavaScript mixed with html) and is slowly nudging the world in the direction of GUI programming using the functional style: https://reasonml.github.io/

Make no mistake the creator, of the most popular GUI framework in the world is a supporter of the pure functional paradigm, and he is heavily and successfully pushing the functional style programming of GUIs into the mainstream.

OOPs being the dominant paradigm for GUIs has, in the past five years, become a false statement.

You're right on the wrapper part though. Assembly language is essentially a procedural language so every functional thing that exists on top of it, is a wrapper. But I mean this is a pointless observation.

Re: How Dwarf Fortress is built

#326
post #316

Earlier quoted context omitted.

Yeah that's the one downside of not doing OOP. OOP is the only way to do GUI stuff. Nobody on the face of the earth has ever used Functional Reactive Programming. It's a made up concept. In fact it's also definitely not one of the concepts that inspired the most popular pattern in React.

Last time I checked React happens to use OOP concepts from JavaScript, do you want a lesson on which ones?

Check React again and check more often otherwise you look like you don't know what you're talking about. Seriously. Functional components with hooks are the proper and modern way to do React:

https://www.robinwieruch.de/react-class-component-deprecated

The most popular widely used GUI framework in the world is eschewing OOP. Ever wonder why? I responded to another person here with a wall of text that should correct his ignorance: https://news.ycombinator.com/item?id=28004187

If you read it, your ignorance will be corrected as well. Also, in response to your question the answer is no, I do not want a lesson and I don't need one either as I know much more than you.

For you however; you are ignorant and you NEED a lesson, it is irrelevant whether you want one or not. You can be emotional and choose not to read the links I provide here, but I utterly guarantee you, you are literally doing yourself a disservice for the sake of pride. Suck it up man, read it.

Re: How Dwarf Fortress is built

#327

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.

Object programming is MUCH better than object oriented IME.

Re: How Dwarf Fortress is built

#329
post #88

Earlier quoted context omitted.

Hah, this is like EVE Online for me. I love reading about the espionage and cloak and dagger and pure insanity, but other than a brief toe-dip...oh no I will not play it. DF lives in my blood, however.

Totally agree on reading about EVE Online. This is a real classic if you haven’t seen it before, and actually contains a lot of very important notions for identifying Ponzi schemes: http://web.archive.org/web/20091026234156/http://geocities.c...

Thank you. I spent an hour reading this, and am probably better off financially in the real world because of it.

There are lots of scams out there.

Re: How Dwarf Fortress is built

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

>Enough alcohol will kill a cat

That's what intrigues me, Not played the game but this must because there were a list of things which could get the cat killed right? Then how come this is an unexpected bug?

Post reply on HN