What affects your ability to hit your enemy other than your enemy's attributes? Can you increase your ability to hit your enemy? Does it occur at level ups or with equipment or what? What exactly does STR affect?
Your chance to hit is based on your level, the monster's armor class, your strength, the "to hit" bonus on your weapon, any rings of dexterity that you might be wearing, and whether the creature is asleep or held (you get a +20% bonus in this case).
The
Rogue's Vade-Mecum (Latin for "walk with me", i.e., a walkthrough) says "When you attack a monster, your chance of hitting it is 5%, plus 5% times your experience level, plus 5% times the monster's armor class." So your two raise level potions ought to have added 10% to your hit chance. According to the vade-mecum, a troll's AC is 4, so, based on what you said (lvl 8 before drinking the potions, lvl 10 afterwards, no weapon enchantments), you should have gone from a 65% chance to hit the troll to a 75% chance after quaffing the potions. However, your hit chance might have been significantly decreased if your strength was low.
After having written the first draft of this post, I wasn't sure about the exact effect that strength had, so I took a look at the 5.4.4 source code and found the following in fight.c:
/*
* adjustments to hit probabilities due to strength
*/
static int str_plus[] = {
-7, -6, -5, -4, -3, -2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3,
};
/*
* adjustments to damage done due to strength
*/
static int add_dam[] = {
-7, -6, -5, -4, -3, -2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3,
3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6
};
If you don't read C, these are arrays of hit and dmg bonuses that are indexed using the character's strength (ranging from 0 to 31). Meaning that the first number in each list corresponds to str 0, the second number to str 1, and so on. As you can see, you take hit and dmg penalties if your str is 6 or below, and you get a hit bonus if it's 17 or higher and a dmg bonus if it's 16 or higher. The slightly good news is that there's code in another file that enforces a lower bound of strength 3, so the worst penalties from those arrays seem not to actually be in play.
Looking at the code that computes hits, it generates a virtual 20-sided die (d20) roll, modifies it based on the various factors that I mentioned above, and then determines if it was a hit. Since 1/20 = 5%, this is where the percentages in the formula in the vade-mecum come from. Each point of weapon and strength bonus/penalty adjusts the d20 roll, which means that it actually corresponds to a 5% increase or decrease in hit chance. So, e.g., the -4 for str 3 is actually -20%, a significant penalty. On the positive side, I think that your earlier post where you said
I am noticing that one common factor in my successful runs is my ability to maintain and increase STR for the damage bonuses or whatever it is STR does.
was right on the money. It also means that weapon enchantments are a pretty big deal.