Quality squelching

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Magnate
    Angband Devteam member
    • May 2007
    • 5110

    #16
    Originally posted by Raggy
    I just tried the 22 jun nightly.

    New char -> random everything

    Noticing everything defaults to 'bad'
    Set Pointy Melee Weapons to -> good.
    Save options
    Save Game
    Restart
    Load savegame
    Check quality squelch settings.
    Everything now-> no squelch

    So its 2 bugs now, it doesn't save, and forgets the defaults.
    This isn't two bugs, and in fact it's an indication that the default "bad" set in squelch_init is being overwritten by some settings which are loaded in from somwhere.
    "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

    Comment

    • Derakon
      Prophet
      • Dec 2009
      • 9022

      #17
      Incidentally, I don't agree with default-squelching bad items, for one main reason: new players should discover squelching when they discover the 'k' command, not when they first identify a bad item and have it apparently irretrievably disappear.

      Comment

      • Magnate
        Angband Devteam member
        • May 2007
        • 5110

        #18
        Originally posted by Derakon
        Incidentally, I don't agree with default-squelching bad items, for one main reason: new players should discover squelching when they discover the 'k' command, not when they first identify a bad item and have it apparently irretrievably disappear.
        This is a fair point. I await takkaria's view.
        "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

        Comment

        • PowerDiver
          Prophet
          • Mar 2008
          • 2820

          #19
          Originally posted by Magnate
          This isn't two bugs, and in fact it's an indication that the default "bad" set in squelch_init is being overwritten by some settings which are loaded in from somwhere.
          I'd bet you are right, but there are at least two other possibilities.

          (1) Somehow the number of squelch qualities saved is not the same as the number loaded. In that case, the squelch code resets to nothing.

          (2) Something is overwriting memory with zeros, and the overflow goes into the squelch array.

          Comment

          • Raggy
            Apprentice
            • May 2011
            • 85

            #20
            Originally posted by PowerDiver
            Are any of you windows users capable of a little programming? There are a couple of things one could test to try to narrow down the problem. Anyone willing to try to debug could send me mail for specific suggestions.
            Yes I am....

            Comment

            • CunningGabe
              Swordsman
              • Feb 2008
              • 250

              #21
              I did a little debugging, and I think I've found the problem. I put in a debug message to show the value of squelch_size when saving the game, and for me, that came out to be 0. It's supposed to be the number of entries in the squelch menu. In line 102 of squelch.c, squelch_size is set to be TYPE_MAX, which is defined in squelch.h. For some reason, that seems to be silently converted to 0 on some platforms -- maybe there's some unintentional type conversion somewhere?

              Comment

              • fizzix
                Prophet
                • Aug 2009
                • 3025

                #22
                Originally posted by CunningGabe
                I did a little debugging, and I think I've found the problem. I put in a debug message to show the value of squelch_size when saving the game, and for me, that came out to be 0. It's supposed to be the number of entries in the squelch menu. In line 102 of squelch.c, squelch_size is set to be TYPE_MAX, which is defined in squelch.h. For some reason, that seems to be silently converted to 0 on some platforms -- maybe there's some unintentional type conversion somewhere?
                good work. I searched for a couple days for that bug and eventually gave up.

                Comment

                • PowerDiver
                  Prophet
                  • Mar 2008
                  • 2820

                  #23
                  Originally posted by CunningGabe
                  I did a little debugging, and I think I've found the problem. I put in a debug message to show the value of squelch_size when saving the game, and for me, that came out to be 0. It's supposed to be the number of entries in the squelch menu. In line 102 of squelch.c, squelch_size is set to be TYPE_MAX, which is defined in squelch.h. For some reason, that seems to be silently converted to 0 on some platforms -- maybe there's some unintentional type conversion somewhere?
                  The declaration of squelch_size in squelch.h is a variable definition rather than an extern. Thus, it creates a new variable initialized to 0 in each file that #includes squelch.h. Change const size_t squelch_size; to extern const size_t squelch_size; and I bet the problem will be fixed. Give it a try. I am surprised it normally works. I suppose a compiler could assume that an unitialized const ought to be an extern or the loader could combine multiple such produced in separate .o files. I am not knowledgable about what the standard says here.

                  This is yet another bug caused by copying data. I am a true believer in organizing code according to data, and it turns out that I submitted a fix years ago when I moved the code saving/loading the squelch table into squelch.c in part to eliminate the need for the variable squelch_size, but the heretics on the dev team follow some other religion.

                  Comment

                  • CunningGabe
                    Swordsman
                    • Feb 2008
                    • 250

                    #24
                    Originally posted by PowerDiver
                    The declaration of squelch_size in squelch.h is a variable definition rather than an extern. Thus, it creates a new variable initialized to 0 in each file that #includes squelch.h. Change const size_t squelch_size; to extern const size_t squelch_size; and I bet the problem will be fixed. Give it a try.
                    That worked all right! Good catch. I'll put in a pull request.

                    Comment

                    • jens
                      Swordsman
                      • Apr 2011
                      • 348

                      #25
                      I suggest a tweak on the default values for squelch.

                      Armours should not default to squelch bad.

                      When your worn armour gets damaged by acid it's set as squelch. No big problem so far. But when you start IDing new eq by wearing it you drop your damaged armour, and if your new armour is worse (e.g. you had on a 7,-1; you ID a 2, +1) you have to go through a whole little process to get that armour back. And the gain of starting of with all set to bad is quite negligible to start with. This only applies to armour though, so other items could still be set to squelch bad.

                      Comment

                      • Derakon
                        Prophet
                        • Dec 2009
                        • 9022

                        #26
                        I said in another thread that starting with squelch = bad is problematic to begin with. We don't want newbies to ID bad items and then have them suddenly and apparently irrevocably disappear from their inventories. Let them learn about squelch via the 'k' menu first.

                        Comment

                        • d_m
                          Angband Devteam member
                          • Aug 2008
                          • 1517

                          #27
                          Originally posted by Derakon
                          I said in another thread that starting with squelch = bad is problematic to begin with. We don't want newbies to ID bad items and then have them suddenly and apparently irrevocably disappear from their inventories. Let them learn about squelch via the 'k' menu first.
                          I think Magnate agreed that people should not start with squelch = bad
                          linux->xterm->screen->pmacs

                          Comment

                          • Magnate
                            Angband Devteam member
                            • May 2007
                            • 5110

                            #28
                            Originally posted by d_m
                            I think Magnate agreed that people should not start with squelch = bad
                            Yes, I'm going to revert this change in the next RC.
                            "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                            Comment

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