Fsil, a simple sil fight simulator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kryft
    Rookie
    • Aug 2013
    • 20

    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.)
  • half
    Knight
    • Jan 2009
    • 910

    #2
    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...

    Comment

    • HallucinationMushroom
      Knight
      • Apr 2007
      • 785

      #3
      Originally posted by half
      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

      Comment

      • debo
        Veteran
        • Oct 2011
        • 2402

        #4
        Originally posted by half
        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.'

        Comment

        • Scatha
          Swordsman
          • Jan 2012
          • 414

          #5
          Originally posted by debo
          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).

          Comment

          • Nick
            Vanilla maintainer
            • Apr 2007
            • 9638

            #6
            Originally posted by debo
            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.

            Comment

            • Patashu
              Knight
              • Jan 2008
              • 528

              #7
              Originally posted by Nick
              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

              Comment

              • HugoVirtuoso
                Veteran
                • Jan 2012
                • 1237

                #8
                Originally posted by kryft
                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
                My best try at PosChengband 7.0.0's nightmare-mode on Angband.live:
                https://www.youtube.com/watch?v=rwAR0WOphUA

                If I'm offline I'm probably in the middle of maintaining Gentoo or something-Linux or other.

                As of February 18th, 2022, my YouTube username is MidgardVirtuoso

                Comment

                • kryft
                  Rookie
                  • Aug 2013
                  • 20

                  #9
                  Originally posted by Scatha
                  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!

                  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

                  Comment

                  • kryft
                    Rookie
                    • Aug 2013
                    • 20

                    #10
                    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.

                    Comment

                    • debo
                      Veteran
                      • Oct 2011
                      • 2402

                      #11
                      Originally posted by kryft
                      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.
                      You might want to check if they have blocking and decided to pass a turn before their chardump as well
                      Glaurung, Father of the Dragons says, 'You cannot avoid the ballyhack.'

                      Comment

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