Sort brands by damage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Derakon
    Prophet
    • Dec 2009
    • 9022

    Sort brands by damage

    Just a random suggestion: when viewing damage for a weapon, sort the listing by how much damage is dealt, and combine entries where the damage output is the same. E.g. this is the current output from an awesome randart pike I just found:

    Average damage/round: 448.5 vs. evil, 550.5 vs. demons, 550.5 vs. trolls, 550.5 vs. creatures not resistant to electricity, 550.5 vs. creatures not resistant to poison, 753.5 vs. undead, and 347 vs. others.

    It'd be cleaner like this:

    Average damage/round: 753.5 vs. undead, 550.5 vs. demons, trolls, creatures not resistant to electricity, and creatures not resistant to poison, 448.5 vs. evil, and 347 vs. others.

    This would help emphasize that the best brand is chosen when possible, and would generally be less redundant. Obviously it's pretty minor though.
  • Magnate
    Angband Devteam member
    • May 2007
    • 5110

    #2
    It's one of those fixes that's quite a lot of work for a definite but very modest gain. If someone sends a patch that works, it'll go straight into the nightlies - but it might be a while before the dev team get to it, since the current situation isn't terribly broken. Just sayin'.

    (I say quite a lot of work because I am really bad at handling text in C, but maybe it's less difficult than I think?)
    "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

      #3
      I guess the braindead way to handle it is via multiple passes through the list of valid slays. First you go through and print all the x5 slays, then all the x3, then all the x2. Because we only have a limited number of slay types and even more limited number of slay multipliers, this kind of approach works well without actually having to sort anything.

      Maybe I'll take a look at this this evening, see if I can come up with something. No guarantees though.

      Comment

      • Magnate
        Angband Devteam member
        • May 2007
        • 5110

        #4
        Originally posted by Derakon
        I guess the braindead way to handle it is via multiple passes through the list of valid slays. First you go through and print all the x5 slays, then all the x3, then all the x2. Because we only have a limited number of slay types and even more limited number of slay multipliers, this kind of approach works well without actually having to sort anything.

        Maybe I'll take a look at this this evening, see if I can come up with something. No guarantees though.
        I think I'd want to do this without assuming that the mults are x5/3/2 ... probably counting a loop down from best_s_ptr->mult to 2. With a call to list_slays inside the loop, it might not be too much hassle. Damn you, you've got me thinking about it now!
        "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

          #5
          Well yes, clearly you'd want to have an enumeration of slay multipliers somewhere if there isn't one already. Magic numbers are (almost always) bad. I wrote it out explicitly not to say that the program would be written that way, but rather that that would be the set of steps it ends up executing...if that makes sense at all.

          Comment

          • Ycombinator
            Adept
            • Apr 2010
            • 156

            #6
            Here, try this patch: http://trac.rephial.org/ticket/1386

            Implemented by sorting brands list first, then formatting adjacent items with the same multiplier. Some gruesome conditional expressions inside, but hey, that's C after all.

            Comment

            • Timo Pietilä
              Prophet
              • Apr 2007
              • 4096

              #7
              Originally posted by Derakon
              It'd be cleaner like this:

              Average damage/round: 753.5 vs. undead, 550.5 vs. demons, trolls, creatures not resistant to electricity, and creatures not resistant to poison, 448.5 vs. evil, and 347 vs. others.
              Wording suggestion:

              Average damage/round: 753.5 vs. undead, 550.5 vs. demons, trolls, creatures not resistant to electricity or poison, 448.5 vs. evil, and 347 vs. others

              More brands:
              "...to acid, electricity, fire, cold, or poison..." (BTW, game uses word "lightning" in place of "electricity" in resists.)

              Comment

              • Magnate
                Angband Devteam member
                • May 2007
                • 5110

                #8
                Originally posted by Ycombinator
                Here, try this patch: http://trac.rephial.org/ticket/1386

                Implemented by sorting brands list first, then formatting adjacent items with the same multiplier. Some gruesome conditional expressions inside, but hey, that's C after all.
                Excellent, thank you - I'll take a look tonight.
                "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                Comment

                • Ycombinator
                  Adept
                  • Apr 2010
                  • 156

                  #9
                  Originally posted by Timo Pietilä
                  Wording suggestion:

                  Average damage/round: 753.5 vs. undead, 550.5 vs. demons, trolls, creatures not resistant to electricity or poison, 448.5 vs. evil, and 347 vs. others

                  More brands:
                  "...to acid, electricity, fire, cold, or poison..." (BTW, game uses word "lightning" in place of "electricity" in resists.)
                  Good idea, but element names in resists and brand descriptions are different (electricity and lightning, fire and flames, cold and frost, poison and venom). So we can either unify them, at least in weapons descriptions (I am not so well versed in English to tell if there is any semantic difference), or introduce another column in the slays table. I can provide a patch for either solution, but I doubt it's worth the hassle.

                  Comment

                  • Derakon
                    Prophet
                    • Dec 2009
                    • 9022

                    #10
                    I purposefully didn't unify the brand descriptions because it would be easier to implement without doing so, and it doesn't make that big a difference. It would be more nicely-formatted though, I have to admit.

                    Thanks for making the patch, Ycombinator! I'll have to give it a shot this evening.

                    Comment

                    • myshkin
                      Angband Devteam member
                      • Apr 2007
                      • 334

                      #11
                      Originally posted by Timo Pietilä
                      Wording suggestion:

                      Average damage/round: 753.5 vs. undead, 550.5 vs. demons, trolls, creatures not resistant to electricity or poison, 448.5 vs. evil, and 347 vs. others

                      More brands:
                      "...to acid, electricity, fire, cold, or poison..." (BTW, game uses word "lightning" in place of "electricity" in resists.)
                      The tricky part is that a player could read that as "550.5 against creatures who lack both electricity resistance and poison resistance." Possibly we want something like "creatures susceptible to electricity or poison," except that that wording may get confusing if we add vulnerabilities.

                      Comment

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