As an avid fan and player of nethack and its variants, I've always been struck with ideas for additions/changes to the game while playing. As a C programmer, it only made sense to make my own nethack variant.
My posts will contain my thoughts about game play as well as my thoughts about the code. Some posts will be geared more towards general game play concepts and brainstorming, such as thoughts for new roles or races. Some posts will be geared more towards game specifics, such as racial stats, role abilities, probabilities of succeeding at various tasks. Finally, some posts _may_ end up being geared towards coding, such as monster
struct consolidation, the use of function pointer lists for special attacks, and the beauties of C type declarations. Even if you don't care about the code stuff, all posts will be geared towards nethack, so feel free to comment on, question about, or suggest anything.
I'll be using the slashem source code as a base for my project, however, I plan on adding features from several different variants (such as sporkhack and unnethack), other patches (color alchemy, hpmon) and new features of my own. At the end of all this, and potentially throughout development, I will, of course, make the source code available for y'all to test. In addition, I will also make pkg.tar.gz and .tgz files available for easy installation on Arch Linux and FreeBSD, respectively. Most of my testing will be done on Arch Linux (if you think ascending a Tourist is hard, try building nethack from source on an Ubuntu or Mint box). I will also be compiling with gcc, and _maybe_ LLVM on BSD, so hopefully using the two different compilers will catch any mistakes I make relating to compiler specific extensions, like branch prediction (which is fun but generally not needed for a turn-based, user-land game) or other code that doesn't fit the old C89 standard.
As this is the first blog entry, I will lay out my big-picture plans and *try* to leave the details for future posts. Keep in mind, a lot of this is still in the brainstorming phase.
1) Re-write/re-structure large parts of the game engine.
First, I will split the code into two modules. The first module will handle game play. I will replace all closures with their equivalent trigraphs, then implement the entire game in a single function using only pre-processor macros. All control flow will be handled with goto's. The second module will parse the data files, and will be written entirely in perl keywords.
All kidding aside, the slashem code is pretty kludgy. Then again, I'm used to kernel programming, where we like to keep things robust and concise instead of adding lots of complicated conditionals for specific situations, of which there are many in slashem. That said, I do not see any reason why the 'hit monster' function has to be 1000 lines of nested
if and
switch blocks.
Basically, I want to make the code more generic.
For example, there are three different source files for hitting things: monsters hitting you (
mhitu.c), you hitting monsters (
uhitm.c), and monsters hitting monsters (
mhitm.c). There is also a file for monsters throwing items at you (
mthrowu.c), and you throwing items at monsters (
dothrow.c). (Can you guess which file contains the code for monsters throwing at monsters?)
2) Religion.
Alignment will play a bigger role in things, from first sacrifice artifacts to different codes of conduct. Similar to sporkhack, sacrifice gifts are not guaranteed to be artifacts, and the probability with which you receive an artifact gift from a sacrifice will be based on xp level.
3) Add new stuff (below are just some examples).
3a) New Races.
Kobold strikes me as a reasonable starting race. They would have a racial technique at first level, "Poison", that poisons inventory objects such as darts or other projectiles.
Mindflayer is another race I'm considering. They would probably resemble Vampires in slashem, i.e., start with a penalty (either slow, or negative luck) and they would have a bite attack, but they wouldn't fly and would have better Int and Wis stats.
3b) New Roles.
Soldier: the game has guns, why not have a soldier role? They would be able to attain "expert" in firearm proficiency, among other weapons. The quest artifact, of course, would be The Holy Hand Grenade. More details on this in a future post.
Jedi: slashem has lightsabers, so of course, someone already made a Jedi patch. I had some issues with it, so I improved (according to me, at least) on the Jedi role substantially. I'll have a more detailed post about this in the future, and I'll make the patch available when I'm happy with it.
Psion: this one is my real brain child. I'm saving the details for a future post(s), but let's just say that brainstorming for the Psion role has been a driving force behind other changes I want to make to the game that will affect all roles (quick teaser: a system for throwing, and being thrown by, monsters).
3c) New Monsters.
Probably some monsters from the biodiversity patch and Gold Dragons from sporkhack, to name a few.
3d) New Items.
Definitely going to include the "bag of poo" from sporkhack. I also like sporkhack's magic staff system. Also, why not add things like Gauntlets of Offense, spellbooks of probing, and wands of wonder? Nethack and its variants make references to various parts of geek culture, but they all left out one of the greatest roguelikes of all time: Toe Jame & Earl. Rocket Skates anyone? I envision them as being generated cursed most of the time, providing a faster movement rate than boots of speed, while forcing you to run (as if holding down the shift key when moving).
4) Interface.
No real changes here. I've seen screenshots of the inventory window patch, and other similar layout patches, but I've never tried them. Honestly, I think they are a great idea, but I'm not going to include them because I feel that the game should be able to fit in a standard 80x24 console.