AI in 1.8 a big step back

General feedback and discussion of the game.

Moderator: Forum Moderators

deoxy
Posts: 208
Joined: May 16th, 2007, 5:22 pm
Location: Texas

AI in 1.8 a big step back

Post by deoxy »

I've been playing Wesnoth again since 1.8 came out - I really hadn't played much at all since 1.4 (maybe a LITTLE in 1.6), and the AI really seems to be a big step back.

Basically, it has a bias towards recruiting the really expensive units, then using them like it uses anything else (Banzai!!!!!!). In default, it seems particularly bad about blowing its entire starting money on Gryphon riders, then suiciding them (especially problematic due to their huge movement), but it also does this to a lesser extent with mages and HI.

Since I generally find 1v1 against the computer to be too easy, when I play solo, I like to play 2v2 with one AI ally, but really, in 1.8, WAY too often, the game is decided on random faction choice and first recruit by the AIs. about half the games I play, one of the AIs basically falls on its sword (as mentioned above)... and 1v2 really sucks, not fun winning or losing that way.

Any plans to fix this problem?!?

I suspect this has been mentioned here, but "AI" gets excluded from the search for being "too common" (just tried it), so it's pretty hard to search usefully on this topic.
Insert nifty witticism here... if only I had one.
5dPZ
Posts: 211
Joined: July 11th, 2006, 7:20 pm
Location: Vancouver, Canada

Re: AI in 1.8 a big step back

Post by 5dPZ »

AI is fairly decent with 400g vs your 100g - you will need some luck to win. If you want a decent 1 vs 1 match on fair conditions, play humans.
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

Re: AI in 1.8 a big step back

Post by Velensk »

I don't know why you say it's a step back, it's just as horrible as it has always been. Maybe you've gotten better?
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: AI in 1.8 a big step back

Post by Iris »

Velensk wrote:I don't know why you say it's a step back, it's just as horrible as it has always been.
It's been worse in some versions, which inspired this quote around the end of 2008
<Shadow_Master> playing IftU scenario 1, both AI players recruited on first turn whole castles, the second AI moved its leader; but on the second turn, only the last AI player moved a unit besides the leader, after moving the leader back to the keep
<Shadow_Master> I cannot playtest under these conditions. Argh. My plan of releasing before Nov. 10th is spoiled.
<loonycyborg> Shadow_Master: I'm getting the same.
<loonycyborg> Which kinda breaks the story :)
<Shadow_Master> {ATTACK_DEPTH 2 2 3} <- perhaps the AI is extremely scared?
<loonycyborg> Or not. Their leader calls them sluggards. That's why they don't move. They're sluggards :)
[...]
<Shadow_Master> loonycyborg: can you test if IftU still breaks with the AI?
<loonycyborg> Shadow_Master: Yes. They're still sluggards :(
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
Captain_Wrathbow
Posts: 1664
Joined: June 30th, 2009, 2:03 pm
Location: Guardia

Re: AI in 1.8 a big step back

Post by Captain_Wrathbow »

<Shadow_Master> playing IftU scenario 1, both AI players recruited on first turn whole castles, the second AI moved its leader; but on the second turn, only the last AI player moved a unit besides the leader, after moving the leader back to the keep
<Shadow_Master> I cannot playtest under these conditions. Argh. My plan of releasing before Nov. 10th is spoiled.
<loonycyborg> Shadow_Master: I'm getting the same.
<loonycyborg> Which kinda breaks the story :)
<Shadow_Master> {ATTACK_DEPTH 2 2 3} <- perhaps the AI is extremely scared?
<loonycyborg> Or not. Their leader calls them sluggards. That's why they don't move. They're sluggards :)
[...]
<Shadow_Master> loonycyborg: can you test if IftU still breaks with the AI?
<loonycyborg> Shadow_Master: Yes. They're still sluggards :(
...Soooo, what was wrong?
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: AI in 1.8 a big step back

Post by Iris »

Oh, the quote wasn't detailed enough it seems.

Around Wesnoth 1.5.5, the AI would stop responding on single player and it'd recruit and move a few units for the first few turns and then do absolutely nothing, in many cases.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
Zerovirus
Art Contributor
Posts: 1693
Joined: July 8th, 2009, 4:51 pm

Re: AI in 1.8 a big step back

Post by Zerovirus »

And with loyalists they go HI, HI, HI, Mage, HI, HI, Bowman, Mage, Spearman, nothing for five turns, HI, HI, HI, HI, HI, Mage.

Or something to that effect.
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: AI in 1.8 a big step back

Post by Pentarctagon »

iirc crab said that the 1.8 ai beats the 1.6 ai at a 2:1 ratio.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
jb
Multiplayer Contributor
Posts: 505
Joined: February 17th, 2006, 6:26 pm
Location: Chicago

Re: AI in 1.8 a big step back

Post by jb »

Making the AI better is an ongoing goal. A lot of talented people have dabbled in this area. It's not easy, otherwise we'd already have uber AI.
My MP campaigns
Gobowars
The Altaz Mariners - with Bob the Mighty
deoxy
Posts: 208
Joined: May 16th, 2007, 5:22 pm
Location: Texas

Re: AI in 1.8 a big step back

Post by deoxy »

jb wrote:Making the AI better is an ongoing goal. A lot of talented people have dabbled in this area. It's not easy, otherwise we'd already have uber AI.
I completely understand that - I'm not contributing on the programming side at all, so I'm really complaining that today's free ice cream isn't as good as yesterday's free ice cream.

Still, if the people giving away the ice cream are TRYING to make the ice cream better, they need to know that it got worse.
Pentarctagon wrote:iirc crab said that the 1.8 ai beats the 1.6 ai at a 2:1 ratio.
I'm not an AI, so I really don't care about that.

Once a game gets going, the AI DOES seem a bit better than the old one - still too aggro, still predictable, but better. Really, my complaint is that two of the weaknesses of the AI (using high-speed units poorly and WAY over-aggressively, spamming expensive units when it has the money) play on each other to cause EPIC FAIL at the beginning of the game way too often.

Either of those flaws alone isn't too bad alone, but together... I'm tempted to set up a custom knalgans faction that doesn't include gryphons and a custom "AI random" that uses that knalgans instead of the default one - that's single biggest and most common fail. Too many wolves/elvish scouts/cavalry isn't too bad, and too many HI/mages (it tends to pick one) can be fun if it happens to counter my early recruit well (since those tend to crush/lose to opposite recruitment patterns).

For some reason, I haven't really noticed wose, ghost, or horseman spam at all. That's really weird when I stop and think about it.
Insert nifty witticism here... if only I had one.
User avatar
boru
Posts: 788
Joined: November 19th, 2009, 11:02 pm

Re: AI in 1.8 a big step back

Post by boru »

There are macros that can control the number of contemporaneous recruits for the ai. So a scenario designer (or anyone with a text editor) could go in and fix the WML to their preference. http://www.wesnoth.org/macro-reference. ... -utils.cfg

There is a "gotcha" - side macros can only be used inside a [scenario] tag, because they generate events. So you ought to be able to get it to work in a multiplayer scenario or multiplayer campaign, but in other multiplayer games, you may only get error messages.

There are ways to tweak the aggression and caution through WML, but in the little bit of testing I've done, I have found it's a lot like porridge -- either too hot or too cold.
“It is written in my life-blood, such as that is, thick or thin; and I can no other.” - J.R.R. Tolkien

My campaign: Swamplings - Four centuries before the founding of Wesnoth, the first wolf rider emerges from a tribe of lowly swamp goblins.
User avatar
Maiklas3000
Posts: 532
Joined: June 23rd, 2010, 10:43 am

Re: AI in 1.8 a big step back

Post by Maiklas3000 »

I have no idea what the AI was like in previous versions, but the sucky AI really hurts many scenarios in campaigns.

One campaign where the user's experience particularly suffers is Legend of Wesmere, where in many scenarios you lose if your suicidal AI-controlled ally leader commits suicide. You're charged with protecting the leader, but meanwhile he banzai charges his troops out of his fortress and across the open plains towards the overwhelming enemy horde, while he remains behind like a sitting duck and you must struggle to reach him in time. The Human Alliance is the prime example of this, but other scenarios with this problem include Hostile Mountains, Ka'lian Under Attack, Elves Last Stand, Battle of the Book, Breaking the Siege, and Northern Battle. Ka'lian Under Attack is particularly striking, since just when you think you have the situation under control, the computer takes control of your force and you are given another force charged with rescuing the now suicidal elf leader. As you struggle get a relief party to the leader, he orders high XP poisoned shamen to jump like lemmings from his fortress into the moat while he charges the nearest assassin he can find and gets poisoned.

Now, I don't know how much of this is due to the scenario set up vs the game engine. I only know that my enjoyment of campaigns is suffering, since I get tired of seeing the computer banzai charge in situations that clearly warrant a defensive stance.

The only time I've seen the AI take a defensive stance is in the scenario I just mentioned, Ka'lian Under Attack, but it's the orcs that do it. In this scenario, the orcs only go defensive sometimes, I think when you kill a particular leader early on or at random. The orcs then all retreat to one of the strongholds, making a big ball, which at first I thought was an AI bug. As you approach closer, the orc units will peel off like layers of an onion. For example, once you are within strike range of wolves, you get hit by a wave of wolves. Ironically, on hard, the orcs have such overwhelming numbers that this is probably the one scenario that their normal banzai charge is the best strategy. Still, the defensive ball works surprisingly well and can easily take out one of your critical units if you're not careful. Of course, it goes to far to the other extreme from banzai charge.

My biggest complaint about the AI's banzai charge mode is that it loves diving into water. Terrain, terrain, terrain. We all know that terrain is key, so why does the AI hardly seem to acknowledge its presence? True, terrain is less important in a blitzkrieg, but for example, if a unit can move to a fortress hex or move one hex farther into water, the computer AI seems to choose water. I get tried of seeing orcs behave as if they are semi-aquatic. Of course, there are cases where semi-aquatic behavior is warranted, like say with Banebows.

A similar issue is with shamen and mages and similar. They banzai charge with no fear of water or enemy forces. If the AI has a choice of moving a shaman to a hex just out of strike range of enemy forces versus one hex farther (and within strike range), it seems to choose to go one hex farther.

Think of how much more variety there would be in campaigns if the AI were improved. Right now there are all these scenarios that are called "sieges" but are really just banzai charges on both sides.
User avatar
Crab
Inactive Developer
Posts: 200
Joined: March 18th, 2009, 9:42 pm

Re: AI in 1.8 a big step back

Post by Crab »

About 2:1 win ratio, this is on big enough scenarios where improved village-seeking and target selection comes into play. It's even higher if we try to use formula_ai-based recruitment made by Dragonking in 2009 (unfortunately, it's not stable and cannot be used as the default one)
Maiklas3000 wrote: Now, I don't know how much of this is due to the scenario set up vs the game engine. I only know that my enjoyment of campaigns is suffering, since I get tired of seeing the computer banzai charge in situations that clearly warrant a defensive stance.
It's an group of old and well-known problems in the engine. We are now closer to fixing them than a year ago, but, as of now, there's still the following problem:
1) if you tell AI to be cautious and non-aggressive, it will not charge into the water and into bad terrain, but then it'll have the problem where only several units charge, and other units remain behind, not supporting the attackers in any way - the AI doesn't understand ZoC concepts and is not able to form a 'defensive line'. So, the few attackers get slaughtered.
2) if you tell AI to be aggressive, it'll be content with sacrificing its units, which can be offset by giving the AI more gold. this is the usual choice of scenario creators which leads to AI having 2:1 gold advantage and having the 'banzai charge' behavior.
There are some tricks which the scenario creator can use to make it more balanced and fun (vary aggression and caution by time of day, give the AI gold `in batches` to make it recruit more smartly, etc )
To solve the issue, we must fix the problems in (1) - teach the AI to make defensive pushes - where AI does good attacks only if it can use other units (without `good attacks` of their own), to support the attackers without attacking, by forming a defensive ZoC line. That will allow low-aggression AI to work, and it will allow us to retune the mainline campaigns to use the low aggression + high caution stance.
The only time I've seen the AI take a defensive stance is in the scenario I just mentioned, Ka'lian Under Attack, but it's the orcs that do it. In this scenario, the orcs only go defensive sometimes, I think when you kill a particular leader early on or at random
it depends on how many elves and how many orcs are inside the citadel at the first end of turns, and on whether that assassin leader is killed.
Think of how much more variety there would be in campaigns if the AI were improved. Right now there are all these scenarios that are called "sieges" but are really just banzai charges on both sides.
Yes, I agree.

About recruitment - Old recruitment is bad and definitely needs improvement. For example, Dragonking's expermental formula_ai recruitment, albeit somewhat buggy, is definitely better for some matchups, and is more fun. For one, it uses a more varied recruitment list.
Rya
Posts: 350
Joined: September 23rd, 2009, 9:01 am

Re: AI in 1.8 a big step back

Post by Rya »

I think the ai in 1.8 is really better. I had to make a lot of my multiplayer campaigns and scenarios easier when converting from 1.6 to 1.8, because they were simply not beatable anymore with the new ai.


But in particular the knalgan faction really seems to have gotten a lot less "varied". I know what you mean, it seems to be only making Gryphons to 98% on the first turn. It's not so bad with other factions.

On the other hand, Gryphon rush is a plausible tactic. I once made a scenario that nobody could beat and then there was a player that after some tries went for a gryphon rush (i.e. only recruit gryphons and kill enemy leader off as fast as possible with them) and he actually won.
Wesnoth
The developer says "no".
deoxy
Posts: 208
Joined: May 16th, 2007, 5:22 pm
Location: Texas

Re: AI in 1.8 a big step back

Post by deoxy »

Rya wrote:On the other hand, Gryphon rush is a plausible tactic.
Not the way the AI uses them... it's more like "gryphon suicide with the occasional kill". It looks scary, and good luck can make it hit hard (especially if you put some units on bad terrain), but the majority of the time, it's not even kamikaze, just plain suicide. (Again, that's the way the computer uses it - a player could use them essentially like drakes, creating a knalgan hit-and-run tactic.)
Insert nifty witticism here... if only I had one.
Post Reply