C++ code--> combat calculation bug
Posted: Sun Sep 02, 2007 5:59 pm
Uox3 formula to hit is:
(Attacker's weapon skill + 50) / ((defender's weapon skill + 50) * 2)
Running an excel sheet with an attacker at 100, defender at 85, and a different attacker at 81 skill with the same defender,
I should get a hit distribution of:
Attacker 1 to hit: 55% Defender to hit: 45%
Attacker 2 to hit: 49% Defender to hit: 51%
Fairly even distributions; however, in practice it seems skewed in favor of the higher skill quite a bit.
This could just be "random chance" as 50% could go either way, but is there a chance via JS to print the "to hit" rolls?
For example have the console print out the hit roll of each attack (attacker and defender alike) vs. the DC (as calculated by the formula):
Hit Roll: 75 DC: 55
This would be a fairly simple way to debug, as I'm assuming the hit roll is just a random # from 1-100 compared to the DC calculated by the formula. If you get a hit or a miss when it should be different, you know we need to track down a bug.
(Attacker's weapon skill + 50) / ((defender's weapon skill + 50) * 2)
Running an excel sheet with an attacker at 100, defender at 85, and a different attacker at 81 skill with the same defender,
I should get a hit distribution of:
Attacker 1 to hit: 55% Defender to hit: 45%
Attacker 2 to hit: 49% Defender to hit: 51%
Fairly even distributions; however, in practice it seems skewed in favor of the higher skill quite a bit.
This could just be "random chance" as 50% could go either way, but is there a chance via JS to print the "to hit" rolls?
For example have the console print out the hit roll of each attack (attacker and defender alike) vs. the DC (as calculated by the formula):
Hit Roll: 75 DC: 55
This would be a fairly simple way to debug, as I'm assuming the hit roll is just a random # from 1-100 compared to the DC calculated by the formula. If you get a hit or a miss when it should be different, you know we need to track down a bug.