Difference between revisions of "SoC Ideas Lua AI"

From The Battle for Wesnoth Wiki
m
(described)
Line 5: Line 5:
  
 
=Additional information=
 
=Additional information=
 +
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're adding 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.
  
 
=Definition of Done=
 
=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.
 
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.

Revision as of 22:04, 3 March 2010


This page is related to Summer of Code 2010
See the list of Summer of Code 2010 Ideas



This is a Summer of Code 2010 Idea


Description

Extend Wesnoth Lua AI Support

Lua AI support was recently added to wesnoth. Expose c++ AI support functions that wesnoth has, to Lua.

Additional information

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're adding 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.

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.