Skip to content

formula for attack rolls X+Y=Z

in combat, there is a calculation for an attack roll. X+Y=Z or sometime X-Y=Z

X = roll 1d20 (1 = miss, 20= crit hit)

but what are Y and Z ? and how does this compare to thac0 and ac?

apparently it varies in fight, changing between weapons, sometimes even situtational?

Comments

  • apeterssonapetersson Member Posts: 33
    for example i got a Y=+2 for my bow attack but Y=-6 when in meele range

    some examples for one fight lvl1 char against Karlat (read sheaf inn)

    backstab Katana got Y=+3 and it was a with 13+3=16 a hit
    regular meele attack got 17-1 = 16 and it was a miss.

    shortbow from range got 14+2=16 and it was a miss
    shortbow in meele range got 2-6=-4 (miss,duh)

    the enemy got Y=+0 but sometimes also Y=+4 (apparently when holding a bow)
  • mlnevesemlnevese Member, Moderator Posts: 10,214
    edited January 2013
    Nope the roll is as follows:

    THAC0-AC=number needed to hit

    So if you have a THAC0 of 15 and want to hit someone with AC 5, you need a 10 or better to hit. If your target has an AC of -5 you'd only hit on a 20.
  • apeterssonapetersson Member Posts: 33
    mlnevese said:


    THAC0-AC=number needed to hit

    that is correct but that is not what is displayed in the combat log. these numbers must mena something else but i have not figured it out.

  • MathmickMathmick Member Posts: 326
    Y is the combat modifiers and Z is the final roll.

    Don't ask what the modifers are and where THAC0 and enemy AC come into this. The fact that it isn't explained well is annoying.

    I think it should be X + Y - AC = Z, where AC is enemy AC and Z is compared against the attacker's THAC0. Y being for modifiers that don't directly affect THAC0 like ranged weapon in melee penalty like you said.
  • mlnevesemlnevese Member, Moderator Posts: 10,214
    What is displayed in the combat log is your roll + bonus that may be modified by strength bonus, dexterity bonus, weapon style, luck, spell effects, item enchantment, situational modifiers such as using a ranged weapon in melee, etc. This calculations is shortened to roll + sum of modifiers. After determining your final roll it goes on to display if you hit or not.
  • WilburWilbur Member Posts: 1,173
    Mathmick said:

    I think it should be X + Y - AC = Z, where AC is enemy AC and Z is compared against the attacker's THAC0. Y being for modifiers that don't directly affect THAC0 like ranged weapon in melee penalty like you said.

    This would work if you knew the enemy AC only after you had found the exact minimum you need to roll to hit (f.e. a roll of 7 is a miss and 8 is a hit). Otherwise the game would spoil you by telling the enemy's AC.

  • TJ_HookerTJ_Hooker Member Posts: 2,438
    edited January 2013
    Yeah, AFAIK it's:
    [d20] + [all modifiers] = attack roll (this step is what's actually shown ingame when you have the 'show to-hit rolls enabled)
    Then the enemy's AC is added to the attack roll. If the result is >= your base THAC0, you hit them. (this step is not shown ingame, other than the result, i.e. "Hit" or "Miss")
    Post edited by TJ_Hooker on
  • KaltzorKaltzor Member Posts: 1,050
    The basic attacking calculation is pretty much

    d20 + your hit modifiers (from proficiency, stats and magical weapons) + targets AC

    Then that gets compared to your THAC0, if it is above it, you hit.
  • apeterssonapetersson Member Posts: 33
    i appreciate your answers but i think you are mostly wrong so far.

    please walk me through these numbers exactly:

    CHARNAME level 1/1, (thief/illusionist, gnome, 1 point katana, 1 point shortbow)
    base thac0 20
    Katana to hit -1 (from strength 18)
    displayed thac0 19


    A) backstab meele Katana: got 13+3=16 a hit
    B) regular meele Katana: got 17-1 = 16 a miss.

    my thac0 is not 16, yet i did hit. furthermore A and B seem to contradict each other.
  • ReadingRamboReadingRambo Member Posts: 598

    i appreciate your answers but i think you are mostly wrong so far.

    please walk me through these numbers exactly:

    CHARNAME level 1/1, (thief/illusionist, gnome, 1 point katana, 1 point shortbow)
    base thac0 20
    Katana to hit -1 (from strength 18)
    displayed thac0 19


    A) backstab meele Katana: got 13+3=16 a hit
    B) regular meele Katana: got 17-1 = 16 a miss.

    my thac0 is not 16, yet i did hit. furthermore A and B seem to contradict each other.

    I think u are misunderstanding what thac0 is. It stands for "to hit armor class zero" meaning it doesn't mean if u roll a 16 it's a hit or less than 16 a miss (unless the enemy has an armor class of 0.)
  • [Deleted User][Deleted User] Posts: 0
    edited January 2013
    The user and all related content has been deleted.
  • reedmilfamreedmilfam Member Posts: 2,808
    Also I think that it's missing that the target loses DEX bonus to AC when being backstabbed.
  • bigdogchrisbigdogchris Member Posts: 1,336
    edited January 2013
    There are several modifiers to the attack roll and damage rolls that are not shown in the BG:EE info. This means your THAC0 and Damage shown on the character record may not be reflected as just that in game. You can have damage and THAC0 added or subtracted, but you don't see it.

    In BG2 you could "Show Combat Info" which shows you the exact formula. That feature has been commented out of BG:EE/ToB code. We're still waiting to see if they are going to allow us to enable it again.
  • apeterssonapetersson Member Posts: 33

    Also I think that it's missing that the target loses DEX bonus to AC when being backstabbed.

    that could be true. you also get a flat +4 bonus when attacking from stealth (not limited to backstabs)
  • BelgarathMTHBelgarathMTH Member Posts: 5,653
    edited January 2013


    please walk me through these numbers exactly:

    CHARNAME level 1/1, (thief/illusionist, gnome, 1 point katana, 1 point shortbow)
    base thac0 20
    Katana to hit -1 (from strength 18)
    displayed thac0 19


    A) backstab meele Katana: got 13+3=16 a hit
    B) regular meele Katana: got 17-1 = 16 a miss.

    my thac0 is not 16, yet i did hit. furthermore A and B seem to contradict each other.

    @apetersson, the first number is always your unadjusted diceroll. The second number is the sum of all modifiers. The third number is your adjusted dice roll. The hit or miss calculation is not seen.

    The computer is comparing your adjusted dice roll to the enemy's AC, and adjudicating hit or miss based on your adjusted diceroll.

    In your example B, you had a base -1 adjustment from your strength penalty for using a katana. In your example A you got a +4 bonus for attacking from stealth, minus your strength penalty, for a total of +3.

    Your enemy during example A also suffered an unseen penalty to his AC because he didn't see you (penalty to AC when attacked by a stealthed or invisible creature), so the 16 was enough to hit once all modifiers were taken into account.

    Your enemy during example B now knows you are there, since you didn't kill him, and now he has no penalties to AC. Further, you no longer have any bonuses to hit. Even though your adjusted roll is the same, your enemy has a high enough AC that your 16 is no longer high enough to hit.

    We don't have enough information in your examples to compute what his AC actually is. It could be almost anything, but if you are missing with 16's, it's probably pretty low (good.)

  • deltagodeltago Member Posts: 7,811
    Someone actually posted a screen shot with all of the modifiers previously, I just couldn't find it. Lets just say there is a lot.
  • apeterssonapetersson Member Posts: 33
    thanks for your explanation, that made sense.


    In your example B, you had a base -1 adjustment from your strength penalty for using a katana

    why do i get -1 penalty when using a katana? STR was 18 (without any %) so i should have a bonus of 1!

  • TJ_HookerTJ_Hooker Member Posts: 2,438
    edited January 2013

    In your example B, you had a base -1 adjustment from your strength penalty for using a katana. In your example A you got a +4 bonus for attacking from stealth, minus your strength penalty, for a total of +3.

    This isn't right, because he has a bonus from strength, not a penalty. Something that lowers your THAC0 raises your attack roll.

    Here's whats happening:
    In case a), you get +1 from strength, +4 from being stealthed. But Karlat is wearing chainmail, which has a bonus or 2 vs. slashing (so a penalty to your attack roll). So your net modifier is +3.
    in case b) your stealth bonus is gone, so your net modifier is -1.

    I still don't know how a modified attack roll of 16 hit the first time and missed the next. Are you sure that's what happened?

    Edit:

    Your enemy during example A also suffered an unseen penalty to his AC because he didn't see you (penalty to AC when attacked by a stealthed or invisible creature), so the 16 was enough to hit once all modifiers were taken into account.

    Your enemy during example B now knows you are there, since you didn't kill him, and now he has no penalties to AC. Further, you no longer have any bonuses to hit. Even though your adjusted roll is the same, your enemy has a high enough AC that your 16 is no longer high enough to hit.

    I don't think this is right either. AFAIK enemies don't suffer an AC penalty from being attacked by a hidden character, that character simply gains a +4 to attack, which is factored into the attack roll modifiers. I really don't know why a final roll of 16 would miss one time and miss the next.
  • TJ_HookerTJ_Hooker Member Posts: 2,438
    edited January 2013
    Ok, as far as I can tell using Near Infinity, Karlat should have an AC 1, with an extra -2 vs slashing (base AC of 5 from chainmail, +3 from 17 DEX, +1 from medium shield). With a THAC0 of 19, this would mean that you would need to roll a 16 to hit him if you're attacking from shadows, and otherwise would need to roll a 20 to hit him.
  • apeterssonapetersson Member Posts: 33
    really strange that the modifier from chainmail is applied unlike the regular armor class.

    so the final result is not actually checked against my thac0 but if the enemy has AC3 it is checked against my "THAC3" (which is lowered by 3)
    TJ_Hooker said:


    I still don't know how a modified attack roll of 16 hit the first time and missed the next. Are you sure that's what happened?

    I am 100% sure this was the log. i did not switch weapons and had no buffs running.
    i know that in Pnp 3e that dex armor bonus is not applied in these situations. is the same the case here?

  • TJ_HookerTJ_Hooker Member Posts: 2,438

    so the final result is not actually checked against my thac0 but if the enemy has AC3 it is checked against my "THAC3" (which is lowered by 3)

    Huh, I had never thought of it that way, but yeah I guess that'd be right.

    TJ_Hooker said:


    I still don't know how a modified attack roll of 16 hit the first time and missed the next. Are you sure that's what happened?

    I am 100% sure this was the log. i did not switch weapons and had no buffs running.
    i know that in Pnp 3e that dex armor bonus is not applied in these situations. is the same the case here?
    I don't think so. I don't know if 2E had the whole 'flat-footed' mechanic that 3E does, where you lose your dodge and dex bonuses to AC in certain situation where your character is caught off-guard, and I've certainly never heard of anything like that being implemented in BG. That being said, there's obviously something at play here that I don't understand, so who knows. Maybe @belgarathmth was right afterall, and enemies do suffer an AC penalty when attacked from stealth, on top of the attack bonus that the stealthed character gets.
  • apeterssonapetersson Member Posts: 33
    thanks for looking that up, i only have a vanilla BGEE and no extra tools like NI.
    TJ_Hooker said:

    you would need to roll a 16 to hit him if you're attacking from shadows

    do you mean a "natural" 16? then i should not have hit him.
    the most logical explanation would be the +3 from dex was not applied wich would bring down the needed roll from 16 to 13.

  • TJ_HookerTJ_Hooker Member Posts: 2,438

    thanks for looking that up, i only have a vanilla BGEE and no extra tools like NI.

    TJ_Hooker said:

    you would need to roll a 16 to hit him if you're attacking from shadows

    do you mean a "natural" 16? then i should not have hit him.
    the most logical explanation would be the +3 from dex was not applied wich would bring down the needed roll from 16 to 13.

    Yeah, I meant 16 on your unmodified d20 roll.
Sign In or Register to comment.