![]() |
#1 |
Knight
Join Date: Apr 2009
Location: Pisa / DL0
Posts: 963
![]() |
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. -- You read a scroll labeled 'lol gtfo' of Teleport Level. |
![]() |
![]() |
![]() |
#2 |
Knight
Join Date: Jan 2009
Posts: 904
![]() |
This is fascinating. I'd be interested in somehow incorporating this into the game (perhaps as a cheat/debug feature, perhaps something else).
|
![]() |
![]() |
![]() |
#3 |
Knight
Join Date: Jan 2013
Posts: 710
![]() |
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.
|
![]() |
![]() |
![]() |
#4 | |
Knight
Join Date: Apr 2009
Location: Pisa / DL0
Posts: 963
![]() |
Quote:
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. -- You read a scroll labeled 'lol gtfo' of Teleport Level. |
|
![]() |
![]() |
![]() |
#5 | |
Knight
Join Date: Apr 2009
Location: Pisa / DL0
Posts: 963
![]() |
Quote:
__________________
Dive fast, die young, leave a high-CHA corpse. -- You read a scroll labeled 'lol gtfo' of Teleport Level. |
|
![]() |
![]() |
![]() |
#6 |
Knight
Join Date: Jan 2009
Posts: 904
![]() |
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. |
![]() |
![]() |
![]() |
#7 |
Rookie
Join Date: Aug 2013
Posts: 20
![]() |
Wow! I bet Sil is the only roguelike with two simulators written for it.
![]() 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 at 14:13. |
![]() |
![]() |
![]() |
#8 |
Veteran
Join Date: Oct 2011
Location: Toronto, Canada
Posts: 2,386
![]() |
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.' |
![]() |
![]() |
![]() |
#9 | |
Rookie
Join Date: Aug 2013
Posts: 20
![]() |
Quote:
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! |
|
![]() |
![]() |
![]() |
#10 |
Rookie
Join Date: Aug 2013
Posts: 20
![]() |
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hit probability calculation | Ycombinator | Vanilla | 8 | May 28, 2010 00:11 |
Crafting-focused Angband mod under development | Optimality | Variants | 49 | November 25, 2009 02:06 |
Question regarding good/great probability | ChodTheWacko | Vanilla | 4 | October 3, 2008 20:28 |
Feature request: mod for birth_no_artifacts | bron | Vanilla | 7 | May 25, 2008 10:16 |
Probability of using Rods of Teleport Other? | Dragonboneman | Vanilla | 9 | February 7, 2008 20:55 |