Difference between revisions of "SummerOfCodeProposal AI Improvement Crab AI Game Rules"

From The Battle for Wesnoth Wiki
m
m
Line 40: Line 40:
 
--
 
--
  
return back to [[SummerOfCodeProposal_AI_Improvement_Crab|Summer Of Code Proposal of Crab]]
+
return back to [[SummerOfCodeProposal_AI_Improvement_Crab#AI_Module|Summer Of Code Proposal of Crab]]

Revision as of 22:04, 2 April 2009

We need to extract all pieces of code which "answer questions about game rules". These functions are fundamentally different with functions which make "decisions" and "evaluations". Because a question about game rules has only one correct answer (although, given the random nature of wesnoth, those can represent

This will allow us to remove duplication from the code and allow us to plug-in a layer between "game rules" and the "AI" called "AIs perception of the game rules" This will allow us to give scenario designers an easy-to-use tool to tune the AI behavior.

Some of the most important game rules that can be tuned to achieve flavor-effects are :

Terrain defense value

[ai]
  [perception]
     [filter]
         [filter_location]
             terrain=Gs^Fp
         [/filter_location]
     [/filter]
     my_defence_bonus=-40%
  [/perception]
[/ai]

With such an simple code (no formulas to write! and very easy to understand the effect), a scenario designer will be able to make the AI think that his units have -40% defence in forests on grass, and plan its actions accordingly.

Luck factor

[ai]
  [perception]
     [filter]
            (terrain or unit filter)
     [/filter]
     optimism = 0.2;
  [/perception]
[/ai]

And, the ai would over(under) estimate his luck (It will think that the RNG will roll better than usual and calculate accordingly)

Poison duration

[ai]
  [perception]
     poison_duration = 3;
  [/perception]
[/ai]

And, the AI will thing that it will take 3 turns for the enemy to cure init from poison, on average (this will affect some attack-related estimates)


--

return back to Summer Of Code Proposal of Crab