learning damage bonuses

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mangojuice
    Z+Angband Maintainer
    • Jun 2008
    • 318

    #16
    I was thinking about the mathematical problem behind this.

    Given K samples from a distribution that is, say, adb+n where n is unknown, but a and b are known, what can you learn about n?

    For weapons with 1 die, interestingly, it *only* matters what the maximum and minimum samples are. If you had your 1d10+n produce a bunch of samples in the range, say, 5 to 11, then that behavior is equally likely to come from 1d10+1 as from 1d10+4 or any value in between, no matter how many of the samples there are. The more samples you get the bigger the range is likely to be. For a 1dx + n weapon, it should take about 4(x-1) hits to have a 95% chance of having seen a full interval.

    For weapons with 2+ dice, it's trickier. You would learn n for sure when you have seen both extremes, but as has been mentioned, it can take a long time to generate both extremes. For 2d6, for instance, you expect to see both extremes after an average of about 72 hits.

    Here's a sample: let's say 2d6+n generated 9, 10, and 15 as its values. We know n >= 3, and n <= 7 for sure. For these particular rolls, the probabilistic estimate would be n ~= 4.6. But what if it was 9, 14, 15? Then the estimate would be n ~= 5.4. So internal values matter; actually, they matter a lot. Also, quantity matters: if the rolls were 9, 9, 10, 10, 15, 15, then things change; we get n ~= 4.4,

    Experimenting by hand, I found that with 25 samples for 2d6+n, the most likely n was the correct one about 5/6 of the time. But it was not that unusual to see wrong bonuses getting high percentages, if the rolls were higher or lower than normal. So 25 is probably not high enough, but it's too messy to work out all the way. And then 3 dice will be different, and 4 will be different again.
    -----------------------------------------
    Z+Angband: A Zangband evolution
    http://tinyurl.com/5pq2bd

    Comment

    • PowerDiver
      Prophet
      • Mar 2008
      • 2820

      #17
      Originally posted by Mangojuice
      I would say, for a xdy weapon, you should take about O(x y^1.5) hits, say, 1+(x*(y^1.5))/4 hits. My thinking is that if we aren't going to actually keep track of hits and really analyze them, we should recognize that the worst kind of dice to learn are ones like 1d20 (23 hits) since the distribution is flat; ones like 4d4 (9 hits) are much better since you are much more likely to be getting hits of average quality. This would be for a Warrior; a Mage might take 4 times as long.
      The leading term on the variance of xdy is x * y^2 / 12. That makes x * y^2 / 3 a reasonable cutoff for learning if all you do is to look at the average damage. However, for a 1dy weapon learning from average damage is pointless. What you want to do is look at (max - min) - (avg for die). The average time to hit both endpoints is 3 * y / 2, and it is half as much to hit endpoint or off by one on each end. Intelligent estimation combines both approaches.

      Your suggestion of 1 + x * y^1.5 /4 is an interesting way to combine them. 5 hits for a 1d4 and 9 for 4d4 seem like reasonable figures for estimating. It's overly pessimistic for 1d20, but maybe that is not a big deal. We still disagree, since I think these are reasonable for a mage and a fighter could learn faster, but we are getting closer together. Also, using exact damage rather health stars speeds up the learning a bit, so perhaps I should just give in to something along these lines.

      Should a high level warrior learn faster? Should things be set up so that a level 50 warrior learns the bonus on an 8d4 weapon in one hit instead of 9? I'm not complaining about learning in 9 hits, which is generous, but trying to get at the principle.

      I see you posted while I was composing this. Most of what I was talking about is getting > 50% confidence that the estimate is accurate. For 95% confidence that means more trials of course.
      Last edited by PowerDiver; December 6, 2008, 21:39.

      Comment

      • Big Al
        Swordsman
        • Apr 2007
        • 327

        #18
        I knew that the number 40 I threw out there was way too big - on purpose. I picked it because it would give a player a choice: either accept the (small) delay and let the computer tell you what the value is after some time, or figure it out yourself slightly faster. I also picked 40 because it seemed comparable to the arbitrary amount of time that it takes to pseudo-id stuff in the first place (at low levels).

        Note that for Eddie's strategy of guessing based on the number of stars a hit reduces to work, it requires the player to know (about) how many hitpoints the monsters start with. This information is only available to players who've killed enough monsters already [ if (kills > 304 / (4 + level)) for non-uniques].

        What do we do here for newly created savefiles? Do you base it on only monster memory, and new players never get to be shown the +to_dam automatically? Or do you spoil things and allow the game to know what the monster's health is?

        For that matter, once some kind of suitable solution to this +to_dam thing is found, you could do the opposite: change the monster memory code so that it uses stats to calculate the hit points of the monsters quicker than it is now, using stats.

        Exams are in full swing right now, so my time is kind of limited at the moment, but in a week or two I'll try to take a look at the code and see if I can come up with anything suitable.
        Come play Metroplexity!
        Un, V MX H- D c-- f- PV s- d+ P++ M+
        c-- S I++ So+ B+ ac- !GHB SQ RQ+ V+

        Comment

        • andrewdoull
          Unangband maintainer
          • Apr 2007
          • 872

          #19
          Originally posted by Nick
          In fact, and without thinking it through at all, my first reaction is that maybe magical ID could be removed altogether and replaced with this type of thing, which I guess is what UnAndrew has been trying to do all along. Hmmm.
          As usual I got here years ago (see object_usage() in info.c). However, it appears that I grossly overestimated the number of uses required to estimate weapon bonuses.

          For your edification, the estimates UnAngband currently uses:

          Code:
              /* Calculate object bonus */
              if (!object_bonus_p(o_ptr) && (o_ptr->usage > 30) && (o_ptr->usage % 30 == 0) && (rand_int(100) < 30))
              {
          
          /* Code to show object to hit/damage bonuses */
          
              }
              else if ((!o_ptr->feeling) && (!o_ptr->ident & (IDENT_SENSE)) && (o_ptr->usage > 5) && (o_ptr->usage % 5 == 0)
                  && (rand_int(100) < 30))
              {
          
          /* Code to sense the item feeling */
          
          }
          Big Al - feel free to change these to your more accurate estimates.

          Andrew
          The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
          In UnAngband, the level dives you.
          ASCII Dreams: http://roguelikedeveloper.blogspot.com
          Unangband: http://unangband.blogspot.com

          Comment

          • Nick
            Vanilla maintainer
            • Apr 2007
            • 9637

            #20
            Originally posted by andrewdoull
            As usual I got here years ago
            Yeah, yeah, rub it in. All us mere mortals are just playing catch-up.

            I don't think I'm going to go quite that far though - essentially for the reasons of style I talked about on your blog the other day. I'll probably start introducing this sort of stuff a bit at a time, and have a long term goal of phasing out ID if and when it seems like it will work.
            One for the Dark Lord on his dark throne
            In the Land of Mordor where the Shadows lie.

            Comment

            • PowerDiver
              Prophet
              • Mar 2008
              • 2820

              #21
              Originally posted by andrewdoull
              As usual I got here years ago
              Surely it would be simpler and equivalent to simply check randint(17) == 0 on every hit, or something like that.

              You go for a length of time totally clueless and then suddenly gain full info at random.

              I think this is the season for me to express my sentiment as "Bah humbug".

              Comment

              • Donald Jonker
                Knight
                • Jun 2008
                • 593

                #22
                Originally posted by PowerDiver
                I think this is the season for me to express my sentiment as "Bah humbug".
                -You there, boy. What day is it?
                -Why, sir, it's Christmas Day!
                -Then Father Christmas must have visited each and every house, leaving magical hammers and hats and boots and things, each present coming with a full manual instructing its proper use and fullest function!
                -Indeed, sir, he did! Why, I myself got a crutch of limping (+10, +15) (speed +3) this very morning, and knew just how it worked without trying!
                -That's a good lad. Now here's tuppence: go fetch me the biggest loaf of elvish waybread you can find. And if you make it back in 30 turns, I'll give you half a crown.
                -Half a crown! Half a crown!
                Bands, / Those funny little plans / That never work quite right.
                -Mercury Rev

                Comment

                • andrewdoull
                  Unangband maintainer
                  • Apr 2007
                  • 872

                  #23
                  Originally posted by PowerDiver
                  Surely it would be simpler and equivalent to simply check randint(17) == 0 on every hit, or something like that.
                  Probably - but not my style

                  You go for a length of time totally clueless and then suddenly gain full info at random.
                  In UnAngband, there are sense levels that indicate an approximate bonus range. {good} is +1 to +5, {very good} is +6 to +10 and {great} is +11 or higher (this is a simplification, of course).

                  Not quite what you're looking for, but not far off...

                  Andrew
                  The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
                  In UnAngband, the level dives you.
                  ASCII Dreams: http://roguelikedeveloper.blogspot.com
                  Unangband: http://unangband.blogspot.com

                  Comment

                  • vorondil
                    Apprentice
                    • Dec 2008
                    • 55

                    #24
                    Originally posted by Donald Jonker
                    -You there, boy. What day is it?
                    -Why, sir, it's Christmas Day!
                    -Then Father Christmas must have visited each and every house, leaving magical hammers and hats and boots and things, each present coming with a full manual instructing its proper use and fullest function!
                    -Indeed, sir, he did! Why, I myself got a crutch of limping (+10, +15) (speed +3) this very morning, and knew just how it worked without trying!
                    -That's a good lad. Now here's tuppence: go fetch me the biggest loaf of elvish waybread you can find. And if you make it back in 30 turns, I'll give you half a crown.
                    -Half a crown! Half a crown!
                    Well done, sir.
                    Now playing Abasorix, half-troll warrior in V-4.0.5.

                    Comment

                    • Tibarius
                      Swordsman
                      • Jun 2011
                      • 429

                      #25
                      ID

                      That's an interesting discussion about math probability and statistic. Now from a player point of view?

                      Why are all stats and powers not revealed at once - making ID obsolete?

                      ID requires money, so basically once my char is around level 15 i have enough money with me to buy scrolls / staves of ID. From that point on ID has no game relevance anymore and is just annoying.

                      This is not totally realistic, but hey, this is a game after all and should primary make the player enjoy it.

                      Cheers,
                      Tibarius
                      Blondes are more fun!

                      Comment

                      • fizzix
                        Prophet
                        • Aug 2009
                        • 3025

                        #26
                        Originally posted by Tibarius
                        That's an interesting discussion about math probability and statistic. Now from a player point of view?

                        Why are all stats and powers not revealed at once - making ID obsolete?

                        ID requires money, so basically once my char is around level 15 i have enough money with me to buy scrolls / staves of ID. From that point on ID has no game relevance anymore and is just annoying.

                        This is not totally realistic, but hey, this is a game after all and should primary make the player enjoy it.

                        Cheers,
                        Tibarius
                        Holy thread necromancy. Ok, let's go with it. The question remains, when should you reveal info. Here are some options, starting with the most cumbersome. This only applies to non-flavored items, and flavored items with pvals.

                        1: When you ID it.
                        2: When you notice the effect.
                        3: When you wield/use it.
                        4: When you pick it up.
                        5: When you see it.
                        6: When you detect it.

                        I would argue strongly for 5 or 6 after a certain character level. ?ID should be eliminated entirely. I can see an argument for 5 or 6, perhaps a higher level detection spell that's rogue only that allows full ID on detect.

                        For unknown flavors, I would argue for 3 regardless of whether you notice the effect. If you zap a wand of sleep monster and the monster doesn't fall asleep, you should learn what it is. Maybe you could make it have to hit some monster, so that there is some risk to firing haste/clone/heal monster. But the amount that these items add to the gameplay is so minimal, I don't even see this being interesting.

                        This also means that you don't need to poison yourself to learn !neutralize poison (something that's impossible for a kobold), or make yourself afraid to learn !boldness, or never be able to learn !restore mana if you're a warrior. You learn them when you drink the first one, effect or no.

                        Comment

                        • Max Stats
                          Swordsman
                          • Jun 2010
                          • 324

                          #27
                          Originally posted by fizzix
                          For unknown flavors, I would argue for 3 regardless of whether you notice the effect. If you zap a wand of sleep monster and the monster doesn't fall asleep, you should learn what it is. Maybe you could make it have to hit some monster, so that there is some risk to firing haste/clone/heal monster. But the amount that these items add to the gameplay is so minimal, I don't even see this being interesting.
                          Didn't it do this for awhile? I thought it used to say "The <whatever> looks drowsy for a moment" for sleep monster, and similar messages for most other items.

                          Originally posted by fizzix
                          This also means that you don't need to poison yourself to learn !neutralize poison (something that's impossible for a kobold), or make yourself afraid to learn !boldness, or never be able to learn !restore mana if you're a warrior. You learn them when you drink the first one, effect or no.
                          +1 to this. I enjoy ID by use very much, and potions like these are very tedious that way. If ID is ever removed entirely, this behavior will be necessary; otherwise the only alternative is to use shopkeepers to ID, which is impossible for ironman or no_stores players.
                          If beauty is in the eye of the beholder, then why are beholders so freaking ugly?

                          Comment

                          • fizzix
                            Prophet
                            • Aug 2009
                            • 3025

                            #28
                            Originally posted by Max Stats
                            +1 to this. I enjoy ID by use very much, and potions like these are very tedious that way. If ID is ever removed entirely, this behavior will be necessary; otherwise the only alternative is to use shopkeepers to ID, which is impossible for ironman or no_stores players.
                            I know the flavors, the only one that you might care about that's hard to ID is !Restore life level. I'll squelch potions immediately if they have no effect. (always make sure MP/HP is not full). But that's precisely the type of meta-gaming that we should avoid.

                            Comment

                            • buzzkill
                              Prophet
                              • May 2008
                              • 2939

                              #29
                              Let me counter by saying that I enjoy, well maybe not enjoy, but don't mind ID-by-use of potion, scrolls and even shrooms. I rarely sell to gain ID (or use ID) for that matter. OST, maybe I do enjoy it, cause I still IDBU mushrooms, even though I know it's a really bad idea.

                              ID by use as always been a staple of roguelikes. I'd hate to see it vanish in a variant as prevalent as V (and the seems too be the slope were slipping down).
                              www.mediafire.com/buzzkill - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
                              My banding life on Buzzkill's ladder.

                              Comment

                              • fizzix
                                Prophet
                                • Aug 2009
                                • 3025

                                #30
                                Originally posted by buzzkill
                                Let me counter by saying that I enjoy, well maybe not enjoy, but don't mind ID-by-use of potion, scrolls and even shrooms. I rarely sell to gain ID (or use ID) for that matter. OST, maybe I do enjoy it, cause I still IDBU mushrooms, even though I know it's a really bad idea.

                                ID by use as always been a staple of roguelikes. I'd hate to see it vanish in a variant as prevalent as V (and the seems too be the slope were slipping down).
                                Do you enjoy having to find a pit to determine whether the boots are feather fall, stability, or free action? Or finding a poltergeist so you can learn !boldness? The game right now has more ID by use than ever before, mainly this occurred because it's now safe to test-wield weapons/armor/jewelry and the potions of death/detonations have been removed. There are only a specific few abilities that are difficult to learn.

                                Comment

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