Angband and the Borg on Linux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wastedyouth
    Rookie
    • Apr 2008
    • 4

    Angband and the Borg on Linux

    Hello,

    I've been a big fan of Angband since I was a kid, and it's nice to see it getting some attention again. I'm also quite proud of myself, because I've managed to compile it from the source on my Linux box.

    However, I'm wanting to compile it with the Borg. Is it even possible to compile in the APWborg for linux?

    Once I start to make the files I start running into problems...

    Code:
            CC     borg1.c             
            CC     borg2.c             
            CC     borg3.c             
    borg3.c: In function ‘borg_read_unknown’:
    borg3.c:3348: warning: unused variable ‘ag’
    borg3.c: In function ‘borg_read_scroll’:
    borg3.c:3489: warning: unused variable ‘ag’
    borg3.c: In function ‘borg_spell_okay’:
    borg3.c:4119: warning: unused variable ‘ag’
    borg3.c: In function ‘borg_prayer_okay’:
    borg3.c:4307: warning: unused variable ‘ag’
    and then it ends like this...

    Code:
            CC     z-virt.c            
    birth.o: In function `player_birth':
    /home/djp/angband-3.0.9b/src/birth.c:1758: undefined reference to `saver_creates'
    birth.o: In function `player_birth_aux':
    /home/djp/angband-3.0.9b/src/birth.c:1691: undefined reference to `saver_creates'
    birth.o: In function `player_birth_aux_3':
    /home/djp/angband-3.0.9b/src/birth.c:1543: undefined reference to `saver_creates'
    /home/djp/angband-3.0.9b/src/birth.c:1590: undefined reference to `saver_creates'
    util.o: In function `get_name':
    /home/djp/angband-3.0.9b/src/util.c:2888: undefined reference to `saver_creates'
    collect2: ld returned 1 exit status
    make[2]: *** [angband] Error 1
    make[1]: *** [build] Error 2
    make: *** [build] Error 2
    Am I trying to do something thats impossible or am I doing it wrong?
  • Remuz
    Apprentice
    • Apr 2007
    • 77

    #2
    I get the same error. Since the only main-*.c modified by the borg code is main-win.c, I would suspect the borg is for windows only.

    The variable 'saver_creates' exists so that the game knows if it has to create a new character automatically (when running the borg through the screensaver).

    I did not spend too much time on this, so there is no guaranty, but apparently, in externs.h, changing the following lines :


    Code:
    extern bool saver_creates; /* apw  */
    extern char screensaver_inkey_hack_buffer[1024]; /* apw */
    extern int screensaver_inkey_hack_size;
    into

    Code:
    bool saver_creates; /* apw */
    char screensaver_inkey_hack_buffer[1024]; /* apw */
    int screensaver_inkey_hack_size;
    Obviously, this is a bad hack, and you should not mess with the option to automatically recreate a character after death, as this will probably not work.

    Also, but this probably comes from my inexperience with installing angband, the game was looking for borg.txt (lower case) in ~/.angband/Angband. You might want to add the following lines in borg9.c, around line 4725 (after the "if(!fp) part) :

    Code:
            msg_print("Looking for borg.txt in");
            msg_print( buf );
    When testing, my character died from starvation at clvl 6, not too sure if that is ok or not.
    Edit: Ok, my current char is clvl 26 and going, so this seems to run as expected, after all.

    Hope that helps.
    Last edited by Remuz; April 12, 2008, 15:11.

    Comment

    • takkaria
      Veteran
      • Apr 2007
      • 1951

      #3
      Originally posted by Remuz
      I get the same error. Since the only main-*.c modified by the borg code is main-win.c, I would suspect the borg is for windows only.
      No, it's just developed on Windows and APW has no means of testing on other systems.

      The variable 'saver_creates' exists so that the game knows if it has to create a new character automatically (when running the borg through the screensaver).

      I did not spend too much time on this, so there is no guaranty, but apparently, in externs.h, changing the following lines :
      Try instead just appending "bool saver_creates;" to the end of variable.c. Works like a dream!
      takkaria whispers something about options. -more-

      Comment

      • takkaria
        Veteran
        • Apr 2007
        • 1951

        #4
        BTW, Unix people;

        A version of 3.0.9b + APWBorg + fixes is available using "git". Install the git and git-core packages for your flavour of Unix and run:
        Code:
        $ git clone git://repo.or.cz/angband/borg.git
        Like magic, you'll have working copy. I've just got interested in the borg, which is probably a terrible terrible thing for actually keeping the game maintained, but http://repo.or.cz/w/angband/borg/takk.git is the page with the latest changes to my own branch of APW's borg. Right now it's mainly code cleanup, but I want to make the borg generally a little more aggressive in its playstyle.
        takkaria whispers something about options. -more-

        Comment

        • Nick
          Vanilla maintainer
          • Apr 2007
          • 9637

          #5
          Originally posted by takkaria
          I've just got interested in the borg
          You might be interested in being able to run it in xscreensaver, then. I've mailed some stuff to your rephial address.
          One for the Dark Lord on his dark throne
          In the Land of Mordor where the Shadows lie.

          Comment

          • takkaria
            Veteran
            • Apr 2007
            • 1951

            #6
            Originally posted by Nick
            You might be interested in being able to run it in xscreensaver, then. I've mailed some stuff to your rephial address.
            You are obviously evil incarnate. Not only for giving me something else borg-related to hack on, but also for finding a good reason to keep the X11 port..
            takkaria whispers something about options. -more-

            Comment

            • Nick
              Vanilla maintainer
              • Apr 2007
              • 9637

              #7
              Originally posted by takkaria
              You are obviously evil incarnate.
              Well, you know, I do what I can...
              One for the Dark Lord on his dark throne
              In the Land of Mordor where the Shadows lie.

              Comment

              • maastrictian
                Rookie
                • Apr 2008
                • 3

                #8
                Takkaria's git link above was very useful to me. I got the source and am now running angband on linux. But I'm not able to run the borg.

                I've followed the steps outlined in borgread.txt (it seems like 2 & 3 were not needed with the git link) but I can't seem to start the borg.

                The "angband" command starts the game, but ctrl-z just suspends the game, either when I execute the command on game start or when I have a character loaded.

                What am I missing? How do I start the borg?

                Thanks!
                --Chris

                Comment

                • takkaria
                  Veteran
                  • Apr 2007
                  • 1951

                  #9
                  Originally posted by maastrictian
                  Takkaria's git link above was very useful to me. I got the source and am now running angband on linux. But I'm not able to run the borg.

                  I've followed the steps outlined in borgread.txt (it seems like 2 & 3 were not needed with the git link) but I can't seem to start the borg.

                  The "angband" command starts the game, but ctrl-z just suspends the game, either when I execute the command on game start or when I have a character loaded.

                  What am I missing? How do I start the borg?

                  Thanks!
                  --Chris
                  In that case, try literally '^' followed by 'Z'. Your problem is that you're running in a terminal, and in a terminal ^Z means "suspend". Luckily if you press ^ then Angband lets you press another key afterward and treats it like you'd pressed control and the second key at the same time.
                  takkaria whispers something about options. -more-

                  Comment

                  • maastrictian
                    Rookie
                    • Apr 2008
                    • 3

                    #10
                    Thanks, that's what I needed to know!

                    --Chris

                    Comment

                    • bdo
                      Rookie
                      • Apr 2008
                      • 11

                      #11
                      Originally posted by takkaria
                      A version of 3.0.9b + APWBorg + fixes is available using "git". Install the git and git-core packages for your flavour of Unix and run:
                      Code:
                      $ git clone git://repo.or.cz/angband/borg.git
                      I had a tinker with this over the weekend. Pretty neat. However, I've noticed that it stops unexpectedly from time to time. When it does, the borg messages window usually shows something like:

                      Code:
                      # Wank problem at grid (46,128) ta:131, tc:156, borg at (53,97)
                      # Aborting (too many objects...).
                      # Key <2>
                      # Removing keypress hook
                      (the above numbers from the most recent stoppage which happened to be on d/level 1). When it stops like this, the borg cannot be restarted. If I try to ctl+z / z to restart, I get:

                      Code:
                      # Installing keypress hook
                      # User key press <30><{british currency symbol}>
                      # Key type was <2><{hatched/shaded char}>
                      # Aborting (user abort).
                      # Removing keypress hook
                      However, if I ctl+x to save/exit, reload the game, then ctl+z / z to restart the borg, it carries on just fine (until the next stoppage ). Any thoughts?

                      Cheers,

                      - b.
                      P/S - forgot to add: I can't restart the borg after deliberately interrupting it either. I get the same sort of output in the messages window as described above. Exit / reload / restart works just fine.
                      Last edited by bdo; April 21, 2008, 01:52.

                      Comment

                      • takkaria
                        Veteran
                        • Apr 2007
                        • 1951

                        #12
                        Originally posted by bdo
                        I had a tinker with this over the weekend. Pretty neat. However, I've noticed that it stops unexpectedly from time to time. When it does, the borg messages window usually shows something like:

                        Code:
                        # Wank problem at grid (46,128) ta:131, tc:156, borg at (53,97)
                        # Aborting (too many objects...).
                        # Key <2>
                        # Removing keypress hook
                        (the above numbers from the most recent stoppage which happened to be on d/level 1). When it stops like this, the borg cannot be restarted. If I try to ctl+z / z to restart, I get:

                        Code:
                        # Installing keypress hook
                        # User key press <30><{british currency symbol}>
                        # Key type was <2><{hatched/shaded char}>
                        # Aborting (user abort).
                        # Removing keypress hook
                        However, if I ctl+x to save/exit, reload the game, then ctl+z / z to restart the borg, it carries on just fine (until the next stoppage ). Any thoughts?
                        I remember APW contacting me about something like this whilst he was sorting the borg for 3.0.8. I don't know what he managed to do about that (it happened every time the borg went into a store), so I don't know what to suggest here either.
                        takkaria whispers something about options. -more-

                        Comment

                        • APWhite
                          Adept
                          • Jul 2007
                          • 244

                          #13
                          Sorry for the absence. I had my borg laptop crash and the drive is being reconstructed at a data recovery center.

                          I was not aware of the unix concerns. I don't get here too often. But if you guys email me, I get on these errors straight away. I still actively work on the borg.

                          I am limited to working on Windows operating systems, so I do need some help with fixes to the other systems. I am happy to make more general changes to run the borg on other platforms.

                          That error above about the Wanks is related to the borg not being able to read the screen correctly. Were you using graphics (Adam Bolt or Gervais) tiles at the time?

                          I know how to over come that problem and will fix it as soon as my drive comes back.

                          I have found that the 306 borg is far more successful than the 309 borg. Eventhough there were no AI changes. That must mean there were certain changes to the game's AI or monster behavior.

                          The big complaint I had with 309 was the change to mouse support stuff. The borg had a hard time getting all that stuff worked out. It pretty much broke the screensaver from a fresh start. See, previously, the screen saver could start a character from scratch (from no previous Savefile). But with the 309 changes, he was not able to do so. I had to hack up some crap to get him to make that first character. It was no big deal to get him to restart if a savefile already existed. The problem was starting from nothing (having to choose, sex, race, class, stats, etc). I think it is all working now.

                          Feel free to email me any time you have borg questions or want to know how to get it to do something in particular.

                          Andrew
                          St George Chiropractor
                          Angband Borg Homepage

                          Comment

                          • APWhite
                            Adept
                            • Jul 2007
                            • 244

                            #14
                            Originally posted by Remuz
                            I get the same error. Since the only main-*.c modified by the borg code is main-win.c, I would suspect the borg is for windows only.

                            The variable 'saver_creates' exists so that the game knows if it has to create a new character automatically (when running the borg through the screensaver).

                            I did not spend too much time on this, so there is no guaranty, but apparently, in externs.h, changing the following lines :


                            Code:
                            extern bool saver_creates; /* apw  */
                            extern char screensaver_inkey_hack_buffer[1024]; /* apw */
                            extern int screensaver_inkey_hack_size;
                            into

                            Code:
                            bool saver_creates; /* apw */
                            char screensaver_inkey_hack_buffer[1024]; /* apw */
                            int screensaver_inkey_hack_size;
                            Obviously, this is a bad hack, and you should not mess with the option to automatically recreate a character after death, as this will probably not work.

                            Also, but this probably comes from my inexperience with installing angband, the game was looking for borg.txt (lower case) in ~/.angband/Angband. You might want to add the following lines in borg9.c, around line 4725 (after the "if(!fp) part) :

                            Code:
                                    msg_print("Looking for borg.txt in");
                                    msg_print( buf );
                            When testing, my character died from starvation at clvl 6, not too sure if that is ok or not.
                            Edit: Ok, my current char is clvl 26 and going, so this seems to run as expected, after all.

                            Hope that helps.

                            I will try to fix these when I get my drive back. It might be a few weeks.

                            Can someone with Unix give me details on what the path to the borg.txt directory ought to look like. I will include those instructions into the borg's readme file.

                            Andrew
                            St George Chiropractor
                            Angband Borg Homepage

                            Comment

                            • takkaria
                              Veteran
                              • Apr 2007
                              • 1951

                              #15
                              Originally posted by APWhite
                              I will try to fix these when I get my drive back. It might be a few weeks.

                              Can someone with Unix give me details on what the path to the borg.txt directory ought to look like. I will include those instructions into the borg's readme file.

                              Andrew
                              The borg.txt file ought to be placed in the directory ~/.angband/Angband/ on Unix systems.
                              takkaria whispers something about options. -more-

                              Comment

                              Working...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎