With Even Attack/Defence Roles
Melee (82 Slash Attack VS 82 Slash Defence W/Equal Attack/Defence Levels)
Test 1: 43/100 hits
Test 2: 48/100 hits
Test 3: 52/100 hits
Test 4: 49/100 hits
Test 5: 48/100 hits
So 240/500
Range (84 Range Attack VS 84 Range Defence W/Equal Attack/Defence Levels)
Test 1: 50/100
Test 2: 47/100
Test 3: 48/100
Test 4: 47/100
Test 5: 53/100
So 245/500
Magic (90 Magic Attack VS 90 Magic & 90 Defence, +64 attack bonus vs +64 defence bonus)
Test 1: 52/100
Test 2: 47/100
Test 3: 49/100
So 148/300
1 Role 50% bigger/smaller than the other
Melee/Range (Equal Attack VS Equal Defence, but 84 Attack/Range Vs 42 Defence )
Test 1: 65/100
Test 2: 68/100
Melee/Range (Equal Attack VS Equal Defence, but 21 Attack/Range Vs 42 Defence )
Test 1: 17/100
Test 2: 20/100
Magic (90 Magic Attack VS 90 Magic & 90 Defence, +64 attack bonus vs +32 defence bonus)
Test 1: 70/100
Conclusions:
- Range/Melee/Magic all use the same hitChance formula since results seem to be pretty much identical.
- When attack/defence roles are equal you're looking at a 50% hitchance (Which would kind of make sense anyway).
hitChance Formula
Assuming you are still using THIS FORMULA, this would achieve what the results seem to be showing:
I still don't understand what "return (hitChance *32.0)" is.If (accuracy > defence) {
hitChance = 1.0 - (defence * 0.5) / accuracy;
} else {
hitChance = (accuracy * 0.5) / defence
}
Extra:
Not saying these currently don't work correctly, this is just to check over and confirm they definitely are.
- Make sure your special attack modifiers are correct
- Make sure you're calculating magic defence role correctly
A = ((Defence Level*Prayer)+Stance) * 0.3 + (Magic Level * 0.7)
B = Equipment Bonus
Magic Defence Roll = A * (B+64)
Formulas I used for calculating attack/defence roles found Here