1. ## Nerdy request

I hope it's ok to ask this here.

I'm working on an role playing game and I need help with a combat formula.

What formula would make all 3 of these statements true?

1) If attacker has Weapon Skill of 100 (maximum) and defender has Parry skill of 0 (minimum), then attacker has 100% chance of hitting defender.

2) If attacker has Weapon Skill of 0 (minimum) and defender has Parry skill of 100 (maximum), then attacker has 0% chance of hitting defender.

3) If Weapon Skill = Parry Skill, whether both 0 or both 100 (or anything in between) attacker has 50% chance of hitting defender.

So I need to be able to figure out the chance to hit for 0-100 vs 0-100
eg. attacker has a Weapon skill of 73 and the defender Parry skill of 29

2. Originally Posted by rpgnerd
I hope it's ok to ask this here.

I'm working on an role playing game and I need help with a combat formula.

What formula would make all 3 of these statements true?

1) If attacker has Weapon Skill of 100 (maximum) and defender has Parry skill of 0 (minimum), then attacker has 100% chance of hitting defender.

2) If attacker has Weapon Skill of 0 (minimum) and defender has Parry skill of 100 (maximum), then attacker has 0% chance of hitting defender.

3) If Weapon Skill = Parry Skill, whether both 0 or both 100 (or anything in between) attacker has 50% chance of hitting defender.

So I need to be able to figure out the chance to hit for 0-100 vs 0-100
eg. attacker has a Weapon skill of 73 and the defender Parry skill of 29
Will this do?

Chance of hitting = 50 + (Weapon - Parry)/2.

3. Originally Posted by JakeD
Will this do?

Chance of hitting = 50 + (Weapon - Parry)/2.
Thanks for the reply! but I'm not exactly sure if it does.

50 + (100 - 0) /2 = 75 (should be 100%)

50 + (0 - 100) /2 = -25 (should be 0%)

50 + (50-50) /2 = 25 (should be 50%)
50 + (21-21) /2 = 25 (should be 50%)
50 + (64-64) /2 = 25 (should be 50%)

Now, it looks like I could just add +25 to each result ...

50 + (73-29) /2 = 47 + 25 = 72% chance?

... and in the reverse situation when Parry is greater ...

50 + (29-73) /2 = 3 + 25 = 28% chance?

That could be correct but I'm not sure how to verify it.
And why am I adding +25 to your formula? Does that really "fix" it?
Is there a better way?

EDIT: 100 + (Weapon - Parry) /2 ?
EDIT AGAIN: No, that can't be right either. Or else 75 vs 0 ends up with 87.5% which makes no sense.

4. Originally Posted by rpgnerd
Thanks for the reply! but I'm not exactly sure if it does.

50 + (100 - 0) /2 = 75 (should be 100%)

50 + (0 - 100) /2 = -25 (should be 0%)

50 + (50-50) /2 = 25 (should be 50%)
50 + (21-21) /2 = 25 (should be 50%)
50 + (64-64) /2 = 25 (should be 50%)

Now, it looks like I could just add +25 to each result ...

50 + (73-29) /2 = 47 + 25 = 72% chance?

... and in the reverse situation when Parry is greater ...

50 + (29-73) /2 = 3 + 25 = 28% chance?

That could be correct but I'm not sure how to verify it.
And why am I adding +25 to your formula? Does that really "fix" it?
Is there a better way?

EDIT: 100 + (Weapon - Parry) /2 ?
EDIT AGAIN: No, that can't be right either. Or else 75 vs 0 ends up with 87.5% which makes no sense.
In

50 + (Weapon-Parry)/2

the parentheses mean (Weapon - Parry) is divided by 2, not the 50.

50 + (100 - 0)/2 = 50 + 50 = 100

50 + (0 - 100)/2 = 50 - 50 = 0

50 + (50 - 50)/2 = 50 - 0 = 50
50 + (21 - 21)/2 = 50 - 0 = 50
50 + (64 - 64)/2 = 50 - 0 = 50

5. Ahh, I see it now!