Live data from Hacker News

How Dwarf Fortress is built

stackoverflow.blog

341–350 of 407 posts

Re: How Dwarf Fortress is built

#341
post #220

Earlier quoted context omitted.

Catplosions (Tarn loves cats, cats reproduce, too many cats kills DF performance) This was a particularly insidious one because the usual strategy of culling excess livestock doesn't work out when applied to dwarfs' pets (pets can't be designated for slaughter, and other means of making pets die will make their owners upset). With most animals, you can avoid the pet adoption issue by just not marking them as availabl…

Verily, the dwarf would pick up a cat to take it to the slaughterhouse, the cat would adopt the nearest dwarf (the one carrying it) and then the dwarf would slaughter the cat. And get sad because his pet died. And then eventually start tantruming and a tantrum spiral would begin.

> And then eventually start tantruming

It's so crazy when you try to make dwarves feel great all the time and then the simulation comes up with some completely insane causal chain that messes up everything.

I once tried to isolate a miasma problem with a wall. Which works fine, unless the dwarf tasked with building the wall decides he needs a break, sleeps on the floor and then gets grumpy because he just slept on a hard surface in a smelly area.

Re: How Dwarf Fortress is built

#343

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.

Actually there is NuclearJS a Flux (React) implementation in JS designed around immutability, FP and also reactive programming. As anything pure FP, it's ridiculously difficult/awkward to get started but it really shines in some areas. Namely complex UIs, state transitions and interrelated data "objects". The first 2 can be solved with proper OOP (it's obviously not nice but it solves the problem), but I've never seen a framework ironing out the nastiness of relational data so well. The idea is to combine multiple data objects using lambdas. It's incredibly elegant and so general concept is supposed to be the "Functional Lens".

Unfortunately it's discontinued, probably rightly because it's definitely not for teamwork. But really, it doesn't depend on anything OOP in the strict sense.

Re: How Dwarf Fortress is built

#345

Earlier quoted context omitted.

I started doing game dev in DOS after reading Tricks of the Game Programming Gurus by Andre LaMothe in the 90s, so keep that in mind for the following advice. Depends on what you want to do. If you want to code games because you find the programming aspect interesting, start small by writing your own versions of some simple games. I personally wouldn't recommend any frameworks or libraries other than (maybe) SDL. Imp…

My father got me that book when I was getting more seriously into game programing and it's an absolutely wonderful tome. It has a lot of very good points about not just programming but also game design and how to achieve interesting and seemingly intelligent NPC behavior with a few simple tricks. Parts of it may be a bit dated now, though.

My parents also got me that book as a teenager. I learned C from that book: I knew Pascal which we were taught at school and once I realised that you just substituted BEGIN and END with { and } it was easy to learn the other aspect.

I really regret that I don't have it any more for the sentimental value it held.

I see archive.org has it in their library [0], though it is is marked as "not for borrow"

[0] https://archive.org/details/teachyourselfgam00lamo

EDIT: Doh, I recogonised the author's name, but I'm thinking of a different book: "Teach yourself game-programming in 21 days"

Re: How Dwarf Fortress is built

#346

Earlier quoted context omitted.

My father got me that book when I was getting more seriously into game programing and it's an absolutely wonderful tome. It has a lot of very good points about not just programming but also game design and how to achieve interesting and seemingly intelligent NPC behavior with a few simple tricks. Parts of it may be a bit dated now, though.

My parents also got me that book as a teenager. I learned C from that book: I knew Pascal which we were taught at school and once I realised that you just substituted BEGIN and END with { and } it was easy to learn the other aspect. I really regret that I don't have it any more for the sentimental value it held. I see archive.org has it in their library [0], though it is is marked as "not for borrow" [0] https://arch…

LaMothe wrote a lot of game dev books.

Re: How Dwarf Fortress is built

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

Or to paraphrase some sayings / one-liners, "a little copying is better than the wrong abstraction".

Re: How Dwarf Fortress is built

#348
post #333

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…

The Baader-Meinhof phenomenon has hit me hard. I read an excellent blog post yesterday on this exact subject. Well worth a read, even if Rust isn't your thing: https://kyren.github.io/2018/09/14/rustconf-talk.html

This took half an hour to read so I don't know how the author expected it to be a half an hour talk! Thanks for sharing.

Re: How Dwarf Fortress is built

#349
post #103

Earlier quoted context omitted.

He is? He's making almost 9k a month, that's pretty good if you ask me. https://www.patreon.com/bay12games

I stand very much corrected, I didn't realize the project had gathered so much support steam compared to 5-10 years ago. Happy to see it

If you look at the monthly reports from a decade ago you see they were given donations ranging from 2000 to 6000 dollars a month even then.

http://www.bay12forums.com/smf/index.php?topic=97092.0

Re: How Dwarf Fortress is built

#350

This is a little bit of a hijack but if I wanted to start coding games as a side project, where would I start? Which platform? Mobile, PC, console? Any good introductions on the subject of solo game development? I know I can google this, but I trust HN users more than the Google algo.

I would suggest you start by just coding a text-based game. Yeah, you heard me right. Maybe a text adventure or whatever. A D&D game printing out damage as logs. FTL clone, with text descriptions only. Anything. You can create a surprisingly engaging game just with basic standard input and output - even multiplayer games (the MUDs were basically this). Print a basic ASCII map, and now you can do Nethack. The reason f…

Thanks for the in depth answer. I like your structured advice and it makes a lot of sense on multiple levels.
Post reply on HN