Forum:Getting into the Nethack source code

From NetHackWiki
Revision as of 11:38, 14 May 2009 by 62.148.102.64 (talk)
Jump to navigation Jump to search


SO: as the title says, I have just recently begun delving into the Nethack source code, and I must say it has been at once a very confusing and yet exceedingly interesting process. I have a little bit of past experience messing around with Python, and I can (mostly) read C (which is what most of Nethack is written in) but when it comes to making changes or adding items, which is exactly what I want to do, I mostly have no idea what I'm doing. :3

Before someone says this, I know full well that Nethack is NOT a very good first project to work on as a learn-by-doing coding experiment. I am painfully aware that the Nethack source code is the result of many years of jerry-rigged additions and modifications, that most of the code that is written is highly convoluted and make references to bits of code in a billion other places, and that the whole thing, even to an experienced programmer, is rather daunting. Be that as it may, however, this is what I've chosen to (hopefully) learn a thing or two from, and so I hope to get as much help with that as I can get. :D

So, that being said, what I'm looking for is someone who either knows a thing or two about the code and would be willing to put up with my insufferable n00bishness long enough to teach it to me, or a link to another forum/nethack community with someone who does. Any takers? OverWilliam 20:29, 13 May 2009 (UTC)

Hacking NetHack is how I learnt C (and lex and yacc). Good luck! Your best bet might be joining a #NetHack IRC channel so you can talk about things in realtime. Also, there is an old, out-of-date document on how to change the NetHack code here. I wrote a short tutorial on how to add a new special room. You also should take a look on how other people have coded patches; you can download most from the Patch Database --paxed 06:15, 14 May 2009 (UTC)
I don't think an IRC channel is an ideal place for code-related questions. Questions about one liners might work, but everything else is a bit hairy (especially in #nethack where you'd likely to drown in the messages and I don't know about another channel that could be called nethack-dev-related). I'd suggest posting to rec.games.roguelike.nethack (that has the added benefit that it gets archived for others to learn). --bhaak 10:55, 14 May 2009 (UTC)
Of course you shouldn't paste dozens of lines; you use pastebin or similar, and just give the link to that. But you're right, RGRN would be better. --62.148.102.64 11:38, 14 May 2009 (UTC)