Atack probabilities seem off

General feedback and discussion of the game.

Moderator: Forum Moderators

Locked
GIYank
Posts: 4
Joined: December 28th, 2012, 3:18 pm

Atack probabilities seem off

Post by GIYank »

Playing mainline scenarios in normal difficulty, why do enemy attacks at 40% have more success than my attacks at 60%?
User avatar
Telchin
Posts: 357
Joined: December 20th, 2010, 10:01 am
Location: Czech Republic

Re: Atack probabilities seem off

Post by Telchin »

Are you sure that your memory isn't playing tricks on you? People tend to remember a string of failures in Wesnoth more than a string of successes because being angry and/or frustrated creates a greter emotional response than not being angy/frustrated. Also you have to remember that "dice has no memory", i.e. result of each individual atempt has no influence on the next one, so a string of results that is better or worse than predicted is possible. For an article about randomness in Wesnoth by the game's creator click here. (If the previous paragraph looks condescending, I didn't intend that. I just wanted to be helpful.) Welcome to Wesnoth forums anyway!
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2357
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Atack probabilities seem off

Post by Lord-Knightmare »

Wow, I thought I was the only who has faced this issue. I had reload a turn several times to get the perfect turn - A turn where everything goes in my favor. :twisted:
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Atack probabilities seem off

Post by 8680 »

t38079 may also be interesting. (Just ignore Blarumyrran.)
GIYank
Posts: 4
Joined: December 28th, 2012, 3:18 pm

Re: Atack probabilities seem off

Post by GIYank »

I'm certain its not a figment of my imagination. I replayed the same fight between two characters 20 times. My character with 60% probability, hit 28/60 times (48%) whereas the retaliation with 40% probability hit 22/40, 55%. As for the randomness issue, the successful hits are not random, they are probabilistic.
fabi
Inactive Developer
Posts: 1260
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: Atack probabilities seem off

Post by fabi »

The code part which determines the outcome of a combat does not know about who plays the corresponding units.
Thus it can't be biased towards or against a certain player, no matter if human played or by the artificial intelligence.
User avatar
ancestral
Inactive Developer
Posts: 1108
Joined: August 1st, 2006, 5:29 am
Location: Motion City

Re: Atack probabilities seem off

Post by ancestral »

GIYank, there have been many discussions on the randomness in the game. You might want to read this document on Frequently Proposed Ideas. You might also be interested in reading an article I stumbled upon rather recently, “What Does Randomness Look Like?” which explores what randomness is. One of the big things that can be gained from the article is that strings of successes or failures are quite common in random generation (like flipping a coin).
Wesnoth BestiaryPREVIEW IT HERE )
Unit tree and stat browser
CanvasPREVIEW IT HERE )
Exp. map viewer
GIYank
Posts: 4
Joined: December 28th, 2012, 3:18 pm

Re: Atack probabilities seem off

Post by GIYank »

y'all, thanks for the good discussion on the attack probabilities. One thing that seems to be misunderstood, however, is that attack success is generated randomly. But in fact, it is not. Each player has a certain probability of hitting - 60%, 40%, 30%, etc. The ONLY hit probability that is truly random is the 50% hit probability. Here is why: In a random system, each subject has an equal probability of the possible outcomes and each instance is independent of all the others. In the game, hit success is a binary system (either hit or not hit), so if the outcomes are random hit success probability is 50%. If hit success probability is anything other than 50%, it is not random.
User avatar
Kymille
Posts: 107
Joined: October 25th, 2009, 4:55 am

Re: Atack probabilities seem off

Post by Kymille »

GIYank wrote:I'm certain its not a figment of my imagination. I replayed the same fight between two characters 20 times. My character with 60% probability, hit 28/60 times (48%) whereas the retaliation with 40% probability hit 22/40, 55%. As for the randomness issue, the successful hits are not random, they are probabilistic.
That doesn't prove anything. If you keep re-loading the same fight, you will not get independent results because you start at the same random number generator seed. You've chosen to do your test presumably because the RNG is more likely to give you an initial miss and him an initial hit.

Just to check, what units are you using and what terrain are they on?
User avatar
lipk
Posts: 637
Joined: July 18th, 2011, 1:42 pm

Re: Atack probabilities seem off

Post by lipk »

In the game, hit success is a binary system (either hit or not hit), so if the outcomes are random hit success probability is 50%. If hit success probability is anything other than 50%, it is not random.
What you're talking about is the classical (or Laplace's) probability field, not the definition of mathemathical randomness.
GIYank
Posts: 4
Joined: December 28th, 2012, 3:18 pm

Re: Atack probabilities seem off

Post by GIYank »

Kymille wrote: That doesn't prove anything. If you keep re-loading the same fight, you will not get independent results because you start at the same random number generator seed. You've chosen to do your test presumably because the RNG is more likely to give you an initial miss and him an initial hit.
This makes sense. Thanks!
Rya
Posts: 350
Joined: September 23rd, 2009, 9:01 am

Re: Atack probabilities seem off

Post by Rya »

That sounds like a strange RNG. If it was really the same seed then the result should be exactly the same and not just "more likely". As the results are different, that would mean a different seed on reloading and thus also completely random results.
Wesnoth
The developer says "no".
DMB
Posts: 31
Joined: October 30th, 2012, 1:39 am
Location: USA

Re: Atack probabilities seem off

Post by DMB »

While it may seem like it is off, it is not. It was simply an unlucky turn or attacks. If you set the system out long enough it will eventually even out, the best way to see this is via the "s" button during games, as it shows you expected damage amounts vs actual damage amounts, both taken and given, for the current turn and all the previous turns in the game/campain. Generally, while the number may be as high as +30% or -40% or some other ungodly unluckiness or luckiness for the current turn, rarely ever will the compounded numbers over the course of a campain or MP game be above or below a 5% threshold. I have seen games where the overall damage dealt was +2% and the damage recieved was -8% and vice versa et cetera et cetera, but generally the numbers will be within 5% of 0%. I playd an MP game just last night where I missed 6/7 attacks one turn and 4/7 the next, but before that I had hit 8/8 times. All in all, it usually balances out. It's an unbiased system.
In one game I played an unfortunate UD player missed 9/10 attacks on my loyalist's during Second Watch (4 of those attacks that missed coming from Adepts!) and recieved 8/8 hits in return from my forces, killing a ghost, both Adepts and a Skele while taking only two hits from a ghost. He immediately quit after that, and I can't blame him, but that was a very unlucky turn for him and and a very lucky turn for me. As it was a 4 player ffa I continued to fight and, while I did not have any extremely unlucky turns afterwards, I also did not have any more extremely lucky turns. It was all average afterwards.
And here's another thing to think about.
30% chance to hit doesn't mean immpossible to hit, it means out of ten attacks, three should hit. One third of all attacks should land. 25% sounds incredibly low, does it not? But only when you don't think along the lines of one out of four. Even a measly ten percent still mean one out of every ten, and in business ten percent is no laughing matter, it can be the difference between going bankrupt or becoming a millionare.
Percentages aren't neraly as low as a human brain comprehends them.
User avatar
Gambit
Loose Screw
Posts: 3266
Joined: August 13th, 2008, 3:00 pm
Location: Dynamica
Contact:

Re: Atack probabilities seem off

Post by Gambit »

This has been discussed to death.

If it says 70% chance to hit, it means 70% chance to hit. You might get more lucky and get all hits, or less lucky and get all misses, or somewhere in between, but that's what randomness is.

Being an open source game, you are free to review the portion of the code that controls this yourself. If you find anything in the source code (which is 100% freely available online), please feel free to file a proper bug report. I also definitely recommend the link given to you by Telchin.

In the meantime, thread locked because this topic — "I get some interesting luck sometimes, so I think the AI is cheating" — is older than the Necronomicon and twice as long.
Locked