Sil mod: probability to die

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fph
    Veteran
    • Apr 2009
    • 1030

    Sil mod: probability to die

    I have written a small modification to Sil in which after every attack, trap or probability that the player takes damage the following two things are computed:
    1 - distribution of the dealt damage (as in: probability of taking $n$ damage points for each $n$)
    2 - probability of being dead as a result of all the risks taken during the game, in millimort (https://en.wikipedia.org/wiki/Micromort). 1000 millimort equals probability 1 of being dead (note that they cannot be simply added).

    I think it's interesting because it quantifies exactly how many risks you are taking. By being aware that the last turn raised your probability of dying to from 0.05 to 0.1, you can be more conscious and avoid taking the same action, even if it does not immediately result in death.
    This allows also to compare risk-taking and playing style: for instance, at which level does your mortality score normally leave its original value of 0?

    The odds are written on stdout for now; probably I should work on a better display, but this is just a proof-of-concept for now.
    I encourage you to try it and tell me your opinions. I'd be happy to know that the added knowledge makes you more attentive to risks and tradeoffs.

    You can download the source from https://github.com/fph/mortsil/archive/master.zip, or browse the repo at https://github.com/fph/mortsil. It is based on the current version 1.1.1 of Sil.
    There is no Windows executable as I only develop on Linux and I have no Windows toolchain abailable; I'd be happy if one of the Windows users could compile a Windows version.

    Some technical details:

    I check for damage probabilities after every action that can damage the player (attack, trap, and so on). Of course it's impossible to quantify longer-term probabilities, such as the probability of being confused by a brown mold and thrown into a pack of white wolves that just came down the stairs. So the probabilities are underestimated a bit, but I think they are still reasonable and indicative. The only situation when I don't find this very realistic is when a big breather could decide to breathe or not at the next turn. I'm working on doing something better in this case.

    Probabilities are not simulated with a Montecarlo approach, they are computed exactly. Some care is taken to avoid instabilities and rounding errors. This is not always trivial; for instance, we need expm1().

    I did this for Sil because I think the damage-dealing system is slightly easier to handle. If this is interesting, I can consider porting it to vanilla and/or other variants.

    The code will probably contain lots of bug -- don't depend on it for anything mission-critical such as running a nuclear power plant (a use case in which Sil normally shines instead).
    --
    Dive fast, die young, leave a high-CHA corpse.
  • half
    Knight
    • Jan 2009
    • 910

    #2
    This is fascinating. I'd be interested in somehow incorporating this into the game (perhaps as a cheat/debug feature, perhaps something else).

    Comment

    • taptap
      Knight
      • Jan 2013
      • 710

      #3
      It is fascinating that this seems to make perfect sense in Sil, but I fail to understand how this is supposed to work in real life. Good enough for an insurance company for sure, but that wine can be calculated into an uniform liver cirrhosis risk equal for the first glass and the last is almost certainly bogus.

      Comment

      • fph
        Veteran
        • Apr 2009
        • 1030

        #4
        Originally posted by half
        This is fascinating. I'd be interested in somehow incorporating this into the game (perhaps as a cheat/debug feature, perhaps something else).
        I'd love to see it included, too. I can easily provide a diff/patch file that you can apply to the Sil source.

        There are some opportunities for refactoring the existing code while including this part; for instance, in Sil there are
        * a function that makes a protection roll and returns the result
        * two functions that compute min and max protection (for displaying)
        I added
        * a function that computes the probability distribution of the protection roll.
        The four are independent, but probably they should be merged not to duplicate the logic. I can work on it and similar issues.
        --
        Dive fast, die young, leave a high-CHA corpse.

        Comment

        • fph
          Veteran
          • Apr 2009
          • 1030

          #5
          Originally posted by taptap
          It is fascinating that this seems to make perfect sense in Sil, but I fail to understand how this is supposed to work in real life. Good enough for an insurance company for sure, but that wine can be calculated into an uniform liver cirrhosis risk equal for the first glass and the last is almost certainly bogus.
          I totally agree. For this project "millimort" is just a fancy name for "take the probability of dying and multiply it by 1000"; I am very skeptical that this measure works also as a quantitative tool in real life.
          --
          Dive fast, die young, leave a high-CHA corpse.

          Comment

          • half
            Knight
            • Jan 2009
            • 910

            #6
            Originally posted by fph
            I can work on it and similar issues.
            That would be great.

            Maybe there should be some extra character sheet for people who want additional stats such as:

            1) Real time spent in the game (with pauses between turns capped at 1 minute to avoid counting times when you are away from the computer)

            2) Missed artefacts.

            3) This milimort thing.

            4) Possibly some other things, like the probability that the blow that killed you was going to kill you.

            My thinking is that these are all things that I wouldn't want in the standard game -- the first two because they can be frustrating. However, they are pretty cool for the people who do want them. I could thus bury them a bit in the options or something.

            Comment

            • kryft
              Rookie
              • Aug 2013
              • 20

              #7
              Wow! I bet Sil is the only roguelike with two simulators written for it. It would certainly be interesting to see this included in the game.

              Originally I also computed exact distributions instead of sampling, but I ran into some Haskell-specific performance issues that I couldn't solve due to my inexperience with the language.
              Last edited by kryft; November 15, 2013, 14:13.

              Comment

              • debo
                Veteran
                • Oct 2011
                • 2402

                #8
                I already added 2) to mpa-sil for deathdumps, but I don't think it should be in the core game either. Maybe if it was some sort of spoilers file you could generate on death (I think Vanilla does this?)
                Glaurung, Father of the Dragons says, 'You cannot avoid the ballyhack.'

                Comment

                • kryft
                  Rookie
                  • Aug 2013
                  • 20

                  #9
                  Originally posted by half
                  That would be great.

                  Maybe there should be some extra character sheet for people who want additional stats such as:

                  1) Real time spent in the game (with pauses between turns capped at 1 minute to avoid counting times when you are away from the computer)

                  2) Missed artefacts.

                  3) This milimort thing.

                  4) Possibly some other things, like the probability that the blow that killed you was going to kill you.

                  My thinking is that these are all things that I wouldn't want in the standard game -- the first two because they can be frustrating. However, they are pretty cool for the people who do want them. I could thus bury them a bit in the options or something.
                  One small detail that I've been thinking of is that for fsil it would be nice if item weights were listed on char dumps. Currently it's impossible to determine the protection bonus from Heavy Armour Use without resorting to a silly hack, and even the hack won't help if you want to know how the bonus changes if you wear some other armor or how large the bonus would be for a character who doesn't have the ability yet. (The hack is to look at the listed maximum protection and subtract all other contributions to protection, which can be determined.)

                  I didn't request this before because it felt silly to ask you to clutter your char dumps to make my pedantic simulations easier, but perhaps this too could be buried in the options somewhere. I suppose I could even try to write a patch for this myself if that helps. I do understand if you don't want to do this anyway!

                  Comment

                  • kryft
                    Rookie
                    • Aug 2013
                    • 20

                    #10
                    Originally posted by debo
                    I already added 2) to mpa-sil for deathdumps, but I don't think it should be in the core game either.
                    It would be a great way to troll people who hate forced descent, though!

                    Comment

                    • HallucinationMushroom
                      Knight
                      • Apr 2007
                      • 785

                      #11
                      I love this idea. Too bad I have Winblows. I would dearly love to see my risk%, and to see just how high the risk could go, while still winning ~~ the opposite intention of the risk calculator... haha. If anybody fixes it for Windows, please let me know.

                      After posting on these forums and ladders for 7 or 8 years or so, it has become clear that I am of the 1% of you that cannot code. I have zero idea how these games work.

                      As an aside about the clutter comment... I would love to see skill point distributions on the character notes. It has abilities, yes, but it would be even more enlightening to see actual progression.
                      You are on something strange

                      Comment

                      • kryft
                        Rookie
                        • Aug 2013
                        • 20

                        #12
                        After posting on these forums and ladders for 7 or 8 years or so, it has become clear that I am of the 1% of you that cannot code. I have zero idea how these games work.
                        It's never too late to learn. It's fun!

                        As an aside about the clutter comment... I would love to see skill point distributions on the character notes. It has abilities, yes, but it would be even more enlightening to see actual progression.
                        I also think this would be nice.

                        Comment

                        • bio_hazard
                          Knight
                          • Dec 2008
                          • 649

                          #13
                          Originally posted by HallucinationMushroom
                          As an aside about the clutter comment... I would love to see skill point distributions on the character notes. It has abilities, yes, but it would be even more enlightening to see actual progression.
                          Thirding this.

                          Comment

                          • half
                            Knight
                            • Jan 2009
                            • 910

                            #14
                            Originally posted by HallucinationMushroom
                            I would love to see skill point distributions on the character notes. It has abilities, yes, but it would be even more enlightening to see actual progression.
                            Any idea of how to format this so it is readable? e.g. mock up the first 500 ft of a character's skill progression in a format you'd like.

                            Comment

                            • HallucinationMushroom
                              Knight
                              • Apr 2007
                              • 785

                              #15
                              Code:
                              ... Because AbsoluteGo's Notes are hilarious...
                              (And because he was top of recent submissions...)
                              
                              The biggest question would be how to display
                               initial points and instances where multiple skill points are taken at once, I guess. 
                              This is my first idea on what I would like to see. 
                              
                              Turn          Depth         Note
                              0,001          50 ft         6 will **
                              0,001          50 ft         5 evasion **
                              0,001          50 ft         4 melee **
                              0,473         100 ft         1 evasion **
                              0,843         150 ft         (Power)
                              1,880         200 ft         mmmm
                              1,950         200 ft         2 will **
                              2,072         200 ft         mmmm
                              2,752         200 ft         Encountered Gorgol, the Butcher
                              3,021         200 ft         Slew Gorgol, the Butcher
                              3,167         200 ft         mmm
                              3,676         250 ft         mmm i guess i want to use that
                              3,678         250 ft         1 melee **
                              3,678         250 ft         1 evasion **
                              
                              and so on
                              Last edited by HallucinationMushroom; November 15, 2013, 18:42.
                              You are on something strange

                              Comment

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