Borg for 320 is running.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • s0be
    Apprentice
    • Jan 2008
    • 96

    Originally posted by Timo Pietilä
    I just downloaded the 3.2 borg source in my computer, and it looks to me that all of the files have windows-type EOL. (CR/LF).

    I'm not sure why borg8.c would be any different than rest of the files.
    Because I needed to patch it for including objects/foo.h instead of foo.h. Alternatively, I could have added objects/ to the include search path in the makefile, but I went for the less intrusive approach. It's just a difference in the behavior of the windows vs linux compilers.

    Comment

    • Timo Pietilä
      Prophet
      • Apr 2007
      • 4096

      Originally posted by s0be
      Because I needed to patch it for including objects/foo.h instead of foo.h. Alternatively, I could have added objects/ to the include search path in the makefile, but I went for the less intrusive approach. It's just a difference in the behavior of the windows vs linux compilers.
      Ah, this is not the official code, but your patching that causes this behavior. Then APWhite doesn't need to do a thing.

      Couldn't you fix the EOL in linux for that file to match rest of the files? My linux-fu is a bit rusty, but I recall that there is some command line thingamodo that can do that with single command to huge bulk of the files at once.

      Comment

      • Magnate
        Angband Devteam member
        • May 2007
        • 5110

        Originally posted by Timo Pietilä
        Ah, this is not the official code, but your patching that causes this behavior. Then APWhite doesn't need to do a thing.

        Couldn't you fix the EOL in linux for that file to match rest of the files? My linux-fu is a bit rusty, but I recall that there is some command line thingamodo that can do that with single command to huge bulk of the files at once.
        I think sed is what you mean - very powerful, but requires arcane skill to use ...
        "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

        Comment

        • d_m
          Angband Devteam member
          • Aug 2008
          • 1517

          You can install dos2unix which just does this (turns windows CRLF into unix LF).

          You can use sed as so: sed -ire 's#\r$##' Makefile.win

          There are many other ways to accomplish this.

          To find all filenames in DIR with windows line endings you can do:

          grep -rl --binary-files=without-match $'\r' DIR

          To find each line in FILE with windows line ending you can do (prefixed by line number with -n):

          grep -n $'\r' FILE

          I'm hoping to get CRLF out of Angband's code base eventually, and will need help keeping it from sneaking back in.

          P.S. These commands all work in bash on *nix (Linux, OSX, BSD, etc). I assume they'll work in Cygwin/Windows too but I'm not sure.
          linux->xterm->screen->pmacs

          Comment

          • s0be
            Apprentice
            • Jan 2008
            • 96

            Originally posted by d_m
            You can install dos2unix which just does this (turns windows CRLF into unix LF).

            You can use sed as so: sed -ire 's#\r$##' Makefile.win

            There are many other ways to accomplish this.

            To find all filenames in DIR with windows line endings you can do:

            grep -rl --binary-files=without-match $'\r' DIR

            To find each line in FILE with windows line ending you can do (prefixed by line number with -n):

            grep -n $'\r' FILE

            I'm hoping to get CRLF out of Angband's code base eventually, and will need help keeping it from sneaking back in.

            P.S. These commands all work in bash on *nix (Linux, OSX, BSD, etc). I assume they'll work in Cygwin/Windows too but I'm not sure.
            Yeah, but when I was doing it, it was quick n' dirty. The way I append the patches (echo -e "PATCH1\n$(diff -u ..... )ENDPATCH1" >> makeborg.sh, from memory, so don't quote me on it) didn't make it immediately apparent that there was an endline issue. I either had to pull and re-do the whole script, or just say you have to wget it rather than editing a file and copy/pasting it in.

            Comment

            • s0be
              Apprentice
              • Jan 2008
              • 96

              I'm running a randart borg, and now that one has made it to end game, I've noticed it's artifact collection overlaps with the previous iteration's artifacts. Where/how does the borg respawn? I'd like to re-randomize the artifacts if possible per iteration (to keep my interest).

              Comment

              • APWhite
                Adept
                • Jul 2007
                • 244

                Originally posted by s0be
                I'm running a randart borg, and now that one has made it to end game, I've noticed it's artifact collection overlaps with the previous iteration's artifacts. Where/how does the borg respawn? I'd like to re-randomize the artifacts if possible per iteration (to keep my interest).
                Fixed it today. I'll upload it later. It is an easy fix in borg9.c resurrect_borg(void).

                Code:
                #ifdef GJW_RANDART
                    /* Hack -- seed for random artifacts */
                    seed_randart = randint1(0x10000000);
                
                    /* Randomize the artifacts */
                    if (adult_rand_artifacts)
                    {
                		do_randart(seed_randart, TRUE);
                    }
                #endif
                Must be changed to:
                Code:
                    /* Hack -- seed for random artifacts */
                    seed_randart = randint1(0x10000000);
                
                    /* Randomize the artifacts */
                    if (OPT(adult_randarts)) do_randart(seed_randart, TRUE);
                    }
                I tested it using ^zR then 035^aC and compared the artifacts created. They had different names and attributes. Both were weapons. If you do this, the borg needs to be in the dungeon, since artifacts are not created in town.
                St George Chiropractor
                Angband Borg Homepage

                Comment

                • s0be
                  Apprentice
                  • Jan 2008
                  • 96

                  Originally posted by APWhite
                  Fixed it today. I'll upload it later. It is an easy fix in borg9.c resurrect_borg(void).

                  Code:
                  #ifdef GJW_RANDART
                      /* Hack -- seed for random artifacts */
                      seed_randart = randint1(0x10000000);
                  
                      /* Randomize the artifacts */
                      if (adult_rand_artifacts)
                      {
                  		do_randart(seed_randart, TRUE);
                      }
                  #endif
                  Must be changed to:
                  Code:
                      /* Hack -- seed for random artifacts */
                      seed_randart = randint1(0x10000000);
                  
                      /* Randomize the artifacts */
                      if (OPT(adult_randarts)) do_randart(seed_randart, TRUE);
                      }
                  I tested it using ^zR then 035^aC and compared the artifacts created. They had different names and attributes. Both were weapons. If you do this, the borg needs to be in the dungeon, since artifacts are not created in town.
                  your borg_projectable function prototype changed, adding a fifth param (bool) which is causing compile failures.

                  Comment

                  • s0be
                    Apprentice
                    • Jan 2008
                    • 96

                    After fixing the compile error, the borg is bombing out with:

                    Code:
                    # Performing defence type 22 with value 10
                    # Aborting (normal abort).
                    # Removing keypress hook

                    Comment

                    • s0be
                      Apprentice
                      • Jan 2008
                      • 96

                      Originally posted by s0be
                      After fixing the compile error, the borg is bombing out with:

                      Code:
                      # Performing defence type 22 with value 10
                      # Aborting (normal abort).
                      # Removing keypress hook
                      This is not an 'always' failure, just in certain spots. Next time I find one, I'll exit out, snag the save file and post it (assuming it happens immediately after restartup still). In some cases, ^zz solves it, in most I have to move a square and do ^zz, and in one case (near a zoo) none of these worked.

                      Comment

                      • APWhite
                        Adept
                        • Jul 2007
                        • 244

                        Originally posted by s0be
                        This is not an 'always' failure, just in certain spots. Next time I find one, I'll exit out, snag the save file and post it (assuming it happens immediately after restartup still). In some cases, ^zz solves it, in most I have to move a square and do ^zz, and in one case (near a zoo) none of these worked.

                        Thanks, got the fix up. I added a few features and forgot to make a change back on that defense maneuver.
                        St George Chiropractor
                        Angband Borg Homepage

                        Comment

                        • s0be
                          Apprentice
                          • Jan 2008
                          • 96

                          Originally posted by APWhite
                          Thanks, got the fix up. I added a few features and forgot to make a change back on that defense maneuver.
                          I'm still seeing:

                          Code:
                          src/borg2.c:286:bool borg_projectable(int y1, int x1, int y2, int x2)
                          Code:
                          src/borg8.c:3819:			if (!borg_projectable(y, x, c_y, c_x, TRUE)) continue;
                          a difference in the borg_projectable function (only in borg8.c).

                          Comment

                          • s0be
                            Apprentice
                            • Jan 2008
                            • 96

                            Originally posted by s0be
                            I'm still seeing:

                            Code:
                            src/borg2.c:286:bool borg_projectable(int y1, int x1, int y2, int x2)
                            Code:
                            src/borg8.c:3819:			if (!borg_projectable(y, x, c_y, c_x, TRUE)) continue;
                            a difference in the borg_projectable function (only in borg8.c).
                            Ok, I see this is fixed, but I was having the Defence bomb again with type 22 (with value 10), I hacked the final return of the see invisible function from return 10 to return 0 and it's running, but I don't really know what the effective 'change' I made there does.

                            Comment

                            • APWhite
                              Adept
                              • Jul 2007
                              • 244

                              Originally posted by s0be
                              Ok, I see this is fixed, but I was having the Defence bomb again with type 22 (with value 10), I hacked the final return of the see invisible function from return 10 to return 0 and it's running, but I don't really know what the effective 'change' I made there does.
                              I saw another case of that this morning and fixed it. The update was put on the website. I keep running borgs who are at the right level to fail on this routine and I have not seen any more after this morning's fix.
                              St George Chiropractor
                              Angband Borg Homepage

                              Comment

                              • s0be
                                Apprentice
                                • Jan 2008
                                • 96

                                Originally posted by APWhite
                                I saw another case of that this morning and fixed it. The update was put on the website. I keep running borgs who are at the right level to fail on this routine and I have not seen any more after this morning's fix.
                                Thanks, updating. The borg is fun to watch.

                                Comment

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