SoC Ideas AI Recruitment 2012: Difference between revisions
No edit summary |
|||
| Line 2: | Line 2: | ||
= Description = | = Description = | ||
<h2>AI: Refactor recruitment algorithm</h2> | <h2>AI: Refactor recruitment algorithm</h2> | ||
Page for the idea: [[SoC_Ideas_AI_Recruitment_2012]] | |||
We need to refactor existing wesnoth's recruitment algorithm to: | We need to refactor existing wesnoth's recruitment algorithm to: | ||
| Line 11: | Line 13: | ||
# improve counter-recruiting strategies. | # improve counter-recruiting strategies. | ||
# improve recruiting for AI-playable campaigns where AI has to not spend all the gold. | # improve recruiting for AI-playable campaigns where AI has to not spend all the gold. | ||
{{#dpl: | {{#dpl: | ||
Revision as of 17:06, 9 March 2012
| This page is related to Summer of Code 2012 |
| See the list of Summer of Code 2012 Ideas |
| This is a Summer of Code 2012 Idea |
Description
AI: Refactor recruitment algorithm
Page for the idea: SoC_Ideas_AI_Recruitment_2012
We need to refactor existing wesnoth's recruitment algorithm to:
- support recruiting with multiple leaders.
- support per-leader recruit/recall lists.
- support easy limiting of recruitable units.
- analyze map terrain better
- recruit units that are more useful
- improve counter-recruiting strategies.
- improve recruiting for AI-playable campaigns where AI has to not spend all the gold.
There are no student proposals for this idea
Additional Information
Recruiting is important for both player and AI. Units are recruited each turn.
We now have an implementation of recruiting routine, which tries to recruit units which are good in combat against units already in the field, taking into account the entire map. But, there are a number of issues, and we want to solve them.
1) AI only uses first leader to recruit - but, if there are multiple leaders, it might be useful to recruit with all of them.
2) AI cannot use per-leader recruit lists - but, leaders can have unique recruit lists (ask fendin about this feature).
3) Scenario editors want the AI recruit all units or most of the units, even if some of them might seem suboptimal from 'combat' point of view, but, as AI only considers combat/movement 'for the entire map', it might miss units which seem suboptimal. An example situation is where a unit has a specific role in the strategy, serving as auxiliary unit or as a hard counter to some specific opponent unit.
4) One of the tool that scenario editors usually use to make the AI recruit more diverse units (and also for limiting difficulty), is limiting the number of concurrent recruits of specific type in the field. Now they are doing it via a WML macro - it's better if recruiting would allow parameterization, allowing scenario creators to easily specify some 'what to recruit' hints and limitations. An example would be 'consider recruiting water-based because I want this leader to control the waterways' or 'recruit enough scouts in the first three turns because I want the AI to start capturing more villages early'. The optimal number of scouts varies with the map, of course.
5) This leads to another problem - if AI recruits some units thinking of particular purpose, it must use them properly - i.e., if a fish is recruited, it should not be used to move it to land to fight - otherwise, it makes little sense to recruit the fish in the first place'
6) Several years ago we tried an approach where the AI was finding 'most important' hexes on map and using the terrain on those hexes to affect it's recruitment patterns (instead of using the entire map)
7) Recruiting first is a huge disadvantage, because of possibility to recruit counters to enemy units. So, if the AI recruits first, it should recruit to minimize the potential for counter-recruiting (i.e., by making a balanced army which can't be hard countered by enemy potential recruits)
8) Sometimes it makes sense to hold back and not recruit even if gold is available - for example, if you're playing a campaign and current scenario is already 'beaten', or if you're waiting for the enemy to recruit units to counter them. This makes sense for the AI which usually defends and which usually wins if time runs out - so, the AI can afford to let the player come to it's position, so, it can afford to recruit some scouts and wait for the human to approach before committing to specific types of units. Also, AI has problems with grouping units so if units are recruited one-by-one, they would be would not be sent in a group.
Whom to ask about this
Crab_ on irc.