Hacker News new | ask | show | jobs
by haolez 2596 days ago
I prefer this one:

> Hero poly'd into rope golem form could choke headless or non-breathing monsters

Amazing level of detail!

3 comments

> In Nethack, I’ve polymorphed myself into a cockatrice, layed cockatrice eggs, polymorphed back, picked them up (with gloves on) and used them as hand grenades of petrification.

> And to complete the chain of "the dev team thinks of everything": There's a luck penalty for breaking eggs you laid.

> The number of ways you can solve any specific problem is just ridiculous. I also love that a lot of them are pun based. (i.e., to make a quick escape you could drink a cursed potion of gain level, which will cause you to float up through the ceiling to the previous dungeon level instead of increasing your experience level, or removing cursed levitation boots by floating over a sink - which causes you to sink to the ground).

I am curious about the techniques used by the code to cover all these bases

i.e. how much can be done from clever rules, how much has to be exhaustively enumerated, special cases etc

exhaustively enumerated. i mean. a lot.

you should dive into the Nethack source code. It's really well organized but in monster behavior code (mon.c), it's an 'if'-fest :)

Nethack was the first large C codebase I ever got familiar with / tinkered with, and honestly I think it did some damage.

I mean it's great for what it is -- an organic codebase that evolved over decades (so there's a lot of performance/memory optimizations that make the code somewhat less clear like a lot of bitwise operations) and targeted a dizzying array of platforms (so there's a million #ifdefs that you have to climb through, many of them nested) and also compilers (so there's a legacy of really short file and function names that decrease clarity as well).

The attention to details is truly inspiring. But as a codebase, it's a mess.

On the other hand, Brogue [0]'s code is very clear and enjoyable to read.

[0] https://sites.google.com/site/broguegame/

DCSS is also fun in some places: https://twitter.com/crawlcode
It sounds like a good use case for logic programming.
How about this one:

Succubus/incubus seduction might result in loss of levitation which in turn could drop the hero onto a trap that transports him/her elsewhere; seduction was proceeding as if nothing unusual had happened

That's just crazy! Wear ring/boots of levitation over a teleport trap and let the succubus remove them for you. Who does this?! Love it.

Ooh, choking an ettin should do double damage then!