Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Sil

Reply
 
Thread Tools Display Modes
Old September 3, 2013, 11:34   #1
kryft
Rookie
 
Join Date: Aug 2013
Posts: 20
kryft is on a distinguished road
Fsil, a simple sil fight simulator

I just published the repository for Fsil, a little tool I've been writing for fun (and because I like to obsess about weapon and ability choices). Bug reports or other suggestions are welcome; it should be usable, but it's unpolished and hardly exhaustively tested.

From the README:

"Fsil is a simple fight simulator for the roguelike Sil (see
http://www.amirrorclear.net/flowers/game/sil/index.html). Apart from
wanting to get a bit of practical Haskell experience (this is my first actual
program) and play with the probability monad, I wrote Fsil to help answer
questions like the following:

-Should my character use this weapon or that? Two-handed or shield?
-Should I take subtlety?
-How risky is it for me to fight this monster in one-on-one combat?
-What are my odds of oneshotting this sleeping monster?

Fsil takes a Sil 1.1.1 character dump file and the name of a monster, and
computes approximate probability distributions for a few quantities:

-The amount of damage that the player deals to the monster in a single round
(both in terms of absolute damage and as a percentage of the monster's
maximum hitpoints)
-The number of extra damage dice that the player gets from critical hits
-The amount of damage that the monster deals to the player in a single blow"

Currently you need to compile it from source (quite easy; the README has instructions), but I could compile binaries for Windows and OS X if someone wants to play with this without having to install the haskell platform.

Here's some sample output pitting one of my former characters (the dump is included in the fsil repository) against a sleeping young cold-drake:

Code:
./Fsil -a sleeping --meleebonus 5 kryft.txt 'Young cold' > nan.txt

kryft vs Young cold-drake
Player dark resistance: 1
Player singing: Quiet
Monster alertness: Sleeping
Player sees monster: True
Damage dealt by monster: mean [4.775098,5.3398952], standard deviation [6.0640154,8.930798]
Probability of dealing at least x damage:
0 1.000
1 0.517
2 0.494
3 0.462
4 0.434
5 0.403
6 0.368
7 0.334
8 0.297
9 0.262
10 0.229
11 0.194
12 0.165
13 0.136
14 0.112
15 0.091
16 0.072
17 0.056
18 0.042
19 0.032
20 0.023
21 0.016
22 0.012
23 0.009
24 0.005
25 0.004
26 0.003
27 0.002
28 0.001

0 1.000
1 0.362
2 0.353
3 0.342
4 0.328
5 0.316
6 0.305
7 0.290
8 0.275
9 0.259
10 0.244
11 0.229
12 0.215
13 0.201
14 0.182
15 0.168
16 0.151
17 0.137
18 0.125
19 0.112
20 0.100
21 0.090
22 0.080
23 0.069
24 0.061
25 0.053
26 0.046
27 0.039
28 0.034
29 0.028
30 0.024
31 0.021
32 0.018
33 0.015
34 0.013
35 0.011
36 0.009
37 0.008
38 0.006
39 0.005
40 0.004
41 0.003
42 0.002
43 0.002
44 0.002
45 0.001
46 0.001


Damage dealt by player: mean 18.54437, standard deviation 6.2824564
Probability of getting at least n critical hits:
2 1.000
3 0.974
4 0.832
5 0.574
6 0.265
7 0.071


Probability of dealing at least X% (of max hp) damage:
0 1.000
10 0.974
20 0.732
30 0.300
40 0.061
50 0.005

Probability of dealing at least x damage:
0 1.000
1 1.000
2 0.999
3 0.998
4 0.996
5 0.992
6 0.988
7 0.980
8 0.970
9 0.952
10 0.931
11 0.900
12 0.866
13 0.824
14 0.779
15 0.728
16 0.673
17 0.615
18 0.550
19 0.491
20 0.431
21 0.373
22 0.315
23 0.263
24 0.217
25 0.177
26 0.140
27 0.110
28 0.084
29 0.061
30 0.044
31 0.032
32 0.023
33 0.016
34 0.011
35 0.006
36 0.004
37 0.002
38 0.001
The first two tables are for the cold drake's two different attacks (bite and claw I think).

I gave my character a melee bonus of +5 to simulate Focused Attack. It's clear I'm nowhere near one-shotting, but I would deal a decent chunk of damage and probably get a Cruel Blow (come to think of it, I'll probably add 'probability of cruel blow' in the near future; it's not that hard to eyeball based on the number of crits, but it's annoying to look up monster will.) If I were actually considering this I would probably rerun Fsil without the '-a sleeping' flag and using the great sword in my inventory to see how much damage I can expect to deal/take once the drake wakes up. (Unfortunately this would currently require switching weapons in-game and making a different character dump.)
kryft is offline   Reply With Quote
Old September 3, 2013, 12:49   #2
half
Knight
 
half's Avatar
 
Join Date: Jan 2009
Posts: 910
half is on a distinguished road
Wow, that is amazing attention to detail in the game, and an answer to that question of how would you play Sil differently if your life depending on winning with this character.

Still, I can't help but be disappointed that this is not a "simple sil flight simulator" as I first thought...
half is offline   Reply With Quote
Old September 3, 2013, 12:58   #3
HallucinationMushroom
Knight
 
HallucinationMushroom's Avatar
 
Join Date: Apr 2007
Location: Indiana, U.S.A.
Age: 45
Posts: 784
HallucinationMushroom is on a distinguished road
Quote:
Originally Posted by half View Post
Still, I can't help but be disappointed that this is not a "simple sil flight simulator" as I first thought...
That is exactly what I read too. I was looking forward to some keyboard overlays and how-to-Immelman in Sil.
__________________
You are on something strange
HallucinationMushroom is offline   Reply With Quote
Old September 3, 2013, 13:07   #4
debo
Veteran
 
debo's Avatar
 
Join Date: Oct 2011
Location: Toronto, Canada
Posts: 2,401
debo is on a distinguished road
Quote:
Originally Posted by half View Post
Still, I can't help but be disappointed that this is not a "simple sil flight simulator" as I first thought...
That was originally what fsil was going to be, but I reminded kryft that Eärendil and his flying ship didn't come along until after the silmaril had been recaptured. Kryft ended up changing fsil to a fight simulator for 'flavor' reasons.
__________________
Glaurung, Father of the Dragons says, 'You cannot avoid the ballyhack.'
debo is offline   Reply With Quote
Old September 3, 2013, 15:27   #5
Scatha
Swordsman
 
Join Date: Jan 2012
Posts: 414
Scatha is on a distinguished road
Quote:
Originally Posted by debo View Post
That was originally what fsil was going to be, but I reminded kryft that Eärendil and his flying ship didn't come along until after the silmaril had been recaptured. Kryft ended up changing fsil to a fight simulator for 'flavor' reasons.
I laughed.

More seriously, thanks for this, kryft. It looks a very useful tool. I had a crude approximation to something similar in an excel spreadsheet when we were balancing the numbers on different weapons (and to a lesser extent balancing the different enemies; using something like fsil would let you do a better job there, although we now have enough play data that we can mostly make sensible adjustments manually).
Scatha is offline   Reply With Quote
Old September 3, 2013, 21:51   #6
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 58
Posts: 9,560
Donated: $60
Nick will become famous soon enoughNick will become famous soon enough
Quote:
Originally Posted by debo View Post
That was originally what fsil was going to be, but I reminded kryft that Eärendil and his flying ship didn't come along until after the silmaril had been recaptured. Kryft ended up changing fsil to a fight simulator for 'flavor' reasons.
It's an opportunity for a whole new game - guide Eärendil across Middle Earth fast enough to reach the battle and slay Ancalagon, who is at a depth of -1000ft. Or maybe cut his wings off.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old September 3, 2013, 23:49   #7
Patashu
Knight
 
Patashu's Avatar
 
Join Date: Jan 2008
Posts: 528
Patashu is on a distinguished road
Quote:
Originally Posted by Nick View Post
It's an opportunity for a whole new game - guide Eärendil across Middle Earth fast enough to reach the battle and slay Ancalagon, who is at a depth of -1000ft. Or maybe cut his wings off.
I would play this game forever
__________________
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu
Patashu is offline   Reply With Quote
Old September 4, 2013, 00:30   #8
HugoVirtuoso
Veteran
 
HugoVirtuoso's Avatar
 
Join Date: Jan 2012
Location: Linux
Age: 40
Posts: 1,237
HugoVirtuoso is on a distinguished road
Quote:
Originally Posted by kryft View Post
Currently you need to compile it from source (quite easy; the README has instructions), but I could compile binaries for Windows and OS X if someone wants to play with this without having to install the haskell platform.
YES! Please compile binaries for Windows and OS X! Not everyone is Compiler-savvy. I really want to test this out, and see how my powerhouse melee tactics pan out in specific situations
HugoVirtuoso is offline   Reply With Quote
Old September 5, 2013, 12:49   #9
kryft
Rookie
 
Join Date: Aug 2013
Posts: 20
kryft is on a distinguished road
Quote:
Originally Posted by Scatha View Post
More seriously, thanks for this, kryft. It looks a very useful tool. I had a crude approximation to something similar in an excel spreadsheet when we were balancing the numbers on different weapons (and to a lesser extent balancing the different enemies; using something like fsil would let you do a better job there, although we now have enough play data that we can mostly make sensible adjustments manually).
Yes, I'm sure people who know the game well have a pretty good feel for numbers and balance in any case. This was mostly a fun project (this is how I party) for me to practice haskell on and to a lesser extent (that's what I tell myself) a palliative for my own agonizing over weapon and ability decisions. Of course if someone to happens to find it useful, all the better!

Quote:
Originally Posted by HugoTheGreat2011
YES! Please compile binaries for Windows and OS X! Not everyone is Compiler-savvy. I really want to test this out, and see how my powerhouse melee tactics pan out in specific situations
You can download a binary for windows here or for OS X here. I hope the binaries work on whatever computer you try them on; the only windows and OS X computers I have access to at the moment are the ones I compiled these on.

Incidentally, I added calculations for the chance of inflicting confusion via Cruel Blow. I also tried to make the output slightly more readable in general. For the kryft vs cold-drake example above, the cruel blow part of the output would be

Code:
Probability of inflicting at least n turns of confusion with Cruel Blow:
0 1.000
1 0.793
2 0.793
3 0.791
4 0.740
5 0.546
6 0.256
7 0.066
kryft is offline   Reply With Quote
Old September 6, 2013, 13:09   #10
kryft
Rookie
 
Join Date: Aug 2013
Posts: 20
kryft is on a distinguished road
I added support for Heavy Armour Use. (Unfortunately I haven't updated the binaries above yet.) As armor weight isn't listed in a character dump, this relies on a hack where the HAU bonus is inferred from the protection range listed in "Armor [+X, Y-Z]". The protection bonuses for individual equipment pieces are listed, as is (effectively) the size of any bonus from Hardiness, so whatever remains must be the bonus from HAU, if the player has the ability. That is assuming that the player isn't singing Staying when creating the dump; I should probably have mentioned somewhere that one should stop singing before creating a dump for fsil and use the --singing option to get song effects properly taken into account.

I'm considering adding support for averaging certain quantities (mainly mean damage taken/inflicted) over several monsters, and to that end I also added a depth stat for monsters. Thus one could, say, compare two different armors against all the monsters below some depth to get a very rough idea of how they compare overall. (Quite possibly too rough to be meaningful, but it's trivial to add.)

Incidentally, I won't have access to a computer until the 15th, so in the unlikely event that someone else tries fsil, any bugs will have to wait.
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
Really Want To Fight Ancestors tuppe666 Vanilla 26 February 18, 2011 22:28
Most anticlimactic fight ever Ycombinator AAR 11 September 8, 2010 10:36
How to fight AMHD pits Rizwan AAR 1 June 4, 2010 16:53
Simple question An Fear Glas Vanilla 2 December 20, 2008 03:10
Fight AMHD with Green DSM or Chain Mail of Resistance? roustk AAR 4 March 8, 2008 01:41


All times are GMT +1. The time now is 13:15.


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