Monte Carlo Level Simulation

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

    #31
    Which is to be expected, frankly; the main bonus that uniques have to their drops is that they bypass the roll to see if the item is good (i.e. they can't drop average or cursed gear), which happens more or less automatically by 1000' or so anyway. Otherwise, they're vastly outnumbered by the normal monsters.

    Comment

    • fizzix
      Prophet
      • Aug 2009
      • 3025

      #32
      Originally posted by buzzkill
      That's cool but hard to read. The text cleanup will be nice. A quick glance, confirms what I've always thought. A vast majority of artifacts are dropped by everyday-in-depth-monsters, not uniques, not vaults.
      the monster total includes unique drops as well. However, the unique total *may* be inflated since each time a level is generated, no uniques have been killed yet. Something that's not true in an actual game. I have no way of getting around this.

      Comment

      • Magnate
        Angband Devteam member
        • May 2007
        • 5110

        #33
        Originally posted by fizzix
        the monster total includes unique drops as well. However, the unique total *may* be inflated since each time a level is generated, no uniques have been killed yet. Something that's not true in an actual game. I have no way of getting around this.
        Instead of generating individual levels, why not generate a whole dungeon, levels 1-100? Then if a unique is killed at level 23, it can't be generated again later.

        Without wishing to oversimplify things, is it much more than a 1-100 loop over the individual level generation?
        "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

        Comment

        • Estie
          Veteran
          • Apr 2008
          • 2346

          #34
          Originally posted by Magnate
          Instead of generating individual levels, why not generate a whole dungeon, levels 1-100? Then if a unique is killed at level 23, it can't be generated again later.

          Without wishing to oversimplify things, is it much more than a 1-100 loop over the individual level generation?
          And while youre at it, if an artifact has been dropped at level 23, it can't be generated again later.

          Comment

          • fizzix
            Prophet
            • Aug 2009
            • 3025

            #35
            I'll think about how to do a 1-100 simulation result. In the meantime, I have a fairly completed version up on git. I ran a 5000 iterations per level sim (takes about 5 minutes) for a standarts case, and the results are included here.

            Everything is in expected value/level.

            My sim found the one ring 0.92% of the time at dlevel 100 and at no shallower levels.
            Attached Files

            Comment

            • fizzix
              Prophet
              • Aug 2009
              • 3025

              #36
              Hmm, it seems a messed up the gold, and forgot to include prayer/spell books. I guess there's still some more work to be done.

              @magnate: I thought about your cycling through the levels, an I think I can implement it with some (relatively) minor changes. There are two possibilities:

              1: change all the data storage elements to arrays (there are a lot of them)
              2: Open and rewrite the log file. (is this slow? requires some code that I'm not sure how to do...yet)

              Both also need stuff to keep artifacts lost and uniques dead (easy) and a reset of all the artifacts to available when we go back to dlevel 1 (probably easy?)

              I'm leaning towards approach 2...but with either approach I don't think I'll get to it this week... (I will try to fix the gold problem and add spell books though.)

              edit: fixed gold and added books during lunch break. Included a new randart sim.
              Attached Files
              Last edited by fizzix; December 13, 2010, 19:40.

              Comment

              • Magnate
                Angband Devteam member
                • May 2007
                • 5110

                #37
                Originally posted by fizzix
                Hmm, it seems a messed up the gold, and forgot to include prayer/spell books. I guess there's still some more work to be done.

                @magnate: I thought about your cycling through the levels, an I think I can implement it with some (relatively) minor changes. There are two possibilities:

                1: change all the data storage elements to arrays (there are a lot of them)
                2: Open and rewrite the log file. (is this slow? requires some code that I'm not sure how to do...yet)

                Both also need stuff to keep artifacts lost and uniques dead (easy) and a reset of all the artifacts to available when we go back to dlevel 1 (probably easy?)

                I'm leaning towards approach 2...but with either approach I don't think I'll get to it this week... (I will try to fix the gold problem and add spell books though.)

                edit: fixed gold and added books during lunch break. Included a new randart sim.
                Cool. I would seriously recommend #1 over #2 - 100-element arrays are easy to deal with and far quicker than opening and closing files. Yes, artifact tracking is easy: use a_ptr->created, and just cycle through the artifacts setting it back to 0 between each sim.
                "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                Comment

                • fizzix
                  Prophet
                  • Aug 2009
                  • 3025

                  #38
                  Originally posted by Magnate
                  Cool. I would seriously recommend #1 over #2 - 100-element arrays are easy to deal with and far quicker than opening and closing files. Yes, artifact tracking is easy: use a_ptr->created, and just cycle through the artifacts setting it back to 0 between each sim.
                  Finished.

                  Unfortunately, the output file now has 100 levels instead of one and I cannot attach it here because of size constraints.

                  I'll write some basic post-processing routines soon. Probably tomorrow, too tired tonight... I actually planned to *play* some angband...that sure didn't happen.

                  Comment

                  • fizzix
                    Prophet
                    • Aug 2009
                    • 3025

                    #39
                    btw 1000 iterations without randart regenning takes 4 minutes and 45 seconds on my laptop.

                    Comment

                    • fizzix
                      Prophet
                      • Aug 2009
                      • 3025

                      #40
                      added an option to regen randarts after each sim. I truly didn't trust Magnate that it was going to be as slow as it is. Damn.

                      50 iterations took 15 s without randart regen and 285 seconds with randart regen. That's almost 20 times longer!

                      Also fixed a couple bugs and pushed to git. Probably won't be doing any serious work on this for a while. Although I don't consider tracking new items to be serious work. That can be done in about 2-3 minutes.
                      Last edited by fizzix; December 15, 2010, 22:43.

                      Comment

                      • fizzix
                        Prophet
                        • Aug 2009
                        • 3025

                        #41
                        Similar to what I posted in the stat-swap thread. Here are the same results for various other resists. (assuming standart set) I can generate this fairly easily for any other res/ability/effect anyone might be curious about.
                        Attached Files

                        Comment

                        • fizzix
                          Prophet
                          • Aug 2009
                          • 3025

                          #42
                          More stats:

                          For a standart game, clearing each level once yields a total artifact count of approximately 70.

                          For randarts, the amount seems to be around 60 or 61. So it looks like standarts are about 16% more common than randarts.

                          Comment

                          • ewert
                            Knight
                            • Jul 2009
                            • 702

                            #43
                            I think that is well within range of being caused by standarts being a spread out artifact type list (most base types have an artifact, increasing chances), and randarts can have "blanks" in base types.

                            Comment

                            • PowerDiver
                              Prophet
                              • Mar 2008
                              • 2820

                              #44
                              Originally posted by ewert
                              I think that is well within range of being caused by standarts being a spread out artifact type list (most base types have an artifact, increasing chances), and randarts can have "blanks" in base types.
                              That's a second order effect. I doubt it is noticeable. The way to think of it is to assume you pick the base, and then ask for the probability that after you create one artifact, if you tried again the very next try would produce the other one. Even if there are 20 more such pairs in randarts vs standarts, unless the chances to produce the randarts are over 1/20 on a single try [which seems excessive] that still comes to less than 1 a game on average.

                              You guys complaining about too many randarts before the last change may have forgotten how many standarts are typically produced.

                              Comment

                              • fizzix
                                Prophet
                                • Aug 2009
                                • 3025

                                #45
                                Originally posted by ewert
                                I think that is well within range of being caused by standarts being a spread out artifact type list (most base types have an artifact, increasing chances), and randarts can have "blanks" in base types.
                                I'm not sure the reasoning, or whether it needs "fixing". It is what it is though. The counts seem pretty steady, I'm guessing a standard deviation of less than 5. I may work on actually calculating a std dev later, both for the artifact counts, and for the first level that objects occur on.

                                Probably won't get to this today though. Sorry d_m.

                                Comment

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