Monster to-hit calculation question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MattB
    Veteran
    • Mar 2013
    • 1214

    Monster to-hit calculation question

    Having had my 8th, and best, Dismas killed by Nick (the Mummy) in the current competition, I figured the game was trying to tell me something and decided to retire (Dis)gracefully and return to my Slapper dynasty (no weapons). But it is a bit soul-destroying so I have decided to alternate with a Streaker dynasty who runs around butt-naked (no armour at all).

    I reckon that, with AC of practically zero, I need to avoid monsters that hit rarely, but for massive damage. But how does the monster to-hit calculation work? Do they all have the same chance to hit @ at a given AC? There doesn't seem to be anything in monster.txt or monster_base.txt. Or am I being daft, as usual?
  • Timo Pietilä
    Prophet
    • Apr 2007
    • 4096

    #2
    Originally posted by MattB
    I reckon that, with AC of practically zero, I need to avoid monsters that hit rarely, but for massive damage. But how does the monster to-hit calculation work? Do they all have the same chance to hit @ at a given AC? There doesn't seem to be anything in monster.txt or monster_base.txt. Or am I being daft, as usual?
    I'm guessing monster depth (level) affects that calc. No idea if that is the case though.

    Comment

    • takkaria
      Veteran
      • Apr 2007
      • 1951

      #3
      Originally posted by MattB
      Having had my 8th, and best, Dismas killed by Nick (the Mummy) in the current competition, I figured the game was trying to tell me something and decided to retire (Dis)gracefully and return to my Slapper dynasty (no weapons). But it is a bit soul-destroying so I have decided to alternate with a Streaker dynasty who runs around butt-naked (no armour at all).

      I reckon that, with AC of practically zero, I need to avoid monsters that hit rarely, but for massive damage. But how does the monster to-hit calculation work? Do they all have the same chance to hit @ at a given AC? There doesn't seem to be anything in monster.txt or monster_base.txt. Or am I being daft, as usual?
      The calculation is kind of gross.

      There’s always 12% chance of hitting, 5% chance of missing.

      Otherwise:

      Chance = power + (monster race native dungeon level*3)
      Chance is never lower than 9

      Powers can be found in this list:
      A free, single-player roguelike dungeon exploration game - File not found angband/angband


      X = roll 1d(chance)

      If x-1 >= (ac * 2/3), it hits
      If x-1 < (ac * 2/3), it fails
      takkaria whispers something about options. -more-

      Comment

      • MattB
        Veteran
        • Mar 2013
        • 1214

        #4
        Originally posted by takkaria
        The calculation is kind of gross.
        Oh, I don't know.
        That actually looks dangerously close to elegant!

        So, if I've got it right, Morgoth's shatter attack rolls a d360, which gives him a 5 in 6 chance of hitting @ with AC 90?

        Well, apart from the '-1' in the calculation. What's that for?

        Thanks for the reply, Takkaria.

        Comment

        • takkaria
          Veteran
          • Apr 2007
          • 1951

          #5
          Originally posted by MattB
          Oh, I don't know.
          That actually looks dangerously close to elegant!

          So, if I've got it right, Morgoth's shatter attack rolls a d360, which gives him a 5 in 6 chance of hitting @ with AC 90?

          Well, apart from the '-1' in the calculation. What's that for?
          It seems gross to me because it's hard to work out % or fractional chances in your head. Multiplying AC by 2/3 is annoying, too.

          The -1 is because in the code, the final calculation is based on randint0(chance), which makes a random number from 0 to (chance-1). We don't have convenient notation for that, but we do have 1dx, so it made sense to write it like that and take the 1 off later.
          takkaria whispers something about options. -more-

          Comment

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