experimental_ai and extra_recruit

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

experimental_ai and extra_recruit

Post by vghetto »

Hi,

When experimental_ai is enabled for a side, then that side won't recruit from the types defined with extra_recruit.

please, see attached demo.

This is wesnoth 1.14.12

Edit: Please let me know if this is a known or unknown bug so I can put it up on github.
Attachments
_main.cfg
(1.47 KiB) Downloaded 161 times
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: experimental_ai and extra_recruit

Post by Alarantalara »

As the original author of the recruiting algorithm, it was definitely known to me. At the time I was writing it, it was an experiment into writing recruiting logic that attempted to match what a human might do within the limited context of the multiplayer maps used in competitive Wesnoth. As such, features not used by standard multiplayer matches were ignored in favour of covering those that were and making it as good as possible. This meant that while I was aware of extra_recruit, I didn't do anything about it because it was usually associated with having multiple leaders, which while it was something I thought would be interesting to add was lower priority from the point of view to doing it right. i.e. figure out which unit to recruit from those available to all leaders, then ensure a leader than can recruit the desired unit is in the right place and also do this in a way that it doesn't keep moving each leader back and forth if it wants to recruit two units from one leader and two from the other.

Judging from some of the changes I've seen made to it since it got included into the game directly instead of being an addon, I'd imagine that it's being changed in favour of being more like the older recruiting algorithm in that it has been modified to recruit a greater diversity of units because "if the unit is present in the recruit list then the map author intended the AI to recruit it" (most notably it has less bias against higher level units now, which is generally less than optimal in multiplayer games). As such I can see that it might eventually obtain the ability, but I think to do it right it will need to plan all the recruits before making any instead of the one unit at a time approach it has now.
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: experimental_ai and extra_recruit

Post by vghetto »

Thanks for taking the time in explaining it.

The following sentence from the wiki makes more sense now.
"We are, however, currently working on adapting the Experimental AI's recruiting to work in more general settings (mostly this means with more than one leader), after which there will be a choice which recruiting to use in the default AI."
Post Reply