Random numbers in attacks... and idea

General feedback and discussion of the game.

Moderators: Forum Moderators, Developers

zelurker
Posts: 4
Joined: April 18th, 2008, 1:31 am

Random numbers in attacks... and idea

Post by zelurker » April 18th, 2008, 1:43 am

I don't know if it's related to the topic "wesnoth harder on linux", but I have noticed many times extremely bad luck in fights because of random numbers.
For example : elite bowmen missing their 4 shots against an unit protected at 50 or 60% !!! Well when an "elite" bowman misses it's supposed to be an astounding event, not something which can happen 4 times in a row, and it happened to me a few times...

Or also chamans missing their entangle spells against an orc (in this case the shaman seems to miss most of the time actually, much more than the 50% he should have at least).

Well the idea is simple : why not trying to have cumulative chances instead of the same chance for every shot ?
That is : if the unit misses the 1st shot, then it concentrates better for the following shots and gains some more chance to hit.

For example :
4 shots, 40% to hit at start
1st shot missed -> chance rises to 40 + 60/4 = 55%
2nd shot hits at 55% nothing changes
3rd shot misses -> chance rises to 55 + 60/4 = 70
...

It seems to make sense for the rpg side of the game, much more sense than having dices playing against the player ! ;-)
The alternative is to find why the rng is making some series like that, so that missing 4 times happens for an elite bowman, it's not somethign exceptional...

Well except this very frustrating problem, wesnoth is an extraordinary game, so congratulations and thanks for that !!! :)

Dave
Founding Developer
Posts: 7067
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Re: Random numbers in attacks... and idea

Post by Dave » April 18th, 2008, 4:55 am

zelurker wrote:I don't know if it's related to the topic "wesnoth harder on linux", but I have noticed many times extremely bad luck in fights because of random numbers.
For example : elite bowmen missing their 4 shots against an unit protected at 50 or 60% !!! Well when an "elite" bowman misses it's supposed to be an astounding event, not something which can happen 4 times in a row, and it happened to me a few times...
If the game says you have 50% chance to hit then you have 50% chance to hit. The naming of your unit is irrelevant. A 50% event occurring is hardly "astounding".

A 50% event happening four times in a row has a 6.25% chance of occurring. This means it will occur more than one in twenty times this kind of fight occurs, which is rather frequent, and you can expect to see it quite a few times.

This is the way probability works.

Note that in Wesnoth, aside from certain special abilities, higher level and more powerful units generally have more strikes and damage, but do not have a higher chance to hit than lower level and weaker units. This is considered a design feature of the game to be planned around by players.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming

Edward V Riley
Posts: 265
Joined: June 28th, 2007, 4:42 pm
Location: Baldwyn Mississippi

Re: Random numbers in attacks... and idea

Post by Edward V Riley » April 18th, 2008, 5:07 am

I hate to disagree here, but it happens a lot more than 1 in 20. It happens 1 in 3 with mine, although I've learned to live with it and still enjoy the game immensely. What's worse is the AI, with a 40% or less chance often hits 75% of their attacks.

It doesn't matter much to me, however. Seems every game I've ever played with a random luck factor seems to shift enormously into the bad luck phase with me, with a few exceptions. Take Runescape for example. A lot of factors in that game depend on the luck factor, and I've seen high levels beaten by characters who shouldn't have even been able to scratch the higher level.

I don't know if every game uses the same formula for luck determination, but I think it bears looking more seriously into.
Who Knows what evil lurks in the hearts of men?
The Shadow knows

Dave
Founding Developer
Posts: 7067
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Re: Random numbers in attacks... and idea

Post by Dave » April 18th, 2008, 5:15 am

Edward V Riley wrote:I hate to disagree here, but it happens a lot more than 1 in 20. It happens 1 in 3 with mine, although I've learned to live with it and still enjoy the game immensely. What's worse is the AI, with a 40% or less chance often hits 75% of their attacks.
You are mistaken. You do not miss all four attacks 33% of the time when you have 50% chance to hit. (or irrespective of your chance to hit!) It happens about one in twenty times.

If you think it happens that often, post a single saved game with a replay (of a decent length), where your units miss that often.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming

Edward V Riley
Posts: 265
Joined: June 28th, 2007, 4:42 pm
Location: Baldwyn Mississippi

Re: Random numbers in attacks... and idea

Post by Edward V Riley » April 18th, 2008, 5:22 am

will do. Hope it doesn't take long with my dialup to post it though. I'm trying out THOT right now, and dwarves are notorious for missing all their attacks with me at 60%.

For some reason, the factor works just fine with Undead and Orcs. ALl others? nope.
Who Knows what evil lurks in the hearts of men?
The Shadow knows

zelurker
Posts: 4
Joined: April 18th, 2008, 1:31 am

Re: Random numbers in attacks... and idea

Post by zelurker » April 18th, 2008, 8:21 am

Yes indeed, to be more precise, when this bad luck happens, usually it's the exact opposite for the ai, it tends to have a 100% hit rate at least for its 2 1st characters, ignoring completely the defense of my units at this point.

It feels extremely unfair, and usually in this case I just reload, but it gets annoying after a while.

The hit rate is probably much more important for high level units than the damage they can deal, or otherwise you play with dices, not with high level units. It gives me the feeling that I am playing with broken arms units regularly !

Anyway the problem of my idea is with the units who can survive only if their opponnents miss a lot, like thieves, so it would probably be better to look into this randomness...

megane
Art Contributor
Posts: 410
Joined: October 30th, 2006, 4:55 am
Location: The Big Ö (a.k.a. Austria)

Re: Random numbers in attacks... and idea

Post by megane » April 18th, 2008, 8:35 am

zelurker wrote:Yes indeed, to be more precise, when this bad luck happens, usually it's the exact opposite for the ai, it tends to have a 100% hit rate at least for its 2 1st characters, ignoring completely the defense of my units at this point.
You're wrong. I'm sorry, you just are. Both you and the AI are treated in exactly the same way, and that way is exactly what one would expect from random chance.

As I've said before, the impression of a bias in the RNG is actually only an indicator of a bias in you: you notice (and get angry, and post ranty and poorly-thought-out messages on the forums) when your guy hits 0/4, but strangely nobody complains when they put a Heavy Infantry on snow and it takes 0/8 from the attacking AI, an event which has certainly happened several times in the history of Wesnoth. The point is, you have seen near-average results thousands of times, but the one time something "unusual" happens, that's the time that sticks in your mind.

If Riley does, indeed, post a replay (unlikely, unless he reloads continuously to make sure the AI gets "lucky" in order to prove his point), it will most likely consist of 45 turns of nothing interesting happening, with him pointing out "There! On turn 35, look! The AI hit 5 times in a row!! Clearly an example of a biased RNG!!!!" But even if his replay is both legitimate and falls out heavily in the AI's favor, that doesn't prove anything. Randomness, by definition, is unpredictable. Not every game will be +0/+0, or even close to that; if it were, it wouldn't be random. Could there be a game in which the AI hits 1000/1000? Sure. It's just unlikely, and it's precisely as unlikely as the numbers would suggest (in this case, so unlikely as to cause my calculator to round it off to zero xD).
that little girl's parents were attacked by ninjas - generic npc
hee hee! - little girl

sam_waz_here
Posts: 77
Joined: November 13th, 2007, 7:15 am
Location: under a rock

Re: Random numbers in attacks... and idea

Post by sam_waz_here » April 18th, 2008, 9:55 am

Megane you tend to notice your units get horribly unlucky and die more then the ai because every round they have just another orcish warrior but when it is the orcish warrior you spent several scenarios providing kills and treating like your child, you come to notice its death much more then the kills it acquires.

Now take this situation and apply it to a scenario at the end of a campaign where the enemy is numerous and powerful and you need every vertaran standing. Then seeing a couple unlucky shots followed by the death of your lvl 3's leads to the creation of these topics. All it takes is one stroke of bad luck and the entire game is turned on you, while having one stroke of bad luck for the computer leads to the end of the scenario and the start of the next, where the computer can have another crack at you and another spin of the rng means that mathematically you are at a disadvantage.
Where is the love?

bert1
Posts: 240
Joined: December 6th, 2006, 10:39 pm
Location: Morecambe, UK

Re: Random numbers in attacks... and idea

Post by bert1 » April 18th, 2008, 10:34 am

Edward V Riley wrote:I hate to disagree here, but it happens a lot more than 1 in 20. It happens 1 in 3 with mine, although I've learned to live with it and still enjoy the game immensely. What's worse is the AI, with a 40% or less chance often hits 75% of their attacks.
Dave should set up a Wesnoth Insurance Company, I think, for all those who have bad luck. It would be an excellent source of revenue for the new server, as well as giving Ed complete peace of mind.
Good is simply that which is willed. - Eugene Halliday

Darth Jordius
Posts: 399
Joined: September 17th, 2007, 4:53 pm
Location: 2 miles southeast of the Middle of Nowhere

Re: Random numbers in attacks... and idea

Post by Darth Jordius » April 18th, 2008, 11:59 am

bert1 wrote:
Edward V Riley wrote:I hate to disagree here, but it happens a lot more than 1 in 20. It happens 1 in 3 with mine, although I've learned to live with it and still enjoy the game immensely. What's worse is the AI, with a 40% or less chance often hits 75% of their attacks.
Dave should set up a Wesnoth Insurance Company, I think, for all those who have bad luck. It would be an excellent source of revenue for the new server, as well as giving Ed complete peace of mind.
Just as long as it isn't government mandated. But that's a subject for Off-Topic. :roll:

I dislike the randomness factor whenever the outcome works against me, but then again I feel really great when my doomed unit manages to take someone down by hitting them with all four strikes. Believe it or not, Wesnoth really is characterized by the luck factor. I remember when someone made the add-on to do away with randomness, but I really didn't like how pre-calculated the battle was. There was no chance of the enemy missing 3 magical strikes on a unit with 5 HP, and the outcome of each battle could be predicted quite easily. And judging by the number of people who whined and complained about luck, look where that guy's work got him. Nobody was interested in playing after awhile, and it just died into obliviousness. You just have to take the good times with the bad.
Quiz wrote:You are a Dwarvish Fighter. You're surly and handy with an axe. Go chop some trees.
Check out Quietus's Minotaurs!

zelurker
Posts: 4
Joined: April 18th, 2008, 1:31 am

Re: Random numbers in attacks... and idea

Post by zelurker » April 18th, 2008, 1:11 pm

It's not ranting, as it was said a few posts earlier, a lot of times in wesnoth you are outnumbered so that the ai has a chance to beat you (because the player is supposed to be smarter than the ai !), then you use characters that you slowly leveled up to that point, and you loose them just because of bad dices, but since you are outnumbered, loosing them means loosing the game.

Too bad I didn't see this add-on which removed randomness, maybe it was too much to remove it entierly, but it was certainly interesting to see.

Take the ad&d example, which is a reference in this category : there are dices and luck too, but when a character levels up, his thac0 goes down if he is a fighter, which means that he is less likely to miss, which makes perfect sense. At the same time some units should also become more skilled at avoiding blows when leveling, it makes sense too. It's normal to have a lot of randomness with level 1 units, but it's simply frustrating to still have this same randomness while being outnumbered at high level, and it's too bad, because except this the campaigns are interesting. Maybe the solution is simply to play at lower levels of difficulty to lower the consequences of bad luck, but at the same time it's less challenging so you loose something...

User avatar
Wintermute
Inactive Developer
Posts: 840
Joined: March 23rd, 2006, 10:28 pm
Location: On IRC as "happygrue" at: #wesnoth-mp

Re: Random numbers in attacks... and idea

Post by Wintermute » April 18th, 2008, 2:17 pm

zelurker wrote:Take the ad&d example, which is a reference in this category : there are dices and luck too, but when a character levels up, his thac0 goes down if he is a fighter, which means that he is less likely to miss, which makes perfect sense. At the same time some units should also become more skilled at avoiding blows when leveling, it makes sense too. It's normal to have a lot of randomness with level 1 units, but it's simply frustrating to still have this same randomness while being outnumbered at high level, and it's too bad, because except this the campaigns are interesting. Maybe the solution is simply to play at lower levels of difficulty to lower the consequences of bad luck, but at the same time it's less challenging so you loose something...
I wake up this morning, and suddenly I live in a world where D&D can be used as perfectly sensible example in a reality-based argument? :shock:

I think what you are overlooking is that with any amount of randomness there will be VERY UNLIKELY things that happen occasionally. Any event with nonzero probability of happening should occur in someone's game at some point. We all have our examples of such craziness: I once lost an ulf with a 99.3% chance to kill, and then in the same game lost another ulf with a 99.5% chance to kill. I was playing a very good opponent too, so this was very frustrating! But it also created a pretty unique game. Examples of bad luck stand out in our minds more than the great luck we get. I know I've played games with luck offsetting the example above, but I can't remember the details: but I sure do remember that ulf game! :wink:
"I just started playing this game a few days ago, and I already see some balance issues."

Draximus Prime
Posts: 5
Joined: April 15th, 2008, 3:03 am
Location: Missouri, USA
Contact:

Re: Random numbers in attacks... and idea

Post by Draximus Prime » April 18th, 2008, 2:22 pm

Personally, I quite like the randomness of Wesnoth. Yes, sometimes it annoys me to no end, but other times it'll allow a lvl 1 unit that's about to level survive an attack by a lvl 2 or 3. Then I get another higher level unit :P. So yes, it can be annoying, but it can also be awesome. In my opinion, this balances out nicely.

Dave
Founding Developer
Posts: 7067
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Re: Random numbers in attacks... and idea

Post by Dave » April 18th, 2008, 4:49 pm

zelurker wrote:Yes indeed, to be more precise, when this bad luck happens, usually it's the exact opposite for the ai, it tends to have a 100% hit rate at least for its 2 1st characters, ignoring completely the defense of my units at this point.
What do you think we have code like this in there or something?

Code: Select all

int hit = rand()%100;
if(unit.is_ai()) {
  hit += 20; // give the AI 20% more chance to hit!  Mwahahahahahaha!
} else {
  hit -= 20; // this'll make the game nice and hard for those pesky players!!!
}
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming

User avatar
Chris NS
Posts: 475
Joined: May 6th, 2006, 3:22 pm
Location: Where the Queen lives

Re: Random numbers in attacks... and idea

Post by Chris NS » April 18th, 2008, 5:12 pm

It's a simple law of maths. If your mage is attacking the enemy leader with a 70% chance to hit and four attacks, and any one hit will kill him and win the scenario, the probability of missing all four times is 100%.

Post Reply