You don't need a math PhD to play Dwarf Fortress, just to code it
the-stack-overflow-podcast.simplecast.com
the-stack-overflow-podcast.simplecast.com
> TA I think I think the math PhD itself didn't because I'm not in like n dimensional non Euclidean space. It's tricky. But But I think having practiced a lot of math and just solved a lot of problems. And generally being good at math. Like I've taught linear algebra. So that part of games is not hard for me, right? It's like and same thing like I'm calculus comes up sometimes. I've used a partial differential equation once it was for like windspeed firing arrows. I don't remember what it was. It was something like that. But it didn't I didn't really end up needing it. I mean, I used it to inform what I was doing but in the end faster just to use discrete simulation and miss a little bit. It's fine to miss. [Tarn laughs]
Most people in this thread believe that since a math PhD did not play a crucial role in Adams's ability to develop Dwarf Fortress, then it is true that such an alternative state of affairs is possible. (The language of "alternative universes" - usually called possible worlds in the literature - is one way of getting at this.)
huh. I was sure that DF used taxicab distances
I (and probably the GP) think of “R^n with taxicab distance” as a metric space, which is indeed non-isometric to the “Euclidean metric space” as in “R^n with Euclidean distance”, thus can meaningfully be called non-Euclidean in this context.
You seem to be thinking of whether taxicab distance agrees with some preexisting, weaker structure on this structure’s notion of “Euclidean space”, like how the taxicab metric topology agrees with the topology of the “Euclidean topological space”, that is, “R^n with standard topology”, or how taxicab distance is translation-invariant thus an admissible norm on the “Euclidean vector space”, that is, “R^n with standard R-vector space structure”. In those senses taxicab distances are in fact fine in Euclidean spaces. (Note that this ceases to work as soon as you go into infinite dimensions, probably in any of the many, many ways to do so.)
That might be correlated with having a phd, but it isn't mandatory.
EDIT: I physically cannot comprehend how what I have said is somehow worthy of a negative reaction.
It's only recently that the project has been paying off via community funding/patronage. A great deal of those early years must have been very difficult for them.
Another way it is like a PhD - a ton of up-front work for an uncertain payoff, largely dependent on the whim of others.
It's just a teaser to read the article.
Saying "You don't need a PhD you just need to believe in yourself", or whatever, is fine - but it's not related to the article, so gets down votes.
I specifically said that it is possible for someone to create a game like Dwarf Fortress without being the recepient of a PhD in Math.
I never said that I knew better than the author, or that you needed to believe in yourself, or anything like that.
I believe you are assuming that I'm reacting to something, but all I am saying is that you do not need a PhD to do what has been done.
Why is this normalized?
it's a competitive advantage.
No rational person would read this headline and assume that some cosmic force prevents you from coding Dwarf Fortress unless you have a math PhD. Therefore the most reasonable conclusion is that the creator of Dwarf Fortress does have a math PhD, and that it provided significant transferrable skills. That this is not what the headline says on a literal reading does not prevent a reader even with zero familiarity on the topic from correctly understanding it.
I agree entirely about motivation though - he's stuck with that project for an immense amount of time. Urist Borushdumat[1] and Boatmurdered[2] are both from 2007 - George W Bush was president then and The Colbert Report had barely gotten started - your nephew in high school was still in diapers. However - over the full run of nineteen years dwarf fortress has been in development[3] he has received pretty tremendous community support - well probably since 2005 or so - I don't know if anyone knew it existed in 2002.
1. http://www.bay12forums.com/smf/index.php?topic=15572.0
2. https://lparchive.org/Dwarf-Fortress-Boatmurdered/Introducti...
3. Wait - wtf - it's older than Firefly! (that's the show that made Nathan Fillion famous before Castle or Dr. Horrible's Sing-a-long-blog FYI) I can now use the line "I'm getting too old for this sh*"
So being a proper simulation, and combined with the lack of replay, you can almost entirely discard the past events. The game is largely modeled as f(world-state, sim-rules) -> world-state, and so you simply take the old save and continue running it under the new simulation rules, and no one has to really care how many rule sets the world has seen. It only matters that they produced a valid world-state, every time.
Also, yr talking to a crew of whimsical fairy folk. Don't take the neg personally.
It gets interesting pretty fast and a PhD would not hurt. :)
e.g. https://arxiv.org/abs/1906.08291
Would you maintain a roadmap telling you how to get from place to place, or just constantly replan? What happens when you change the available paths by building a wall or locking a door?
Your paper is dealing with a completely different problem — collision avoidance is hard, and you really shouldn’t care about it in a game like DF anyways. Simply treat existing dwarves as a wall, or allow multiple dwarves to be on the same tile momentarily (with a very strong preference to stand on their own tile).
Task assignment is DF/rimworld/etc is also pretty dumb — they’re fairly obviously simple greedy algorithms. you don’t need to be anything close to optimal to be effective. There exists a list of open tasks (place building, move x59 stone, fight baddie. User actions generally corresponds to multiple tasks). When a dwarf is idle, he takes the task-list, merges it with his needs (food, water, self-preservation, etc). Filter this list by permitted activities for the dwarf, prioritize the list (needs first, then by user-defined job priority, then by random roll). Lock any relevant object (eg x59 rocks in a move task) and execute.
As far as I know, there’s no attempt at global coordination in DF beyond simple locks — which I’m not sure are actually that strict. In DF I’m pretty sure two dwarves can go for the same pile of x50 rocks, and it’s simply first one wins. In rimworld it’s quite clear only one entity can hold a claim. DF in that case is much simpler and error-free (don’t need to care about dwarves dying while holding a lock) but rimworld’s would be more consistent and make better progress over time (eg a far away entity doesn’t keep getting screwed trying to grab resources from the base).
Pathfinding is largely a solved problem. Resource allocation doesn’t need to be smart.
I’m fairly positive DF’s biggest hurdles are largely in finding game-sufficient and efficient estimate models for complex processes: planet, fluid, wind (a kind of fluid), plant growth, etc. These models are all fairly well defined (to our gaming needs) by their respective communities, but they’re also far more involved than what we need — we just need to be roughly correct, and ideally have a self-stabilizing sim.
The difficulty of gamedev generally is simplifying the problem to find only what actually matters.
[0] http://www.roguebasin.com/index.php/The_Incredible_Power_of_...
[1] http://www.gameaipro.com/GameAIPro2/GameAIPro2_Chapter30_Mod...
That said, talking about downvotes on HN is pretty boring, so I won't be replying to responses to this comment.
We hear about projects all the time that have been developed for longer (Linux, Star Citizen, Temple OS, et al) and those are the successes and failures that people have actually heard about. Lots of other people fail along the way (or succeed in not achieving much) with decades of development. I think DF's development need not be elevated to a quasi-religious tale because someone got good enough life RNG, anymore than being born with the money to brute force it is laudable.
— Brian Kernighan, The Elements of Programming Style
(fortunately the interview itself is not so trite as the headline)
It is, though. Stack traces are fundamentally high-impedance for anything other than structured imperative code.
Imagine for example a state machine implemented two ways. In an imperative style where you have a big if STATE_IS_X /then function_x() /else if STATE_IS_Y ... tree calling a function for each state. Secondly in a functional style where you have a pattern match on a list of tuples of (state, function). In the first case the stack tells you exactly which state you were in and which function got called. In the second case the call stack will look the same in each case because you just match on the first part, unpack the second part into a variable and call the function in the variable.
By becoming more clever! That's the very principle of learning: to become more clever.
The act of debugging your own code to become more clever is a well-known learning technique called "Kernighan's ladder", precisely due to this inspiring quote.
I remember writing a little bit of clever (at the time) code for simplicity and speed. Ended up doing debugging and sanity checks via napkin math to confer with my partner because it was easier than reading through the function.
According to Google, you seem to be the first person to use that phrase.
Don't write clever code; the problem you're solving with code is difficult enough already.
No, it isn't. 90% of times it's just tons of dumb boilerplate. The sheer amount of that code creates its own accidental complexity, so if a bit of clever code can cut it down by an order of magnitude, by all means go for it. Other people may need to spend a bit of learning up front, but they'll come out better at the other end, and they won't have to pay the ongoing price of wading through vast amounts of code noise.
Nevertheless, the time lag to improving enough to debug your own very clever code may for some be recalled as a period of floundering dismay, self-doubt, and potentially crippling imposter syndrome.
At these times it is important to be willing to ask for help.
Corollary: at any given time, write code that is only slightly beyond your ability to debug, so that the competence delta is small.
There are things that can increase your "cleverness" like deliberate practice (of mental calculations, of memorization), meditation or deleting social media to increase your attention, or using drugs. I would not call that "learning".
Learning is similar to "installing new software on existing hardware". Becoming more clever is similar to "installing new hardware".
You can even get it as a Brew cask.
(I wonder if anyone will have a good story where something ~zany~ happened in their game... Fingers crossed!!)