Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Sil

Reply
 
Thread Tools Display Modes
Old November 14, 2013, 23:45   #1
fph
Knight
 
Join Date: Apr 2009
Location: Pisa / DL0
Posts: 896
fph is on a distinguished road
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.
fph is offline   Reply With Quote
Old November 15, 2013, 09:44   #2
half
Knight
 
half's Avatar
 
Join Date: Jan 2009
Posts: 904
half is on a distinguished road
This is fascinating. I'd be interested in somehow incorporating this into the game (perhaps as a cheat/debug feature, perhaps something else).
half is offline   Reply With Quote
Old November 15, 2013, 10:25   #3
taptap
Knight
 
Join Date: Jan 2013
Posts: 710
taptap is on a distinguished road
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.
taptap is offline   Reply With Quote
Old November 15, 2013, 11:27   #4
fph
Knight
 
Join Date: Apr 2009
Location: Pisa / DL0
Posts: 896
fph is on a distinguished road
Quote:
Originally Posted by half View Post
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.
--
You read a scroll labeled 'lol gtfo' of Teleport Level.
fph is offline   Reply With Quote
Old November 15, 2013, 11:30   #5
fph
Knight
 
Join Date: Apr 2009
Location: Pisa / DL0
Posts: 896
fph is on a distinguished road
Quote:
Originally Posted by taptap View Post
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.
--
You read a scroll labeled 'lol gtfo' of Teleport Level.
fph is offline   Reply With Quote
Old November 15, 2013, 12:52   #6
half
Knight
 
half's Avatar
 
Join Date: Jan 2009
Posts: 904
half is on a distinguished road
Quote:
Originally Posted by fph View Post
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.
half is offline   Reply With Quote
Old November 15, 2013, 12:55   #7
kryft
Rookie
 
Join Date: Aug 2013
Posts: 20
kryft is on a distinguished road
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 at 13:13.
kryft is offline   Reply With Quote
Old November 15, 2013, 12:57   #8
debo
Veteran
 
debo's Avatar
 
Join Date: Oct 2011
Location: Toronto, Canada
Posts: 2,385
debo is on a distinguished road
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.'
debo is offline   Reply With Quote
Old November 15, 2013, 13:07   #9
kryft
Rookie
 
Join Date: Aug 2013
Posts: 20
kryft is on a distinguished road
Quote:
Originally Posted by half View Post
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!
kryft is offline   Reply With Quote
Old November 15, 2013, 13:10   #10
kryft
Rookie
 
Join Date: Aug 2013
Posts: 20
kryft is on a distinguished road
Quote:
Originally Posted by debo View Post
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!
kryft is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hit probability calculation Ycombinator Vanilla 8 May 27, 2010 23:11
Crafting-focused Angband mod under development Optimality Variants 49 November 25, 2009 01:06
Question regarding good/great probability ChodTheWacko Vanilla 4 October 3, 2008 19:28
Feature request: mod for birth_no_artifacts bron Vanilla 7 May 25, 2008 09:16
Probability of using Rods of Teleport Other? Dragonboneman Vanilla 9 February 7, 2008 19:55


All times are GMT +1. The time now is 19:29.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.