## The RNG seems very off.

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
chris123
Posts: 4
Joined: April 14th, 2014, 12:09 am

### The RNG seems very off.

I know that we like to blame our bad games on the rng and bad luck. However I have been recording my attacks and my opponent's counter strikes and the likely hood of them occurring out of curiosity of how this game runs. In one game I have come across MANY attacks where I or the enemy has pulled off an unbelievable matrix dodging or insanely accurate aiming. In one circumstance both me and my opponent each missed all of our strikes, I had 5 strikes with a 40% chance to hit and he had 3 strikes with a 60% chance to hit. Since I had 40% chance to hit that means I had a 60% to miss(clearly). So the chances of me missing them all were .6*.6*.6*.6*.6 = 7.76%. Then the chances of him missing all of his would be .4 * .4 * .4 = 6.4%. Both of these in of them selves are fine and understandable considering how much attacking happens in a game, but the chances of them happening at the same time would be .064*.076 which is about .5%. Still if this happened once in a blue moon that would be ok, but I see similar matrix dodging or insanely accurate shots happening multiple times a game. I'm doing more research of how often this pops up, but so far in the game I am playing it has come up each round(I say a round is my turn then my opponent's turn) , which it should not be popping up anywhere near that often.
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

### Re: The RNG seems very off.

There's nothing wrong with Wesnoth's random number generator. It is a problem of human perception.

I never get tired of this Dilbert cartoon:
Spoiler:
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
tekelili
Posts: 1038
Joined: August 19th, 2009, 9:28 pm

### Re: The RNG seems very off.

good cartoon!

Other point of view would be: as we are in a planet with life and even intelligent beings, Universe´s random generator must be crashed (come on, what was the chance...?)
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
TheCripple
Posts: 103
Joined: March 19th, 2011, 3:30 am

### Re: The RNG seems very off.

chris123 wrote:I see similar matrix dodging or insanely accurate shots happening multiple times a game. I'm doing more research of how often this pops up, but so far in the game I am playing it has come up each round(I say a round is my turn then my opponent's turn) , which it should not be popping up anywhere near that often.
The calculations here are iffy. The short version is that you are calculating the odds of a specific matrix dodge/super attack combination - but there are a whole bunch of different combinations that are particularly notable, and between the lot of them seeing some occur is basically inevitable.
CIB
Code Contributor
Posts: 625
Joined: November 24th, 2006, 11:26 pm

### Re: The RNG seems very off.

TheCripple wrote: The calculations here are iffy. The short version is that you are calculating the odds of a specific matrix dodge/super attack combination - but there are a whole bunch of different combinations that are particularly notable, and between the lot of them seeing some occur is basically inevitable.
Also known as "birthday paradox", "Murphy's law", etc.. Human intuition of randomness is a bit strange at times.
JaMiT
Developer
Posts: 511
Joined: January 22nd, 2012, 12:38 am

### Re: The RNG seems very off.

chris123 wrote:but the chances of them happening at the same time would be .064*.076 which is about .5%. Still if this happened once in a blue moon that would be ok,
Hmm... The expected frequency of a 0.5% chance is once every 200 opportunities. A blue moon occurs about every 990 days (around 2.7 years). Now the standard Wesnoth time cycle has 6 turns per day, so if this 0.5% chance is expected once per blue moon, that means 200 fights (opportunities) over the span of 5,940 turns. So... you typically go almost 30 turns without combat (regardless of who initiates it)?

OK, I know that was hyperbole, but you were doing fine with the calculations up to that point.
chris123 wrote:but I see similar matrix dodging or insanely accurate shots happening multiple times a game.
Here is a place to beware the methodology. By combining dodging with accuracy, you've approximately doubled the cases you're counting as "abnormal" (overall, not in the provided specific example). If you get careless, you might end up counting much more than you thought you were.

Also, "per game" is not a good frame of reference for this, as the number of combats can vary greatly depending on the scenario. As I recall, a scenario of Northern Rebirth routinely features hundreds of units at a time, possibly a thousand individual combats. In that case the 0.5% case can be expected to occur five times. That's multiple times in a game and fully "normal".

chris123 wrote:I'm doing more research of how often this pops up, but so far in the game I am playing it has come up each round(I say a round is my turn then my opponent's turn) , which it should not be popping up anywhere near that often.
How often should it be popping up? Again, "per round" is not as good a measurement as "per fight", or perhaps "per 100 fights".

Suppose you have ~15 units, each of which attacks on your turn, and the same goes for your opponent. That's 30 combats in a turn. So, the chance of your 0.5% case not happening in a given turn is 0.995^30 = 86%. Less if you are still counting all extreme cases, instead of a single one. That's rather likely, but far from certain. Is it rather strange to not happen "each round"? Well, that depends on how many turns you've played....
Pentarctagon
Project Manager
Posts: 4574
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

### Re: The RNG seems very off.

A few years old now, but still a relevant example I think.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
chris123
Posts: 4
Joined: April 14th, 2014, 12:09 am

### Re: The RNG seems very off.

Very late reply, but you guys make a very good point with all the reasons of why this could possibly happen. As I have played more wesnoth I have noticed that, that night I was just having an odd RNG night. As I have been playing more the randomness seems more....random as expected with a larger sample of attacks. I guess I was just being way too quick in judging it because that made that night's games with other people very weird.

Side note that Dilbert cartoon is great xD
Iris