SoC Ideas AI Defense Strategies 2013
| This is a Summer of Code 2013 Idea |
Description
AI: Implement a 'total defense' strategy
Page for the idea: SoC Ideas AI Defense Strategies 2013
AI in wesnoth's is good at killing things but is bad at defending. Therefore we are forced to make it attack at 2:1 odds. This is the single biggest limiter of the AI skill at the moment. To solve that, we need to teach the AI to defend.
Suggested skills: C++, knowledge of wesnoth's gameplay (can be learned during the project)
There are no student proposals for this idea
Additional Information
Currently, the aim is to maximize (enemy losses - aggression*own_losses), where aggression is currently set to 0.4 by default. Teaching the AI to defend would allow us to lower the default aggression value. If we can bring the aggression value close to 0, the problem would be solved.
What would happen if we set aggression to 0 now? AI would only do the attacks which are 'good at killing things', but would not do the attacks, leaving only several units on the frontline. Moreover, the formula max(enemy_losses - aggression*own_losses) is broken, because it does not consider next_turn retaliation properly. A correct (but not calculable) formula would be max(enemy_losses_defending - aggression*own_losses_attacking - aggression*own_losses_next_turn + enemy_losses_attacking_next_turn + enemy_losses_defending_in_two_turns - aggression*own_losses_attacking_in_two_turns - … ). It's not calculable because we can't predict all the turns in advance with any degree of confidence. However, if we take the *next* turn into account better, then the AI would be able to play in styles other than 'all-out-attack' - because, if you take next turn into account, it makes sense to form defensive lines, block enemy units from reaching your vulnerable units, etc.
First steps
If you haven't played Wesnoth yet, play one-on-one vs AI, to learn the game rules and to observe how AI plays its turn and selects attacks.
Change default aggression (by modifying the text file data/ai/utils/default_config.cfg , changing {DEFAULT_ASPECT_VALUE aggression 0.4} to other values like 1.0 or 0.1 or -0.5) and observe results
Also, set up everything that is required to compile Wesnoth from source.
Whom to ask about this
Crab_ on irc.