AIs have unfair advantages

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:
Lava-Golem
Posts: 17
Joined: November 16th, 2006, 6:20 pm

AIs have unfair advantages

Post by Lava-Golem »

i run Slackware linux version 10.2, wesnoth version 1.2, and i have gotten to noticing that the computer player hits almost every time, every time a fight commences, even if the percent chance is 30% , making the AI player have unfair advantages, i noticed it in all versions up to version 1.2
i'm a warrior of the undead legion, and i have an era to deal with...
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

You're quite surely wrong. Now, here's a question: how much would you bet on you being right?

EDIT: You could also just post replays of your games and show us how the computer hit you almost every time. That really would be most convenient.
Clonkinator
Posts: 676
Joined: July 20th, 2006, 4:45 pm
Location: Germany

Post by Clonkinator »

Then you simply just had bad luck or were on bad terrain...
User avatar
Mist
Inactive Developer
Posts: 753
Joined: February 15th, 2007, 8:44 am
Location: Milton Keynes, UK

Post by Mist »

I know what he means, but don't really agree with him. There are short spells in single player games where AI hits outrageous amount of attacks seemingly regardles of odds and in frustration you get suspicions that RNG is biased towards AI side. (Had one of those recently, three Orc Grunts attacking a dwarf in the forest, each of them standing on hills. Effect - dwarf hit once, each of the grunts hit thrice)

But thats pseudorandom number generation in C++. If you get bad seed, you're screwed. And people tend to remember those moments the best.
Lava-Golem
Posts: 17
Joined: November 16th, 2006, 6:20 pm

Post by Lava-Golem »

i'll try to get a replay. but i won't be able to very soon... oh, i forgot to also say, that when you have 70% of a chance to hit (i.e, magical, or just terrain) it only hits 1 or 2 times

edit: adding the replay

the senario only goes to turn 9, and was started before this was reported, so i had, in attempts to save my units, had been reloading the the save file i saved just before ending my turn, please watch closely, and ignore the corrupts
Attachments
replay.zip
watch this replay closely
(19.5 KiB) Downloaded 129 times
i'm a warrior of the undead legion, and i have an era to deal with...
Ultimatum479
Posts: 188
Joined: March 31st, 2007, 3:53 pm
Location: The Void, usually.

Re: AIs have unfair advantages

Post by Ultimatum479 »

Lava-Golem wrote:even if the percent chance is 30%
Dude, are you sure the percent chance to HIT is 30%, not the percent chance to DODGE?
Chosen to be: Avatar of the God of Vengeance

Duty-bound to be: Last chance for the oppressed non-humans of the world

Accidentally became: Co-founder of the Council of Linac Mux

Self-nominated (pending election): Forum SUPERMOD!
Lava-Golem
Posts: 17
Joined: November 16th, 2006, 6:20 pm

Post by Lava-Golem »

percent for the AI to HIT
i'm a warrior of the undead legion, and i have an era to deal with...
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

The only way that the AI currently cheats is that in some ways it keeps track of where all your non-hidden units are. If you are not playing with Fog O War, this isn't even cheating. Campaign designers can cheat in favor of the AI in a variety of ways, but tilting the random number generator is not one of them. If you don't believe me, check the code yourself. One of the nice advantages of open source software... What you are experiencing is humans tendency to not be able to properly intuitively grasp the statistics of small and large numbers and how really likely it is to have improbable events. And on that note, since this is really a non issue, any reason not to lock this thread?
Radaga
Posts: 5
Joined: August 3rd, 2007, 12:52 pm

Post by Radaga »

Well, I have seen things go bad every time for my units as well, so much that I had to stop playing out of frustration last night.

3 footpads, at night, in the forest, making him 70% protected and with good chance to hit, against an elf, in clear terrain.

I managed to connect, from the 9 footpad attacks, 4 of them (at 60% to hit, should be at the very least 6)

The elf unit, every single time, hit back at least once, and against one poor footpad, it hit thrice.

This happened (with slight variations) EVERYTIME I restarted / reloaded. To the point I lost a knight on broad daylight, on "plains" hex for a few elvish outriders that just WONT get hit, but hit back every single time.

It is very hard to attack the AI and dont get hit back at least once. But to see your unit, unit after unit try to hit and failing is frustrating.

So the AI doesnt cheat, but the pseudorandom gives bad seeds everytime. Well, then there IS something wrong.

I dont know, perhaps generate seeds for every attack, and not for the volley?

Be honest with yourseves, forget the programming, go play the game with a note pad sideways, and write down the odds and the actual hit over .. lets say.. 10 turns.

they WONT MATCH.. and they will ALWAYS favor the AI. (or nearly always)

Sorry for intruding the discussion, but it is very boring to see a great game make you shut down your computer due to being unable to trust the numbers presented.

when you see 75% chance to hit, and you have 4 attacks, you should be pretty sure you will connect at least two.

Yet, 1 or none is what you get.

the chance to miss all attacks: 1/4 * 1/4 * 1/4 * 1/4 = 1/256 ...

so if I play 256 times that attack, only ONE should have no hits at all.
sparr
Posts: 209
Joined: March 6th, 2006, 5:02 am

Post by sparr »

Doesnt the 'expected' vs 'actual' damage, taken and inflicted, track precisely this?
Radaga
Posts: 5
Joined: August 3rd, 2007, 12:52 pm

Post by Radaga »

Yep, but anyway, I tend to play adding 15% in my mind to the AI, and subtracting 15% from my chances.

This usually make things work somewhat as they should.

so, whenever I see 70% defense, I read: Player: 55% defense, AI 85% defense.

:P
sparr
Posts: 209
Joined: March 6th, 2006, 5:02 am

Post by sparr »

So, post some replays. If this is as prevalent as you say then it should be trivial to prove.
hjwn
Posts: 42
Joined: May 22nd, 2007, 6:36 am
Location: Europe

Post by hjwn »

Seems that topics like this will resurface over and over again. Follow sparr's advice:
sparr wrote:Doesnt the 'expected' vs 'actual' damage, taken and inflicted, track precisely this?
The advice is: look at the statistics! You'll see that there is no cheating. Wesnoth does the calculation for you.

When I played my first campaigns, I always did much more damage than was expected (=calculated). And the AI always did less damage than expected. I was the one who cheated, by reloading over and over again.
just blame it on the rng when you lose
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

Mist wrote:each of the grunts hit thrice
Then the AI is truly cheating! :lol:
Radaga wrote:3 footpads, at night, in the forest, making him 70% protected and with good chance to hit, against an elf, in clear terrain.

I managed to connect, from the 9 footpad attacks, 4 of them (at 60% to hit, should be at the very least 6)
Which attack allows a footpad to take three strikes? Even if there were 9 attacks, to expect at least 6 to hit based on 60% chance is just a wrong assumption. Wrong assumptions + wrong knowledge of in-game stats = wrong conclusions. :P

About expected/actual damage - I've never been interested in those enough to really work out the details, but consider this: when a unit dies, you'll always end the attack series with a hit by the survivor (in other words: the remaining expected damage of the other unit is lost). That alone will skew the balance away from the expected in favour of the winner, in terms of the statistics. If you happen to play consistently worse than the AI, you'll see the AI get consistently "more lucky". I happen to see the AI get consistently "less lucky" than me, according to stats.

Remember: 70% chance to hit is almost 1/3rd chance to miss.
Radaga
Posts: 5
Joined: August 3rd, 2007, 12:52 pm

Post by Radaga »

yes, but 70% chance to hit and 3 attacks means you will miss 1 and connect the other 2.

even slightly more than that.

And 70% cover means you will be hit 1/3rd of the time.

albeit we see differently.

I am at work, when I am at home, I will play some random games, and save replays.
Post Reply