                A Guide to Installing and Compiling 
                       NETHACK PLUS on a PC
                
                BY: Stephen White (swhite@cs.mun.ca)

Ok, I'll try to make this as brief as possable and still contain all the
information you need to know.  Ok, lets begin.

FILES:
        
        If you do not have a compiler and haven't access to one then you
        should download the following files:
                install.txt
                nhplus01.zip
                nhplus02.zip
                djgpp.zip
        Should you already have a compiler that is setup and working
        you only need to download the nhplus.zip file.

        NOTE: Be sure to set transfer to BINARY before downloading :)

UNPACKING:
        
        Ok, assuming you have pkunzip, you first have to make a directory
        called c:\nh (I will also assume that you are using a PC with 
        a c drive, if you arn't using such a beast, the dir structure
        should still be about the same) and copy ALL the files you have 
        downloaded into it.

        Then type EXACTLY: pkunzip -d nhplus01.zip
                           pkunzip -d nhplus02.zip
        
        Next create a directorie called c:\djgpp.old

        Then, while still in the c:\nh directory type:
                pkunzip -d djgpp.zip c:\djgpp.old\*.*

        There!  You should be finisher unpacking the archives.

        Finally, make a directory c:\nhplus
        
        You should now have a directory structure simmilar to this:
        
        |
        |-nh-.
        |    |-dat (containes data file and special level files)
        |    |-help (all the help files for the game)
        |    |-src (the main code)
        |    |-include (all the header stuff for the code)
        |    |-sys-.
        |    |     |-share (various things)
        |    |     |-msdos (Dos related stuff)
        |    |
        |    |-docs (Ummm ... )
        |    |-util (utilites used to make the game)
        |
        |-djgpp.old-.
        |           |-ndmake
        |           |-(a lot of sub-directories)
        |-nhplus
        |

        If you have more than this it's not bad ... but if you have any
        fewer, something didn't go right.

SETUP:

        Setup is a very simple process. Make a backup copy of your 
        autoexec.bat and config.sys and then copy the autoexec.bat and 
        config.sys from c:\nh to c:\, or just copy the contents of the
        files into your current autoexec.bat and config.sys. Mind you, 
        the compiler likes to have a lot of memory to work with, so you
        should disable any tsr's and memory managers before starting to
        compile.

        NOTE: The compiler will NOT work under (a) Windows (or the like)
              (b) when a memory manager is currently running. Also, the
              executable will not work under these conditions as well.
              This version of DJGPP is old ... but works better when you
              have a 386 or low memory (like me :). There is another version
              that will work under windows and with memory managers, but I
              will not deal with that now. If you have interest in such a 
              beast, contact me and I will give you details on it's where
              abouts and what not.

        This step is VERY IMPORTANT!  Go to c:\nh\sys\msdos and read the
        install.dos file and follow all of the steps.  Most of the setup 
        should be done already but you should re-check all of them.
        A lot of the personal preferances are selected in the steps outlined
        in the install.dos so read carefully. 

        NOTE: In install.dos, when it tells you to 'make all' in a certain
        directory just go to that specified directory and type MAKE45. Or,
        if you are recompiling the WHOLE program (or if you are compiling
        it for the first time) you can also use the batch file I created 
        to do the job for you, it's loacted in c:\nh\util and is called
        'makeall.bat'

COMPILING:

        If you followed the steps in the install.dos you should already
        have compiled you own copy of Nethack Plus.  Now, a few more
        things need to be done before you can begin Hacking ...

        Go to the c:\nh\dat directory and use the "move.bat" file to put all 
        the necessary files in the game directory (if you didn't use c:\nhplus,
        you better change the file :)

        If it tells you it can't find go32.exe then copy 
        c:\djgpp.old\bin\go32.exe to c:\nhplus.

MAKEFILES:

        Yes, as you may have already noticed there are three makefiles.
        One located in c:\nh\util, c:\nh\dat and c:\nh\src.

        This is not bad planing but was done on purpose to help prevent 
        non-workable nethack.exe's and a lot on un-necessary compiling.

        The makefile in c:\nh\util creates several executables which are
        used throughout the compiling precess, in addition it also creates
        the recover.exe for recovering from a crashed game. It also 
        creates onames.h and pm.h (which are loacted in the c:\nh\include
        dir), these files contain all the item and monster defines ...
        NEVER, NEVER EVER, edit or change these in any way. If you do,
        9 chanches out of ten you will end up with a non-playable 
        executable. When ever you make45 this file treat it as if you 
        were compileing NH for the first time and follow the steps I
        outlined above (excluding checking install.dos)

        The makefile in c:\nh\dat can be executed (via make45) at any time
        without the need to re-compiling the whole thing, just be sure
        to copy the re-maked files from this directory to c:\nhplus (see 
        above for detailes on which files need to be copied)

        The final makefile in c:\nh\src can be executed at any time
        without need of any coping or re-compiling. It will create the
        the nethack.exe in the c:\nhplus dir. By doing this, you update the
        version of nethack, thereby destroying any saved games or bones
        levels ... sorry. Only those *.c files that have been edited
        will be recompiled (or if the a *.o file is missing) so this is 
        useful for making minor changes to the source. 
        
        PLEASE NOTE: If you add any new objects to objects.c you will
                     need to recompile the game (makeall in c:\nh\util),
                     however if you mearly change object stat, you may not
                     have to do a full compile.

ADDITIONAL NOTES:

        Here are a few general rules for compiling NH:
                (1) If you change or edit ANY of the *.h files in the 
                    c:\nh\include directory you MUST recompile the
                    whole game. If you don't ... strange things will
                    happen.

                (2) As a rule, the makefile checks the time stamp on
                    each file to be compiled, if it finds that one or
                    more of the *.h files has changed it will attempt to
                    recompile. If this occures for no apparent reason
                    then you probally have a mismatched time stamp
                    somewhere. Be sure you time and date are set correctly.

                (3) If you want to recompile only a few files in the 
                    c:\nh\src directory just edit them or use touch.exe in
                    the c:\nh\ndmake directory to adjust the time stamp.
                    Then simply make45 in the c:\nh\src directory, the
                    makefile should automatically remake only those files
                    who have been edited. If this is not he case, then 
                    there is probally a mismatched time stamp SOMEWHERE :)

                (4) If you ever recompile the game, make sure to run 
                    "move.bat" in the c:\nh\dat directory or bad things 
                    may happen if you don't.

Well, that should get you through compiling NH, if you encounter any 
problems not explaned here just E-Mail me at swhite@cs.mun.ca
(or swhite@garfield.cs.mun.ca if that bounces ... and if THAT doesn't work, 
you could even try swhite@ftp.krl.caltech.edu), make sure to send
the subject as COMPILE PROBLEM ... otherwise I might not read it for
a few days (I've been getting a LOT of mail lately ... wonder why? :)



        
