Saturday, November 6, 2010

It has been to long: Chance to hit formulas

I realize that I have not been keeping up with updating this blog. A big part of that is that I am doing NaNoWriMo this months and the pages upon pages of writing have been going into that. Also, I have realized that what I really need to do is less public brainstorming and more privately designed and complete document so that I can put together some instructions for a BCP.

I have however created chance to hit formulas. This chance to hit formula will calculate both the chance to hit and the amount of damage "absorbed" by armor in one roll.

Some back ground first. Characters will have two relevant attributes when it comes to hitting and dealing damage. One attribute will be the damage multiplier and the other will be the attribute that affects the attack rating. The attack rating itself will be mathematically derived number that affects the chance to hit. What affects each of these will depend on the weapon used or the type of spell:
Projectile Spell = INT(attack rating); WIL(damage multiplier)
Mellee Weapon = DEX(attack rating); STR(Damage multiplier)
Ranged Weapon = DEX (attack rating): PRC(Damage Multiplier)


As mentioned in another blog the amount of damage is simply the base damage of weapon/spell (1-4 points) multiplied by the attribute. So if a character is striking with "rusty dagger" (1-2 base points) and has a STR of 9, then the range of damage is 9-18.

Now, the attack rating is also depended on an attribute. I don't know how that will be derived yet. I do think the average attack rating for a level one character should be about 10 and should double every ten levels, just like armor. Note, that I'm tied to the number 10, it can be 100 at level one, just as long as it doubles about every 10 levels. Additionally, the attack rating should be approximently equal to the average "heavy leather" armor rating. This is the second highest armor rating, with metal armor, on average, exceeding attack ratings.

If anyone has any ideas, please let me know.

The actual formula works like this. In order for a character to hit, there must be calculated a "full hit minimum" (FHM) number. The number will be within the range of 0-100, although it can exceed 100 in certain circumstances. It will be calculated according to this formula:
FHM == {[0.8a + (a-d) + (la-ld)]/a} * 100
a = attack rating
d = defender's armor
l = level of attacker and defender


If the defender and attacker have equivalent levels, and the attack rating and armor rating are the same, than the FHM == 80. Compare that to a random number 1-100. If the random number >= 80, than calculate full damage (base damage * damage multiplier.

Note, this is a pretty high bar. An attacker fighting an evenly matched defender, the attacker will deal full damage only 1 out of every 5 strikes. However, this is Full hit minimum. If the attacker is below the mininum he will not deal no damage, but will deal less damage:
If RND(1-100) is less than FHM by .1-10.0 then calculated damage * 80% ("partial hit")
If RND(1-100) is less than FHM by 10.1-20.0 then calculated damage * 60% ("weak hit")
If RND(1-100) is less than FHM by 20.1-30.0 then calculated damage * 40% ("glancing blow")
If RND(1-100) is less than FHM by 30.1-40.0 then calculate damage * 20% ("near miss")
If RND(1-100) is less than FHM by 40.1 or or more then calculate no damage ("complete miss")


So in combat between evenly matched characters, damage will be dealt to the defender about 60 percent of time (excluding calculations for evasion/blocking), and most of those hits will not be full 100% damage. In this way, the comparison between the armor rating and attack rating will cover both chance to hit and damage absorbed by armor. There will be no need have a separate formula for damage absorption.

An important question at this point is will players like hiting only 60% of the time, or will this generate more frustration than challenge? How often should players expect to hit an evenly matched opponent?

I plan to soon make a flow chart that will include evasion, block, critical hit, and so forth. Assuming that programmers like flow charts. :-)

No comments:

Post a Comment