Fractional blows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ewert
    Knight
    • Jul 2009
    • 702

    #31
    Originally posted by PowerDiver
    Chars with high dex and low str will prefer lighter weapons with my formula. My question is why would you want high-str low-dex rogues to use light weapons?

    If you want to emphasize that starting rogues use light weapons, give them a significant str penalty. OTOH, I thought a main complaint in recent years has been the unreasonable superiority of light weapons to heavy weapons, so going out of your way to keep that seems misguided to me.
    I think you misunderstood it a bit, not saying high str low dex rogues would want to use light weapons, but with the above formula I posted you can adjust the "weight mod" ratio for both str and dex based energy/blow and so can tweak the ratio of str/weight and dex/weight independently. It's just that you can lower the dex-weight-mod, and thus give for example rogues more benefit from dex than other classes, while having same benefit from str, etc.

    Anyways, we are getting too complex I think. Now with github, we can all do our own versions!

    Comment

    • Magnate
      Angband Devteam member
      • May 2007
      • 5110

      #32
      Originally posted by ewert
      I think you misunderstood it a bit, not saying high str low dex rogues would want to use light weapons, but with the above formula I posted you can adjust the "weight mod" ratio for both str and dex based energy/blow and so can tweak the ratio of str/weight and dex/weight independently. It's just that you can lower the dex-weight-mod, and thus give for example rogues more benefit from dex than other classes, while having same benefit from str, etc.

      Anyways, we are getting too complex I think. Now with github, we can all do our own versions!
      So then we get people to vote on them ... ;-)

      The changes I made introduced a wrapper function for py_attack which sorts out how many blows are actually taken at a time - it currently stops when the target dies or when the next blow would take your total energy cost over 100. What this means is that the calculation of epb is totally separate from the actual handling of attacks, so anyone can code any epb calculation they like, drop it in to calc_blows and see how the result plays.

      I am convinced that blows_table needs to go, and be replaced with a formula.

      I am also convinced that the formula needs to make light weapons get more blows with dex and heavy weapons get more blows with str. There is some code in the O/S/FA codebase that does this, which I intend to look at and compare with Eddie's formula.

      I agree with Eddie's suggestion that the max blows with light weapons ought to me significantly more, but also that this can't happen without O-combat (or at least a similarly significant change to the damage output calculation). In the meantime I think the formula should make full use of the range of epb from 100 all the way down to 16 or 15.

      I do think it is appropriate that nobody gets max blows with an MoD.

      Eddie: how do I implement a sqrt using integer arithmetic?
      "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

        #33
        Originally posted by Magnate
        Eddie: how do I implement a sqrt using integer arithmetic?
        For the duration of this post, my name is Eddie.

        I found this link which shows a pretty simple-looking method to calculate square roots using integer operations, one bit at a time.

        Or you could, y'know, just use floating-point math, just this once. Nobody will mind.

        Comment

        • Magnate
          Angband Devteam member
          • May 2007
          • 5110

          #34
          Originally posted by Derakon
          For the duration of this post, my name is Eddie.

          I found this link which shows a pretty simple-looking method to calculate square roots using integer operations, one bit at a time.

          Or you could, y'know, just use floating-point math, just this once. Nobody will mind.
          Heretic!!!

          (It would be easier to use a lookup table - but I'm wondering whether the formula needs a sqrt at all ...)
          "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

            #35
            Originally posted by Magnate
            Eddie: how do I implement a sqrt using integer arithmetic?
            It should already be in the codebase for the improved distance function. At worst, d_m put it in and took it out and you can find that in the update history.

            Basically, forget any complicated method you ever learned in calculus or whatever. If you can formulate your problem as finding a root of an equation, and you can produce one point with a positive value and another with a negative value, you just do binary search, reducing the [neg,pos] range by a factor of 2 with each iteration until you reach the limits of your precision. This always seems to be more efficient than any smart and fancy approach that uses properties of the function.

            Comment

            • PowerDiver
              Prophet
              • Mar 2008
              • 2820

              #36
              Originally posted by Magnate
              (It would be easier to use a lookup table - but I'm wondering whether the formula needs a sqrt at all ...)
              The problem is the escalating weights of weapons.

              If you want to have a scale that looks at f(str)/g(weight) you should be able to see pretty quickly that f should be superlinear and g should be sublinear. Otherwise, you get silly things like STR 8 being enough for max blows with a dagger. Even if you thought that ought to be true for some strange physical reason, it would screw up gameplay too much.

              The standard first suspects for superlinear and sublinear are squaring and sqrt, and they seemed ok so I didn't look any further. The constants were all completely arbitrary, just an attempt to get kind of close to current behavior.

              Comment

              • Atarlost
                Swordsman
                • Apr 2007
                • 441

                #37
                Try log. There's a really easy integer algorithm for base 2 log.
                One Ring to rule them all. One Ring to bind them.
                One Ring to bring them all and in the darkness interrupt the movie.

                Comment

                • PowerDiver
                  Prophet
                  • Mar 2008
                  • 2820

                  #38
                  Originally posted by Atarlost
                  Try log. There's a really easy integer algorithm for base 2 log.
                  Don't you think that's too flat? Even sqrt may be too flat.

                  Comment

                  • fizzix
                    Prophet
                    • Aug 2009
                    • 3025

                    #39
                    Originally posted by PowerDiver
                    Don't you think that's too flat? Even sqrt may be too flat.
                    base 2 log is not that much different than square root up to 30 or so. That being said, I don't know why you would really prefer one over the other except for ease of coding

                    Comment

                    • PowerDiver
                      Prophet
                      • Mar 2008
                      • 2820

                      #40
                      Originally posted by fizzix
                      base 2 log is not that much different than square root up to 30 or so. That being said, I don't know why you would really prefer one over the other except for ease of coding
                      Well 45 lbs is an important case, but your point still makes sense. If you are insanely gung-ho about integer arithmetic, I think the difference comes down to accuracy. It's easier to get more bits with sqrt. It's also easier since someone else coded it for distance functions already.

                      Comment

                      • ewert
                        Knight
                        • Jul 2009
                        • 702

                        #41
                        Magnate, did you do something real funky with priest/mage blows? =P Can't melee attack on starting priest or mage class characters ... iVanilla yes, but AFAICR have not myself touched melee attacks at all...

                        Comment

                        • takkaria
                          Veteran
                          • Apr 2007
                          • 1951

                          #42
                          Originally posted by ewert
                          Magnate, did you do something real funky with priest/mage blows? =P Can't melee attack on starting priest or mage class characters ... iVanilla yes, but AFAICR have not myself touched melee attacks at all...
                          Known bug and fixed in staging, will appear in the nightlies RSN (c.f. https://github.com/angband/angband/c...23eb783650d55b)
                          takkaria whispers something about options. -more-

                          Comment

                          • Magnate
                            Angband Devteam member
                            • May 2007
                            • 5110

                            #43
                            Originally posted by takkaria
                            Known bug and fixed in staging, will appear in the nightlies RSN (c.f. https://github.com/angband/angband/c...23eb783650d55b)
                            Sorry ewert - off-by-one error, my usual problem. If your epb is exactly 100 it won't let you attack! As takk says, this has been fixed and should be in nightlies as of tonight.
                            "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                            Comment

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