How does the ai handle multiple units with canrecruit=yes

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
User avatar
Paulomat4
Moderator Emeritus
Posts: 730
Joined: October 16th, 2012, 3:32 pm
Location: Wesmere library, probably summoning Zhangor

How does the ai handle multiple units with canrecruit=yes

Post by Paulomat4 »

Does he treats them like a player would, means he would send each one to a different keep (provided he has enough of them) and recruit with both, or would he just use the leader who is set in the [side] tag to recruit, or use only one of these units with canrecruit=yes randomly as leader?
Creator of Dawn of Thunder and Global Unitmarkers

"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: How does the ai handle multiple units with canrecruit=ye

Post by Dugi »

If an AI side has two leaders, it instantly crashes with no error messages at the beginning of its turn.
User avatar
Paulomat4
Moderator Emeritus
Posts: 730
Joined: October 16th, 2012, 3:32 pm
Location: Wesmere library, probably summoning Zhangor

Re: How does the ai handle multiple units with canrecruit=ye

Post by Paulomat4 »

okay, thanks, good to know :)
Creator of Dawn of Thunder and Global Unitmarkers

"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: How does the ai handle multiple units with canrecruit=ye

Post by mattsc »

Dugi wrote:If an AI side has two leaders, it instantly crashes with no error messages at the beginning of its turn.
Uh, what? Under what circumstances and in which version? I have never seen that and I just tried in an MP game (both with 1.10.6 and 1.11.6) in which I spammed a second leader for the Side 2 AI before its first turn. Neither of them crashed.

Now, having said that, until very recently the AI certainly did not handle multiple leaders very well in the way Paulomat4 suggests. flixx added better support for recruiting by multiple leaders as part of his GSoC project this summer. That is now in trunk and will be in 1.11.7. See some notes on multiple leaders on the wiki.
User avatar
Paulomat4
Moderator Emeritus
Posts: 730
Joined: October 16th, 2012, 3:32 pm
Location: Wesmere library, probably summoning Zhangor

Re: How does the ai handle multiple units with canrecruit=ye

Post by Paulomat4 »

I'm talking about bfw 1.11.6 during a campaign scenario. basically I have a meeting with the Ka'lian and as he consists of three leaders, I was wondering if it was needed for everyone of them to have an own side.
After looking at your link, it seems, that the ai works quite well with them. I'll need to try it out then :)
Creator of Dawn of Thunder and Global Unitmarkers

"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: How does the ai handle multiple units with canrecruit=ye

Post by mattsc »

Paulomat4 wrote:I'm talking about bfw 1.11.6 during a campaign scenario. basically I have a meeting with the Ka'lian and as he consists of three leaders, I was wondering if it was needed for everyone of them to have an own side.
After looking at your link, it seems, that the ai works quite well with them. I'll need to try it out then :)
It will definitely work in 1.11.7. In 1.11.6, it depends on what exactly you want. If you have the different leaders on their keeps (and can keep them there, for example by keeping them from grabbing villages or attacking), they will all recruit. However, the AI only moves one of the leaders (chosen at random) onto a keep if they are not on -- and that might be one of the leaders who is already on a keep, so you cannot start with 2 leaders on keeps and one off, that (usually) will not work. Also, if the three keeps are part of the same castle, only one of them will recruit (I believe; didn't test that). Of course, that only matters if they have different recruit lists.

And there shouldn't be a difference in behavior between a local MP game and a SP campaign scenario. I just tested it using the former because that was more convenient for me.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: How does the ai handle multiple units with canrecruit=ye

Post by Dugi »

mattsc wrote:Uh, what? Under what circumstances and in which version?
Happened on an older 1.10 (1.10.1 or maybe 1.10.2). It crashed repeatedly, moving the second leader to an extra side fixed the problem, so it wasn't just a random occurrence.
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: How does the ai handle multiple units with canrecruit=ye

Post by mattsc »

Dugi wrote:Happened on an older 1.10 (1.10.1 or maybe 1.10.2). It crashed repeatedly, moving the second leader to an extra side fixed the problem, so it wasn't just a random occurrence.
Hmm, interesting. Does that still happen with 1.10.7? If so, could you post a test case or instructions how to reproduce this? Even if multiple leaders are not well supported, at least they shouldn't crash things.
User avatar
Adamant14
Posts: 968
Joined: April 24th, 2010, 1:14 pm

Re: How does the ai handle multiple units with canrecruit=ye

Post by Adamant14 »

Using BfW 1.10.x I created once a scenario with up to three leaders for each sides (side 1 too), and it did work fine for me.
I never had noticed any problems.
Though I never tested this scenario on an other BfW version than 1.10.x.
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: How does the ai handle multiple units with canrecruit=ye

Post by AI »

Dugi wrote:
mattsc wrote:Uh, what? Under what circumstances and in which version?
Happened on an older 1.10 (1.10.1 or maybe 1.10.2). It crashed repeatedly, moving the second leader to an extra side fixed the problem, so it wasn't just a random occurrence.
It has been officially supported for a while now. LoW uses the mechanic in single player.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: How does the ai handle multiple units with canrecruit=ye

Post by Dugi »

Dugi wrote:Happened on an older 1.10 (1.10.1 or maybe 1.10.2).
Strange, I tried it on wesnoth 1.10.2 and it worked fine.

Maybe it was the mystery segfault bug, that keeps happening repeatedly in seemingly random occasions, in a reproducible way, but with no logical reason. I should have kept my campaign campaign when it had problems with this, but I was too focused on uploading a fix.
jeeree
Posts: 12
Joined: July 22nd, 2014, 2:42 am

Re: How does the ai handle multiple units with canrecruit=ye

Post by jeeree »

I did the same thing in version 1.10.7 in a multiplayer game, and the result was: the AI had 2 leaders, one stood there and did nothing except for capturing villages within move radius, while the other one did everything. not sure why..
Post Reply