Allied AI's

General feedback and discussion of the game.

Moderators: Forum Moderators, Developers

mortimer
Posts: 1
Joined: December 29th, 2011, 3:29 am

Allied AI's

Post by mortimer »

I am sick and tired of losing campaign scenarios when I'm on the verge of crushing my enemies because some mission critical, allied, AI leader gives up the ghost. I dread having an AI ally because keeping it alive makes a scenario much harder. Also, proliferation of AI allies (they occur in almost every campaign, often more than once) has destroyed any charm they might have as a plot device. So, I make a request of campaign designers and maintainers: please either make AI allies strong enough to hold their own, give me control of their side, or make survival of an allied leader a bonus objective. For instance, in "Clearwater Port" from TRoW, letting Commander Aethyr die shouldn't ruin the story but if it does, giving the player control of Aethyr would make sense. In "Human Alliance" from LoW, having an independent allied AI makes sense for the story, but either beefing up Aldar's forces or tweaking his behavior to "not suicidal" would be a nice touch.

Aw, well, enough of my whining.
--Mortimer

User avatar
alexanderthegre
Posts: 193
Joined: December 8th, 2011, 3:23 am
Location: nowhere

Re: Allied AI's

Post by alexanderthegre »

Having allied AI's are part of the difficulty of the scenario. If you're having trouble keeping them alive, send a couple of tank-style units (elvish/dwarvish fighter, troll whelp) to their keeps to protect them.

User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Allied AI's

Post by Sapient »

If the scenario is tested thoroughly on all difficulties then it shouldn't be a problem. However sometimes the scenario may fail when a new version of Wesnoth comes out, due to AI and unit stat changes. It's important to give feedback on the campaign to help catch this.

I will also mention that you can use the :droid <sidenumber> command to take control of a side (but some would consider that cheating).
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."

User avatar
beetlenaut
Developer
Posts: 2427
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Allied AI's

Post by beetlenaut »

Sapient wrote:If the scenario is tested thoroughly on all difficulties then it shouldn't be a problem.
I feel like this is the exception rather than the rule. The easiest levels are usually nicely balanced, but not the hard ones. I feel mortimer's pain.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide

The Black Sword
Posts: 373
Joined: October 13th, 2008, 4:35 pm

Re: Allied AI's

Post by The Black Sword »

I agree with alexander, you should view keeping your allies alive as part of the challenge of the scenario.
If you feel this challenge is too much in a particular scenario you should report that scenario specifically.

Oh, and letting Commander Aethyr die would in fact ruin the story. :P

User avatar
Lord-Knightmare
Forum Regular
Posts: 1153
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: Allied AI's

Post by Lord-Knightmare »

Allied AI leaders alive in a scenario is tough...
My first campaign, featured a similar problem. In a scenario, you had to defeat four enemy leaders and keep 3 allied leaders alive. The fun part was that the leaders were suicidical. So I had some lvl2 loses... :(
In another UMC campaign, (Legend of the Far North) the final battle scenario, gives you two allied AIs who end up triggering all the traps, and make you lose.
The solution is press : and then type droid on the allied AI's turn and you will gain control of that side on the next turn. Its not cheating BTW, but improvising.... :lol2:

User avatar
beetlenaut
Developer
Posts: 2427
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Allied AI's

Post by beetlenaut »

What about the times you play recklessly, losing high-level units, just to get your tanks set up in front of your ally in time, and your ally jumps into the water in front of your line to attack four level-3 enemies? That doesn't make the game "more challenging". Like I said before, this is just on hard. The trouble is, you have to be an expert player to balance an expert campaign on hard, so there are only a handful of people who even could fix these scenarios. When I give feedback, I often hear, "Maiklas3000 did all of them, so it can't be impossible." That does take care of 1.8 mainline, but I'm not convinced that 1.9 is ready because the AI has changed.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide

vicente
Posts: 33
Joined: November 21st, 2011, 9:40 pm
Location: Washington DC, USA

Re: Allied AI's

Post by vicente »

The most annoying Ai I find is Sisal in Northern Rebirth. She is trying all the possible ways to commit suicide. Even I rashed a herd of Drakes to completely shield her from the enermy, she still came out from the back with a few HP. I wonder why the developers do not set her on the passive mode. Also I could see any difference whether the AI is instructed to play aggressively or defensively. On the other hand, when the AI is controlling the enermy, it tends to be less suicidal in many scenarios. For example, in the "Pursuit" of Northern Rebirth (1.9.9), when playing against the 21 spiders in the cave, none of the the spiders came to the choke point. So the advice of that scenario on wiki is not working.

Gragorak
Posts: 39
Joined: November 5th, 2011, 6:17 pm
Location: Kirkkonummi city, Finland

Re: Allied AI's

Post by Gragorak »

vicente wrote:Also I could see any difference whether the AI is instructed to play aggressively or defensively.
I played that scenario few days ago, and when I set the AI to play defensively, it really did so. Or at least, I didn't have problems with it.

User avatar
Elvish_Hunter
Forum Moderator
Posts: 1430
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Allied AI's

Post by Elvish_Hunter »

beetlenaut wrote:What about the times you play recklessly, losing high-level units, just to get your tanks set up in front of your ally in time, and your ally jumps into the water in front of your line to attack four level-3 enemies?
That's exactly what happened me in Northern Rebirth at Nightmare level: both Sisal (in Get the Gold) and Hamel (in Showdown) insisted in placing their units in water or in plain, completely ignoring the high defense hexes (mountain, forest, castle) that they had available. Even if I used the right-click menu to tell them to be more defensive.
beetlenaut wrote:When I give feedback, I often hear, "Maiklas3000 did all of them, so it can't be impossible." That does take care of 1.8 mainline, but I'm not convinced that 1.9 is ready because the AI has changed.
Personally, to be able to win NR, I ended up un-droiding both Sisal and Hamel. It worked. :)
vicente wrote:The most annoying Ai I find is Sisal in Northern Rebirth. She is trying all the possible ways to commit suicide. Even I rashed a herd of Drakes to completely shield her from the enermy, she still came out from the back with a few HP. I wonder why the developers do not set her on the passive mode.
Only one castle of Drakes? I sent her two castles of Gliders and one of Gryphons... Setting her on passive mode may be an idea, but does not take care of both her an Hamel suiciding their units.
Another possible help may come from the AI_CONTROLLER_ALLOW_LEADER_CONTROL macro (in data/core/macros/ai.cfg), that allows asking to an ally leader to move to a certain location with a right-click menu.
Current maintainer of these add-ons:
1.14: The Sojournings of Grog, A Rough Life, The White Troll (co-author), Wesnoth Lua Pack
1.12: Children of Dragons

User avatar
beetlenaut
Developer
Posts: 2427
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Allied AI's

Post by beetlenaut »

Sisal shouldn't stick her units in the water. The AI is supposed to avoid any water hexes. (I changed it myself a long time ago.) The [avoid] code is still there, so if they go swimming anyway, it's a bug.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide

User avatar
taptap
Posts: 980
Joined: October 6th, 2011, 5:42 pm

Re: Allied AI's

Post by taptap »

I had big trouble with the king in Delfador's Memoirs being dead before my units could physically reach him, and consistently so, while the wiki pages claim otherwise. I reckon the people who won it on hard difficulty, did so by changing AI recruitment patterns (toward more units overall, by changing the ignore-bad-combat no & ignore-bad-movement no lines, as this results in him recruiting more units of lower levels with overall more hp for the starting gold he might hold out longer giving you more time to rescue him). At least Maiklas writes under every feedback that he did modify AI recruitment that way. I don't think it is good to have scenarios you can only win by modifying the configuration.

In scenarios where you can set the AI to be aggressive or defensive, often what defensive does is that they do not attack at all even when the opponent has little to no retaliation.

Galaldurs Journey has an allied AI in the final scenario. You can't stop it from sacrificing all its units, but you can at least give the leader instructions where to go. Simply adding this here and there would help a great deal to avoid some of the worst stupid allied leader deaths.
I am a Saurian Skirmisher: I'm a real pest, especially at night.

User avatar
beetlenaut
Developer
Posts: 2427
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Allied AI's

Post by beetlenaut »

If you are talking about the Save The King scenario, I rebalanced it before 1.9.10. (About three months ago.) I tested it all day on every difficulty level, so it should be winnable now.

I didn't know that Maiklas changed scenarios to win, and of course you shouldn't have to.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide

User avatar
Elvish_Hunter
Forum Moderator
Posts: 1430
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Allied AI's

Post by Elvish_Hunter »

beetlenaut wrote:Sisal shouldn't stick her units in the water. The AI is supposed to avoid any water hexes. (I changed it myself a long time ago.) The [avoid] code is still there, so if they go swimming anyway, it's a bug.
I tried yesterday, and effectively her units avoid sand and water. However, if my memory serves me well (I have only the replay when she was un-droided), she was unable of retreating in a more protected location in later turns, when Gliders and Gryphons were all killed. I'm still of the opinion that AI_CONTROLLER_ALLOW_LEADER_CONTROL may be a good solution, in that scenario. Also passive_leader=yes may help.
Current maintainer of these add-ons:
1.14: The Sojournings of Grog, A Rough Life, The White Troll (co-author), Wesnoth Lua Pack
1.12: Children of Dragons

User avatar
beetlenaut
Developer
Posts: 2427
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Allied AI's

Post by beetlenaut »

Avoiding sand and water is exactly what she does. I don't think that could make her unable to retreat. The AI was probably just playing too aggressively.

I think the AI controller should not only be added to every allied leader, but it should be expanded too. Forcing a leader to be passive would be a great addition. (I did something like that in my campaign, TFoB, so the code is available.) I don't think leaders should be hard coded to be passive though. They won't attack even badly wounded enemies in their keep, and they won't retreat if they are in trouble. They should be kept from suicidal behavior another way.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide

Post Reply