FormulaAIandDynamicScripting

From The Battle for Wesnoth Wiki
Revision as of 01:16, 18 March 2008 by Dhains (talk | contribs) (Added some more details)

These is a *very* rough outline of some ideas I have for the AI improvement. I'm pretty much open to any suggestions but this outlines what I had in mind, giving the AI some adaptive capability and seems to mesh well with the idea of making the AI tunable by scenario designers and for all out combat.

Formula AI

Formula AI will be used for designing the AI rulebases described below. A rulebase can be thought of as a set of rules containing formula AI for some behavior. These rulebases can then be associated with units. Much of the work will be defining what these rulebases will be and implementing them in Formula AI. I would imagine there will be some back and forth between implementing rulebases in FormulaAI and extending Formula AI when additional functionality needs to be added. These two things will probably be two thirds of the project.

Rulebases

I am thinking of the relationship between rulebases and units similar to object oriented programming in C++. That is a unit inherits predefined rulebases which will dictate that unit's behavior. Unit's can then be associated with very general behaviors, such as 'aggressive', 'defensive', etc. which are overall strategies for the units as well as more specific rulebases which supply unit specific behavior, such as a faction vs faction.

The rulebases will also be parameterized to allow for as much reuse as possible. So for instance, a scenario designer could associate wolf riders with and aggressive rulebase as well as a faction vs faction rulebase parameterized for elves. This would give the designer's wolf riders a behavior biased towards aggressively attacking elves. Futhermore, general strategy rulebases which govern all units can also be applied, so the designer could apply a global rulebase tuned towards killing the opponents leader.


Dynamic Scripting

I was hoping to apply some machine learning concepts to the AI, specifically online learning. Online learning allows the AI to adapt it's strategy to fix holes being exploited by the human player and over all to perform more intelligently, giving the player a feeling he or she is playing against a thinking, clever opponent.

One method that seems quite suitable is dynamic scripting. This method relies on a manually designed rulebase from which the AI can construct moves. Each rule in the rulebase has an associated weight which influences the probability of a given rule being used in an upcoming move. As a game progresses, the weights are updated automatically according to the success or failure of the rules in the past of the current game (or campaign). This would allow the AI to adapt to a player's tactics and encourage the player to develop diverse strategies for use in campaign mode.


Related Papers

Online Adaptation of Game Opponent AI in Simulation and in Practice, Spronk et al. [1]