Difference between revisions of "SoC Ideas LuaAI 2011"
m |
m (→Description) |
||
Line 6: | Line 6: | ||
More info at [[SoC_Ideas_LuaAI_2011]] | More info at [[SoC_Ideas_LuaAI_2011]] | ||
− | It is very important for Wesnoth to have a way of scripting AI without modifying the c++ source code. Some time ago, it was possible to use Python to code AIs, but it was removed due to security issues. Now, we | + | It is very important for Wesnoth to have a way of scripting AI without modifying the c++ source code. Some time ago, it was possible to use Python to code AIs, but it was removed due to security issues. Now, we have added Lua as a new way to script AI. The core capabilities were already added, but we need to integrate Lua AI scripts better. |
Wesnoth AI consists of different components. each component is a c++ object, which provides an interface to allow the ai to delegate part of the turn sequence to that c++ object. but, that c++ object can be a proxy for code written in different language, such as formula_ai or lua. So, we have a lua engine - a c++ class which is responsible with creating c++ proxies for lua code snippets. this lua engine must provide access to all the information that the c++ AI knows - caches like 'attacks' and 'possible moves', values of aspects such as 'aggression' and 'caution', etc. So, there's a large number of AI support functions which we need to expose to lua code. | Wesnoth AI consists of different components. each component is a c++ object, which provides an interface to allow the ai to delegate part of the turn sequence to that c++ object. but, that c++ object can be a proxy for code written in different language, such as formula_ai or lua. So, we have a lua engine - a c++ class which is responsible with creating c++ proxies for lua code snippets. this lua engine must provide access to all the information that the c++ AI knows - caches like 'attacks' and 'possible moves', values of aspects such as 'aggression' and 'caution', etc. So, there's a large number of AI support functions which we need to expose to lua code. |
Revision as of 21:43, 8 March 2011
This page is related to Summer of Code 2011 |
See the list of Summer of Code 2011 Ideas |
This is a Summer of Code 2011 Idea |
Contents
Description
Extend Wesnoth's Lua AI support and improve Wesnoth's AI
More info at SoC_Ideas_LuaAI_2011
It is very important for Wesnoth to have a way of scripting AI without modifying the c++ source code. Some time ago, it was possible to use Python to code AIs, but it was removed due to security issues. Now, we have added Lua as a new way to script AI. The core capabilities were already added, but we need to integrate Lua AI scripts better.
Wesnoth AI consists of different components. each component is a c++ object, which provides an interface to allow the ai to delegate part of the turn sequence to that c++ object. but, that c++ object can be a proxy for code written in different language, such as formula_ai or lua. So, we have a lua engine - a c++ class which is responsible with creating c++ proxies for lua code snippets. this lua engine must provide access to all the information that the c++ AI knows - caches like 'attacks' and 'possible moves', values of aspects such as 'aggression' and 'caution', etc. So, there's a large number of AI support functions which we need to expose to lua code.
There are no submitted student proposals for this idea
Implementation plan
To quote from Alpha Centauri, "Technological advance is an inherently iterative process. One does not simply take sand from the beach and produce a Dataprobe. We use crude tools to fashion better tools, and then our better tools to fashion more precise tools, and so on. Each minor refinement is a step in the process, and all of the steps must be taken. ".
- So, we firstly want to expose existing c++ things to lua.
- Then, we want to build a lua-based 'wesnoth lua ai standard library', a library of functions useful to ai developer.
- Then, we want to build a library of high-level functions which will be directly usable by scenario developer, with the level of complexity like 'drop this 1-line macro here, set this unit variable there, and voila - the unit is now controlled by lua ai according to your wishes'
- example of such behavior are 'patrol', 'retreat', and 'guard' behaviors
- then, we want to improve the ai directly, areas like recruiting with multiple leaders, actually defending something, handling concepts like leadership,skirmish, illuminate, and other, even, created-from-WML, concepts
- then, we want to make sure that multiple ais can coordinate between themselves, and stick to a certain strategy in battle,as determined by situation and whims of scenario creator
Useful links
Definition of Done
all information that is possible to use in c++ AI, is possible to use in Lua AI with relatively same level of complexity for AI author.
Whom to ask about this
Ask Crab_ on #wesnoth-dev
Possible pre-gsoc tasks
We want to make it easy to write Lua AI. the best way to ensure that is to try to write some AI components, and see what's easy, what's hard, and what's missing. So, here are a few things that can be done to get you started and to allow to code some useful lua/c++ code which can be included in wesnoth lua ai standard library.
- Write the AI which can complete Scenario 1 of the Heir to the Throne campaign on easy difficulty.
- Write the AI which can complete Scenario 1 of Legend of Wesmere campaign on easy difficulty.
- Write the AI which can complete Scenario 1 of The Hammer of Thursagan campaign on easy difficulty.
- Write a recruitment procedure for the AI which uses with multiple leaders intelligently
- Write a system to attach 'behavior instructions written in lua' to specific units
- Write a patrol formula in Lua
- Write a basic attack routine in Lua, make it possible to inject the 'rate attack combination' function into it.
- Re-implement useful formula ai functions in lua.