u/Ardub23

Why do invisible monsters get angry when you bump into them?

Friendly creature react violently to a gentle bump (even with the 'm' prefix), but only when they're invisible and there's no way you could have known to avoid them. Seems nonsensical.

I went looking through the source code; this seems to occur because, on line 250 of uhitm.c, wakeup() is called with TRUE instead of FALSE, as if the attempt at taking a step was an attack. There's a code comment:

> #H7329 - if hero is on engraved "Elbereth", this will end up assessing an alignment penalty and removing the engraving even though no attack actually occurs. Since it also angers peacefuls, we're operating as if an attack attempt did occur and the Elbereth behavior is consistent.

I don't understand this. At first I thought it was saying that, before we even reach this point in the code, the game has already treated this harmless walking as an affront to Elbereth (in which case, why not just… not do that?) But actually, the Elbereth check is in setmangry(), which is called after this point. In fact it's only called because wakeup() treats this like an attack. So what gives?

Edit: I want to clarify—just because there's a call to a function called wakeup(), doesn't mean the monster was asleep. In fact, it's most likely a peaceful monster who's wide awake, knows you're there, and turned themselves invisible on purpose.

reddit.com
u/Ardub23 — 5 days ago
▲ 31 r/nethack

Download .ttf  |  Screenshots


Basically all fonts, even monospaced fonts, have characters that are taller than their width. Fine for general readability, but when used to draw a dungeon map, the squares ain't square. Horizontal distances seem shorter than they really are, and vertical distances longer. If you use such a font to render NetHack, you might not realize that the dungeon is 21×80—nearly four times as wide as it is tall.

In the interest of seeing the dungeon in its true scale, I went looking for fonts whose characters have a square, 1:1 aspect ratio. They exist, but there aren't many. The IBM BIOS font from here is usable. But uh, I got tired of using it for some reason and decided to make my own.

HackerSquare includes every character in Code Page 437, which is probably all you'll need for NetHack, plus some other characters I felt like including. If it's missing any characters you want, let me know and maybe I'll add them.

u/Ardub23 — 14 days ago