Are the to-hit chances skewed in Wesnoth single-player?
Solution 1:
A quick look at the source code reveals no evidence of bias. The key lines appear to be (from src/actions/attack.cpp
):
bool attack::perform hit(bool attacker_turn, statistics::attack_context &stats)
{
int ran_num = random_new::generator->next_random();
bool hits = (ran_num % 100) < attacker.cth_;
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.