I'm just learning Battle for Wesnoth in single-player mode, playing the first and second single-player campaigns (I won the 4-scenario brothers campaign, and am on scenario 4 of the 23-scenario Konrad campaign, on Normal difficulty), and I feel like I am either having a lot of bad luck, or there is some skewing or stickiness in the to-hit chances.
As in, I often have archers take 4 shots at 60% and they miss 3 or 4 of them. And I have lost several units when the enemy gets 3-4 hits in a row on a healthy unit.
Does "Normal" difficulty skew the to-hit odds to silently favor the AI, or am I just noticing when I have bad luck?
Best Answer
A quick look at the source code reveals no evidence of bias. The key lines appear to be (from
src/actions/attack.cpp
):In plain English, when calculating what happens in an attack, it generates a random number between 0 and 99 inclusive, and if that number is less than the attacker's chance to hit, the attack hits.
Chasing through the code,
random_new::generator->next_random()
is simply a wrapper around the C standard library's random-number generator. This generator has its faults, but a bias in favor of streaks of similar outcomes isn't one of them.In short, you're experiencing a very human tendency to see streaks of similar outcomes as "not random", when in fact they're a perfectly normal result of randomness. Next time you make an attack, click the "damage calculations" button and look at the full range of possible outcomes and their odds.