<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wesnoth.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alesis-Novik</id>
	<title>The Battle for Wesnoth Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wesnoth.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alesis-Novik"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/Special:Contributions/Alesis-Novik"/>
	<updated>2026-05-01T14:05:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25290</id>
		<title>FormulaAIandAdaptation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25290"/>
		<updated>2008-04-12T00:28:07Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: /* Timeline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Personal Information==&lt;br /&gt;
I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest in AI and plan to work on that in the near future and I am eager to learn. Out of the more interesting things that I have programmed I could point out an algorithmic, non-bruteforce SuDoku solver, a Mastermind solver and a Java 3d pipeline.&lt;br /&gt;
&lt;br /&gt;
==The Idea==&lt;br /&gt;
Create a FormulaAI based AI for Wesnoth. Write additional FormulaAI syntax if needed for a better AI. Provide the non-programmer users a simple way to define special characteristics of the AI that would override the default AI preferences (for example make a certain story unit behave in some specific way).&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
After the discussions about the AI on the IRC, I was reading up and thought about an, in my opinion, interesting approach to the problem. First of all, from playing the game and talking to other player (done before summer begins) we get the idea of tactics and ideas they use while playing. We also need to make the AI be able to add to the tactic and strategy base on its own considering the outcome of each move. Obviously, with the mass of the possible options in the game, the full base would never be completed, so we need to use another method to ensure the effect. The AI would not only have the information on the tactics, but a large base of environment relations (like how one unit scales with the other and the land effect on them). Based on the current case, the strategy and tactics base and the world information it would compare and scale how close to a successful plan it can get from the current state, a similarity engine, if you will (for example, if one powerful unit could defeat the enemy, and we have two weaker units, maybe their combined power can defeat the enemy too). This type of strategy is a valid option in a TBS AI development and was used in other games like Civilization. Of course, there will always be some uncertainty, and that will be solved with probabilistic reasoning.&lt;br /&gt;
===The Case (Strategy and tactics) base===&lt;br /&gt;
This would be the plan and strategy base, updated on each action taken. The base plans and tactics would be inserted from user experience. The others the AI would formulate itself, with probability of success. After setting the major goal, such as defence or attack, the AI could use genetic algorithms to evaluate or create the best plan. Since the variations are too great, there would be an iteration limit set (this could also relate to difficulty: the harder the opponent, the more iterations).&lt;br /&gt;
===The Knowledge Base===&lt;br /&gt;
This would hold the information on every aspect of the game and would be updated with user created content as available. For example it would know that some two units are both archers, along with their statistics. This is quite straight forward: arrays of information on units (probably split into logical groups) with connections between (so we can select healers from elves or elves from healers, depending on how we sort them. The knowledge base would also hold information on terrain effects on units. After seeing the source, I would say that something as simple as a vector of simplified unit_stats would be able to hold the information on the units. The information on units can be collected from the unit .cfg files, and accessed easily from any other AI class (most importantly the similarity engine). There vectors could be grouped, making them specialized for certain unit groups, as I mentioned. The knowledge base would have information on the relations between those groups.&lt;br /&gt;
&lt;br /&gt;
===The Similarity Engine===&lt;br /&gt;
This would compare the existing plans to the available resources and choose the best solution. For example, if we know that two fighters can defeat an enemy, it scales what are the chances of, lets say a fighter and a healer or two rangers. It wouldn't chose what looks closer, but what *looks  better* (lets say in this case, the two rangers). Simple evaluation function could look something like (unit.hitpoints/hitpoints_in_plan * i + unit.damage/damage_in_plan * j) where i and j would be based on priorities (to survive or to do more damage)&lt;br /&gt;
===Summary===&lt;br /&gt;
The basic work flow of the AI engine would be something like this: the AI evaluates the situation it is currently in and checks the goals set to it (so it doesn't go offensive if it has to defend). After that, the possible plan from the case base is selected by looking at the position the AI is in. If the plan doesn't fit in the current situation perfectly (which would rarely be the case), the AI calls the similarity engine to evaluate the closest plan that can be produced with the resources available. This would include accessing the knowledge base and checking how close the units look like each other. The AI will be able to calculate possible outcome of the knew plan and discard it, if it would prove totally useless. The process would then be repeated (the best possible plan would in the end be selected (there is an option of recombination of the plans to produce a greater effect and a better plan))&lt;br /&gt;
&lt;br /&gt;
==Timeline==&lt;br /&gt;
*Until May 26: The first part would be to integrate the knowledge base to the AI, since it would need grouping and connections.&lt;br /&gt;
*May 26 - July 7: The second part would be to write a case base so it could store plans and create new plans, along with the probability of success. Since this would include the most communication with players, I believe getting this working and filling it would take most of the time until midterm.&lt;br /&gt;
*July 7 - August 18: The third part would be to write effective evaluation functions along with a probability engine to calculate success rate of possible plans. This may be done by using the Monte Carlo method (it is used when there are large arrays of data and discreet calculations are impossible). After writing this, the testing would begin, trying to see how the new AI scales with the old one.&lt;br /&gt;
&lt;br /&gt;
==Overall==&lt;br /&gt;
The result should be an AI with both overall and detailed customization (e.g. overall would be aggressive or defensive and detailed would be guarding or assassinating) and adaptiveness to new strategic plans and user created content.&lt;br /&gt;
&lt;br /&gt;
==Commits==&lt;br /&gt;
*An additional formula to get close enemies and functions in pathutil for close tiles selection[http://svn.gna.org/viewcvs/wesnoth?rev=25349&amp;amp;view=rev]&lt;br /&gt;
*An additional formula to get the possible battle outcomes [http://svn.gna.org/viewcvs/wesnoth?rev=25641&amp;amp;view=rev]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
On a side note, I'd like to say that I am really interested in game development and would gladly continue working on Wesnoth after Google Summer of Code. Also, the reason why I can't contribute much now is that I have to attend the university and we are having some midterm exams, so I need to study a bit.&lt;br /&gt;
[[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25289</id>
		<title>FormulaAIandAdaptation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25289"/>
		<updated>2008-04-12T00:25:33Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: /* The Knowledge Base */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Personal Information==&lt;br /&gt;
I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest in AI and plan to work on that in the near future and I am eager to learn. Out of the more interesting things that I have programmed I could point out an algorithmic, non-bruteforce SuDoku solver, a Mastermind solver and a Java 3d pipeline.&lt;br /&gt;
&lt;br /&gt;
==The Idea==&lt;br /&gt;
Create a FormulaAI based AI for Wesnoth. Write additional FormulaAI syntax if needed for a better AI. Provide the non-programmer users a simple way to define special characteristics of the AI that would override the default AI preferences (for example make a certain story unit behave in some specific way).&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
After the discussions about the AI on the IRC, I was reading up and thought about an, in my opinion, interesting approach to the problem. First of all, from playing the game and talking to other player (done before summer begins) we get the idea of tactics and ideas they use while playing. We also need to make the AI be able to add to the tactic and strategy base on its own considering the outcome of each move. Obviously, with the mass of the possible options in the game, the full base would never be completed, so we need to use another method to ensure the effect. The AI would not only have the information on the tactics, but a large base of environment relations (like how one unit scales with the other and the land effect on them). Based on the current case, the strategy and tactics base and the world information it would compare and scale how close to a successful plan it can get from the current state, a similarity engine, if you will (for example, if one powerful unit could defeat the enemy, and we have two weaker units, maybe their combined power can defeat the enemy too). This type of strategy is a valid option in a TBS AI development and was used in other games like Civilization. Of course, there will always be some uncertainty, and that will be solved with probabilistic reasoning.&lt;br /&gt;
===The Case (Strategy and tactics) base===&lt;br /&gt;
This would be the plan and strategy base, updated on each action taken. The base plans and tactics would be inserted from user experience. The others the AI would formulate itself, with probability of success. After setting the major goal, such as defence or attack, the AI could use genetic algorithms to evaluate or create the best plan. Since the variations are too great, there would be an iteration limit set (this could also relate to difficulty: the harder the opponent, the more iterations).&lt;br /&gt;
===The Knowledge Base===&lt;br /&gt;
This would hold the information on every aspect of the game and would be updated with user created content as available. For example it would know that some two units are both archers, along with their statistics. This is quite straight forward: arrays of information on units (probably split into logical groups) with connections between (so we can select healers from elves or elves from healers, depending on how we sort them. The knowledge base would also hold information on terrain effects on units. After seeing the source, I would say that something as simple as a vector of simplified unit_stats would be able to hold the information on the units. The information on units can be collected from the unit .cfg files, and accessed easily from any other AI class (most importantly the similarity engine). There vectors could be grouped, making them specialized for certain unit groups, as I mentioned. The knowledge base would have information on the relations between those groups.&lt;br /&gt;
&lt;br /&gt;
===The Similarity Engine===&lt;br /&gt;
This would compare the existing plans to the available resources and choose the best solution. For example, if we know that two fighters can defeat an enemy, it scales what are the chances of, lets say a fighter and a healer or two rangers. It wouldn't chose what looks closer, but what *looks  better* (lets say in this case, the two rangers). Simple evaluation function could look something like (unit.hitpoints/hitpoints_in_plan * i + unit.damage/damage_in_plan * j) where i and j would be based on priorities (to survive or to do more damage)&lt;br /&gt;
===Summary===&lt;br /&gt;
The basic work flow of the AI engine would be something like this: the AI evaluates the situation it is currently in and checks the goals set to it (so it doesn't go offensive if it has to defend). After that, the possible plan from the case base is selected by looking at the position the AI is in. If the plan doesn't fit in the current situation perfectly (which would rarely be the case), the AI calls the similarity engine to evaluate the closest plan that can be produced with the resources available. This would include accessing the knowledge base and checking how close the units look like each other. The AI will be able to calculate possible outcome of the knew plan and discard it, if it would prove totally useless. The process would then be repeated (the best possible plan would in the end be selected (there is an option of recombination of the plans to produce a greater effect and a better plan))&lt;br /&gt;
&lt;br /&gt;
==Timeline==&lt;br /&gt;
*The first part would be to integrate the knowledge base to the AI, since it would need grouping and connections. This part could be done prior to the beginning of the official coding start.&lt;br /&gt;
*The second part would be to write a case base so it could store plans and create new plans, along with the probability of success. Since this would include the most communication with players, I believe getting this working and filling it would take most of the time until midterm.&lt;br /&gt;
*The third part would be to write effective evaluation functions along with a probability engine to calculate success rate of possible plans. This may be done by using the Monte Carlo method (it is used when there are large arrays of data and discreet calculations are impossible). After writing this, the testing would begin, trying to see how the new AI scales with the old one.&lt;br /&gt;
&lt;br /&gt;
==Overall==&lt;br /&gt;
The result should be an AI with both overall and detailed customization (e.g. overall would be aggressive or defensive and detailed would be guarding or assassinating) and adaptiveness to new strategic plans and user created content.&lt;br /&gt;
&lt;br /&gt;
==Commits==&lt;br /&gt;
*An additional formula to get close enemies and functions in pathutil for close tiles selection[http://svn.gna.org/viewcvs/wesnoth?rev=25349&amp;amp;view=rev]&lt;br /&gt;
*An additional formula to get the possible battle outcomes [http://svn.gna.org/viewcvs/wesnoth?rev=25641&amp;amp;view=rev]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
On a side note, I'd like to say that I am really interested in game development and would gladly continue working on Wesnoth after Google Summer of Code. Also, the reason why I can't contribute much now is that I have to attend the university and we are having some midterm exams, so I need to study a bit.&lt;br /&gt;
[[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25151</id>
		<title>FormulaAIandAdaptation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25151"/>
		<updated>2008-04-08T01:35:06Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: /* Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Personal Information==&lt;br /&gt;
I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest in AI and plan to work on that in the near future and I am eager to learn. Out of the more interesting things that I have programmed I could point out an algorithmic, non-bruteforce SuDoku solver, a Mastermind solver and a Java 3d pipeline.&lt;br /&gt;
&lt;br /&gt;
==The Idea==&lt;br /&gt;
Create a FormulaAI based AI for Wesnoth. Write additional FormulaAI syntax if needed for a better AI. Provide the non-programmer users a simple way to define special characteristics of the AI that would override the default AI preferences (for example make a certain story unit behave in some specific way).&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
After the discussions about the AI on the IRC, I was reading up and thought about an, in my opinion, interesting approach to the problem. First of all, from playing the game and talking to other player (done before summer begins) we get the idea of tactics and ideas they use while playing. We also need to make the AI be able to add to the tactic and strategy base on its own considering the outcome of each move. Obviously, with the mass of the possible options in the game, the full base would never be completed, so we need to use another method to ensure the effect. The AI would not only have the information on the tactics, but a large base of environment relations (like how one unit scales with the other and the land effect on them). Based on the current case, the strategy and tactics base and the world information it would compare and scale how close to a successful plan it can get from the current state, a similarity engine, if you will (for example, if one powerful unit could defeat the enemy, and we have two weaker units, maybe their combined power can defeat the enemy too). This type of strategy is a valid option in a TBS AI development and was used in other games like Civilization. Of course, there will always be some uncertainty, and that will be solved with probabilistic reasoning.&lt;br /&gt;
===The Case (Strategy and tactics) base===&lt;br /&gt;
This would be the plan and strategy base, updated on each action taken. The base plans and tactics would be inserted from user experience. The others the AI would formulate itself, with probability of success. After setting the major goal, such as defence or attack, the AI could use genetic algorithms to evaluate or create the best plan. Since the variations are too great, there would be an iteration limit set (this could also relate to difficulty: the harder the opponent, the more iterations).&lt;br /&gt;
===The Knowledge Base===&lt;br /&gt;
This would hold the information on every aspect of the game and would be updated with user created content as available. For example it would know that some two units are both archers, along with their statistics. This is quite straight forward: arrays of information on units (probably split into logical groups) with connections between (so we can select healers from elves or elves from healers, depending on how we sort them. The knowledge base would also hold information on terrain effects on units. After seeing the source, I would say that something as simple as a vector of simplified unit_stats would be able to hold the information on the units. There vectors could be grouped, making them specialized for certain unit groups, as I mentioned. The knowledge base would have information on the relations between those groups.&lt;br /&gt;
===The Similarity Engine===&lt;br /&gt;
This would compare the existing plans to the available resources and choose the best solution. For example, if we know that two fighters can defeat an enemy, it scales what are the chances of, lets say a fighter and a healer or two rangers. It wouldn't chose what looks closer, but what *looks  better* (lets say in this case, the two rangers). Simple evaluation function could look something like (unit.hitpoints/hitpoints_in_plan * i + unit.damage/damage_in_plan * j) where i and j would be based on priorities (to survive or to do more damage)&lt;br /&gt;
===Summary===&lt;br /&gt;
The basic work flow of the AI engine would be something like this: the AI evaluates the situation it is currently in and checks the goals set to it (so it doesn't go offensive if it has to defend). After that, the possible plan from the case base is selected by looking at the position the AI is in. If the plan doesn't fit in the current situation perfectly (which would rarely be the case), the AI calls the similarity engine to evaluate the closest plan that can be produced with the resources available. This would include accessing the knowledge base and checking how close the units look like each other. The AI will be able to calculate possible outcome of the knew plan and discard it, if it would prove totally useless. The process would then be repeated (the best possible plan would in the end be selected (there is an option of recombination of the plans to produce a greater effect and a better plan))&lt;br /&gt;
&lt;br /&gt;
==Timeline==&lt;br /&gt;
*The first part would be to integrate the knowledge base to the AI, since it would need grouping and connections. This part could be done prior to the beginning of the official coding start.&lt;br /&gt;
*The second part would be to write a case base so it could store plans and create new plans, along with the probability of success. Since this would include the most communication with players, I believe getting this working and filling it would take most of the time until midterm.&lt;br /&gt;
*The third part would be to write effective evaluation functions along with a probability engine to calculate success rate of possible plans. This may be done by using the Monte Carlo method (it is used when there are large arrays of data and discreet calculations are impossible). After writing this, the testing would begin, trying to see how the new AI scales with the old one.&lt;br /&gt;
&lt;br /&gt;
==Overall==&lt;br /&gt;
The result should be an AI with both overall and detailed customization (e.g. overall would be aggressive or defensive and detailed would be guarding or assassinating) and adaptiveness to new strategic plans and user created content.&lt;br /&gt;
&lt;br /&gt;
==Commits==&lt;br /&gt;
*An additional formula to get close enemies and functions in pathutil for close tiles selection[http://svn.gna.org/viewcvs/wesnoth?rev=25349&amp;amp;view=rev]&lt;br /&gt;
*An additional formula to get the possible battle outcomes [http://svn.gna.org/viewcvs/wesnoth?rev=25641&amp;amp;view=rev]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
On a side note, I'd like to say that I am really interested in game development and would gladly continue working on Wesnoth after Google Summer of Code. Also, the reason why I can't contribute much now is that I have to attend the university and we are having some midterm exams, so I need to study a bit.&lt;br /&gt;
[[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25150</id>
		<title>FormulaAIandAdaptation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25150"/>
		<updated>2008-04-08T01:27:03Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: /* Timeline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Personal Information==&lt;br /&gt;
I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest in AI and plan to work on that in the near future and I am eager to learn. Out of the more interesting things that I have programmed I could point out an algorithmic, non-bruteforce SuDoku solver, a Mastermind solver and a Java 3d pipeline.&lt;br /&gt;
&lt;br /&gt;
==The Idea==&lt;br /&gt;
Create a FormulaAI based AI for Wesnoth. Write additional FormulaAI syntax if needed for a better AI. Provide the non-programmer users a simple way to define special characteristics of the AI that would override the default AI preferences (for example make a certain story unit behave in some specific way).&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
After the discussions about the AI on the IRC, I was reading up and thought about an, in my opinion, interesting approach to the problem. First of all, from playing the game and talking to other player (done before summer begins) we get the idea of tactics and ideas they use while playing. We also need to make the AI be able to add to the tactic and strategy base on its own considering the outcome of each move. Obviously, with the mass of the possible options in the game, the full base would never be completed, so we need to use another method to ensure the effect. The AI would not only have the information on the tactics, but a large base of environment relations (like how one unit scales with the other and the land effect on them). Based on the current case, the strategy and tactics base and the world information it would compare and scale how close to a successful plan it can get from the current state, a similarity engine, if you will (for example, if one powerful unit could defeat the enemy, and we have two weaker units, maybe their combined power can defeat the enemy too). This type of strategy is a valid option in a TBS AI development and was used in other games like Civilization. Of course, there will always be some uncertainty, and that will be solved with probabilistic reasoning.&lt;br /&gt;
===The Case (Strategy and tactics) base===&lt;br /&gt;
This would be the plan and strategy base, updated on each action taken. The base plans and tactics would be inserted from user experience. The others the AI would formulate itself, with probability of success. After setting the major goal, such as defence or attack, the AI could use genetic algorithms to evaluate or create the best plan. Since the variations are too great, there would be an iteration limit set (this could also relate to difficulty: the harder the opponent, the more iterations).&lt;br /&gt;
===The Knowledge Base===&lt;br /&gt;
This would hold the information on every aspect of the game and would be updated with user created content as available. For example it would know that some two units are both archers, along with their statistics. This is quite straight forward: arrays of information on units (probably split into logical groups) with connections between (so we can select healers from elves or elves from healers, depending on how we sort them. The knowledge base would also hold information on terrain effects on units. After seeing the source, I would say that something as simple as a vector of simplified unit_stats would be able to hold the information on the units. There vectors could be grouped, making them specialized for certain unit groups, as I mentioned. The knowledge base would have information on the relations between those groups.&lt;br /&gt;
&lt;br /&gt;
===The Similarity Engine===&lt;br /&gt;
This would compare the existing plans to the available resources and choose the best solution. For example, if we know that two fighters can defeat an enemy, it scales what are the chances of, lets say a fighter and a healer or two rangers. It wouldn't chose what looks closer, but what *looks  better* (lets say in this case, the two rangers). Simple evaluation function could look something like (unit.hitpoints/hitpoints_in_plan * i + unit.damage/damage_in_plan * j) where i and j would be based on priorities (to survive or to do more damage)&lt;br /&gt;
&lt;br /&gt;
==Timeline==&lt;br /&gt;
*The first part would be to integrate the knowledge base to the AI, since it would need grouping and connections. This part could be done prior to the beginning of the official coding start.&lt;br /&gt;
*The second part would be to write a case base so it could store plans and create new plans, along with the probability of success. Since this would include the most communication with players, I believe getting this working and filling it would take most of the time until midterm.&lt;br /&gt;
*The third part would be to write effective evaluation functions along with a probability engine to calculate success rate of possible plans. This may be done by using the Monte Carlo method (it is used when there are large arrays of data and discreet calculations are impossible). After writing this, the testing would begin, trying to see how the new AI scales with the old one.&lt;br /&gt;
&lt;br /&gt;
==Overall==&lt;br /&gt;
The result should be an AI with both overall and detailed customization (e.g. overall would be aggressive or defensive and detailed would be guarding or assassinating) and adaptiveness to new strategic plans and user created content.&lt;br /&gt;
&lt;br /&gt;
==Commits==&lt;br /&gt;
*An additional formula to get close enemies and functions in pathutil for close tiles selection[http://svn.gna.org/viewcvs/wesnoth?rev=25349&amp;amp;view=rev]&lt;br /&gt;
*An additional formula to get the possible battle outcomes [http://svn.gna.org/viewcvs/wesnoth?rev=25641&amp;amp;view=rev]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
On a side note, I'd like to say that I am really interested in game development and would gladly continue working on Wesnoth after Google Summer of Code. Also, the reason why I can't contribute much now is that I have to attend the university and we are having some midterm exams, so I need to study a bit.&lt;br /&gt;
[[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25149</id>
		<title>FormulaAIandAdaptation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25149"/>
		<updated>2008-04-08T01:23:37Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: /* The Knowledge Base */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Personal Information==&lt;br /&gt;
I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest in AI and plan to work on that in the near future and I am eager to learn. Out of the more interesting things that I have programmed I could point out an algorithmic, non-bruteforce SuDoku solver, a Mastermind solver and a Java 3d pipeline.&lt;br /&gt;
&lt;br /&gt;
==The Idea==&lt;br /&gt;
Create a FormulaAI based AI for Wesnoth. Write additional FormulaAI syntax if needed for a better AI. Provide the non-programmer users a simple way to define special characteristics of the AI that would override the default AI preferences (for example make a certain story unit behave in some specific way).&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
After the discussions about the AI on the IRC, I was reading up and thought about an, in my opinion, interesting approach to the problem. First of all, from playing the game and talking to other player (done before summer begins) we get the idea of tactics and ideas they use while playing. We also need to make the AI be able to add to the tactic and strategy base on its own considering the outcome of each move. Obviously, with the mass of the possible options in the game, the full base would never be completed, so we need to use another method to ensure the effect. The AI would not only have the information on the tactics, but a large base of environment relations (like how one unit scales with the other and the land effect on them). Based on the current case, the strategy and tactics base and the world information it would compare and scale how close to a successful plan it can get from the current state, a similarity engine, if you will (for example, if one powerful unit could defeat the enemy, and we have two weaker units, maybe their combined power can defeat the enemy too). This type of strategy is a valid option in a TBS AI development and was used in other games like Civilization. Of course, there will always be some uncertainty, and that will be solved with probabilistic reasoning.&lt;br /&gt;
===The Case (Strategy and tactics) base===&lt;br /&gt;
This would be the plan and strategy base, updated on each action taken. The base plans and tactics would be inserted from user experience. The others the AI would formulate itself, with probability of success. After setting the major goal, such as defence or attack, the AI could use genetic algorithms to evaluate or create the best plan. Since the variations are too great, there would be an iteration limit set (this could also relate to difficulty: the harder the opponent, the more iterations).&lt;br /&gt;
===The Knowledge Base===&lt;br /&gt;
This would hold the information on every aspect of the game and would be updated with user created content as available. For example it would know that some two units are both archers, along with their statistics. This is quite straight forward: arrays of information on units (probably split into logical groups) with connections between (so we can select healers from elves or elves from healers, depending on how we sort them. The knowledge base would also hold information on terrain effects on units. After seeing the source, I would say that something as simple as a vector of simplified unit_stats would be able to hold the information on the units. There vectors could be grouped, making them specialized for certain unit groups, as I mentioned. The knowledge base would have information on the relations between those groups.&lt;br /&gt;
&lt;br /&gt;
===The Similarity Engine===&lt;br /&gt;
This would compare the existing plans to the available resources and choose the best solution. For example, if we know that two fighters can defeat an enemy, it scales what are the chances of, lets say a fighter and a healer or two rangers. It wouldn't chose what looks closer, but what *looks  better* (lets say in this case, the two rangers). Simple evaluation function could look something like (unit.hitpoints/hitpoints_in_plan * i + unit.damage/damage_in_plan * j) where i and j would be based on priorities (to survive or to do more damage)&lt;br /&gt;
&lt;br /&gt;
==Timeline==&lt;br /&gt;
*The first part would be to integrate the knowledge base to the AI, since it would need grouping and connections.&lt;br /&gt;
*The second part would be to write a case base so it could store plans and create new plans, along with the probability of success.&lt;br /&gt;
*The third part would be to write effective evaluation functions along with a probability engine to calculate success rate of possible plans. This may be done by using the Monte Carlo method (it is used when there are large arrays of data and discreet calculations are impossible)&lt;br /&gt;
&lt;br /&gt;
==Overall==&lt;br /&gt;
The result should be an AI with both overall and detailed customization (e.g. overall would be aggressive or defensive and detailed would be guarding or assassinating) and adaptiveness to new strategic plans and user created content.&lt;br /&gt;
&lt;br /&gt;
==Commits==&lt;br /&gt;
*An additional formula to get close enemies and functions in pathutil for close tiles selection[http://svn.gna.org/viewcvs/wesnoth?rev=25349&amp;amp;view=rev]&lt;br /&gt;
*An additional formula to get the possible battle outcomes [http://svn.gna.org/viewcvs/wesnoth?rev=25641&amp;amp;view=rev]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
On a side note, I'd like to say that I am really interested in game development and would gladly continue working on Wesnoth after Google Summer of Code. Also, the reason why I can't contribute much now is that I have to attend the university and we are having some midterm exams, so I need to study a bit.&lt;br /&gt;
[[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25133</id>
		<title>FormulaAIandAdaptation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=25133"/>
		<updated>2008-04-06T20:50:12Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: /* Commits */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Personal Information==&lt;br /&gt;
I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest in AI and plan to work on that in the near future and I am eager to learn. Out of the more interesting things that I have programmed I could point out an algorithmic, non-bruteforce SuDoku solver, a Mastermind solver and a Java 3d pipeline.&lt;br /&gt;
&lt;br /&gt;
==The Idea==&lt;br /&gt;
Create a FormulaAI based AI for Wesnoth. Write additional FormulaAI syntax if needed for a better AI. Provide the non-programmer users a simple way to define special characteristics of the AI that would override the default AI preferences (for example make a certain story unit behave in some specific way).&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
After the discussions about the AI on the IRC, I was reading up and thought about an, in my opinion, interesting approach to the problem. First of all, from playing the game and talking to other player (done before summer begins) we get the idea of tactics and ideas they use while playing. We also need to make the AI be able to add to the tactic and strategy base on its own considering the outcome of each move. Obviously, with the mass of the possible options in the game, the full base would never be completed, so we need to use another method to ensure the effect. The AI would not only have the information on the tactics, but a large base of environment relations (like how one unit scales with the other and the land effect on them). Based on the current case, the strategy and tactics base and the world information it would compare and scale how close to a successful plan it can get from the current state, a similarity engine, if you will (for example, if one powerful unit could defeat the enemy, and we have two weaker units, maybe their combined power can defeat the enemy too). This type of strategy is a valid option in a TBS AI development and was used in other games like Civilization. Of course, there will always be some uncertainty, and that will be solved with probabilistic reasoning.&lt;br /&gt;
===The Case (Strategy and tactics) base===&lt;br /&gt;
This would be the plan and strategy base, updated on each action taken. The base plans and tactics would be inserted from user experience. The others the AI would formulate itself, with probability of success. After setting the major goal, such as defence or attack, the AI could use genetic algorithms to evaluate or create the best plan. Since the variations are too great, there would be an iteration limit set (this could also relate to difficulty: the harder the opponent, the more iterations).&lt;br /&gt;
===The Knowledge Base===&lt;br /&gt;
This would hold the information on every aspect of the game and would be updated with user created content as available. For example it would know that some two units are both archers, along with their statistics. This is quite straight forward: arrays of information on units (probably split into logical groups) with connections between (so we can select healers from elves or elves from healers, depending on how we sort them. The knowledge base would also hold information on terrain effects on units.&lt;br /&gt;
===The Similarity Engine===&lt;br /&gt;
This would compare the existing plans to the available resources and choose the best solution. For example, if we know that two fighters can defeat an enemy, it scales what are the chances of, lets say a fighter and a healer or two rangers. It wouldn't chose what looks closer, but what *looks  better* (lets say in this case, the two rangers). Simple evaluation function could look something like (unit.hitpoints/hitpoints_in_plan * i + unit.damage/damage_in_plan * j) where i and j would be based on priorities (to survive or to do more damage)&lt;br /&gt;
&lt;br /&gt;
==Timeline==&lt;br /&gt;
*The first part would be to integrate the knowledge base to the AI, since it would need grouping and connections.&lt;br /&gt;
*The second part would be to write a case base so it could store plans and create new plans, along with the probability of success.&lt;br /&gt;
*The third part would be to write effective evaluation functions along with a probability engine to calculate success rate of possible plans. This may be done by using the Monte Carlo method (it is used when there are large arrays of data and discreet calculations are impossible)&lt;br /&gt;
&lt;br /&gt;
==Overall==&lt;br /&gt;
The result should be an AI with both overall and detailed customization (e.g. overall would be aggressive or defensive and detailed would be guarding or assassinating) and adaptiveness to new strategic plans and user created content.&lt;br /&gt;
&lt;br /&gt;
==Commits==&lt;br /&gt;
*An additional formula to get close enemies and functions in pathutil for close tiles selection[http://svn.gna.org/viewcvs/wesnoth?rev=25349&amp;amp;view=rev]&lt;br /&gt;
*An additional formula to get the possible battle outcomes [http://svn.gna.org/viewcvs/wesnoth?rev=25641&amp;amp;view=rev]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
On a side note, I'd like to say that I am really interested in game development and would gladly continue working on Wesnoth after Google Summer of Code. Also, the reason why I can't contribute much now is that I have to attend the university and we are having some midterm exams, so I need to study a bit.&lt;br /&gt;
[[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAI&amp;diff=24997</id>
		<title>FormulaAI</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAI&amp;diff=24997"/>
		<updated>2008-03-31T18:24:49Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Wesnoth Formula AI is an attempt to develop an AI framework for Wesnoth that allows easy and fun development and modification of AIs for Wesnoth.&lt;br /&gt;
&lt;br /&gt;
Wesnoth already has support for AIs written in Python, but writing AIs in Python has a couple of problems:&lt;br /&gt;
&lt;br /&gt;
* it's still rather difficult, especially for a non-programmer, to develop an AI, even in Python&lt;br /&gt;
* Python is insecure; a malicious trojan horse Python script masquerading as an AI could do untold damage&lt;br /&gt;
&lt;br /&gt;
The Wesnoth Formula AI aims to create a fairly simple, pure functional language which allows one to implement an AI. It also aims to allow AIs to be tweaked and modified by people with relatively little technical skill; anyone who can use WML should also be able to use the Formula AI to tweak an AI to make the AI in a scenario behave how they want.&lt;br /&gt;
&lt;br /&gt;
The Wesnoth Formula AI is currently in an experimental stage of development. One can play with it and develop a rudimentary AI. Feedback is appreciated.&lt;br /&gt;
&lt;br /&gt;
To develop an AI using the Formula AI, set ai_algorithm=formula_ai in [side].&lt;br /&gt;
&lt;br /&gt;
== Approach ==&lt;br /&gt;
&lt;br /&gt;
To use the Formula AI, one should put an [ai] tag inside the [side] tag. Inside this [ai] tag, one should specify the 'move' attribute to be a formula which specifies what movement the AI will make. Each time it's the AI's move, this formula will be run, and the move it results in will be executed. Then the formula will be run again; it'll continue to be run until it stops producing a valid move, at which point the AI will end its turn. Alternatively there is a command that the formula may return which will make it end its turn immediately.&lt;br /&gt;
&lt;br /&gt;
A sample AI which does nothing but recruit Wolf Riders is as follows:&lt;br /&gt;
&lt;br /&gt;
 [side]&lt;br /&gt;
 ...&lt;br /&gt;
 ai_algorithm=formula_ai&lt;br /&gt;
   [ai]&lt;br /&gt;
   move=&amp;quot;recruit('Wolf Rider')&amp;quot;&lt;br /&gt;
   [/ai]&lt;br /&gt;
 [/side]&lt;br /&gt;
&lt;br /&gt;
== Formula Command Line ==&lt;br /&gt;
&lt;br /&gt;
To attempt to make it convenient to debug formulas, one can run formulas from within Wesnoth, and see the results. To run a formula, just start game and type 'f'. A command textbox will appear, where you can type a formula, and the results will be printed. For instance, typing&lt;br /&gt;
&lt;br /&gt;
 8 + 4 &lt;br /&gt;
&lt;br /&gt;
will result in &amp;quot;12&amp;quot; appearing on the screen. You can now use Wesnoth like a calculator. :-)&lt;br /&gt;
&lt;br /&gt;
== Formula Basics ==&lt;br /&gt;
&lt;br /&gt;
* The Formula language supports basic arithmetic operations, such as: +, -, *, /, % and ^. It supports integers but does NOT support decimal or floating point numbers. For example:&lt;br /&gt;
&lt;br /&gt;
 4 + 8*7     #evaluates to 60&lt;br /&gt;
 (4 + 8)*7   #evaluates to 84&lt;br /&gt;
 8 % 6       #evaluates to 2&lt;br /&gt;
 5 / 2       #evaluates to 2&lt;br /&gt;
 3 ^ 2       #evaluates to 9&lt;br /&gt;
&lt;br /&gt;
* It also supports equality, = and !=, and comparison operators, &amp;lt;, &amp;gt;, &amp;lt;=, and &amp;gt;=. 'false' values are 0 (integer) and null. Other values are true. It also supports common operators such as and, or, and not:&lt;br /&gt;
&lt;br /&gt;
 2 = 4     #evaluates to 0&lt;br /&gt;
 2 &amp;lt;= 3    #evaluates to 1&lt;br /&gt;
 0 != 1    #evaluates to 1&lt;br /&gt;
 not 4     #evaluates to 0&lt;br /&gt;
 not 0     #evaluates to 1&lt;br /&gt;
 (2 &amp;lt; 4) and (3 &amp;gt; 6)    #evaluates to 1 and 0 which evaluates to 0&lt;br /&gt;
 (2 &amp;lt; 4) or (3 &amp;gt; 6)     #evaluates to 1 or 0 which evaluates to 1&lt;br /&gt;
&lt;br /&gt;
* Formula language supports also 'dice' operator 'd'. Example usage is:&lt;br /&gt;
&lt;br /&gt;
 3d5&lt;br /&gt;
&lt;br /&gt;
Which will give you one of results of rolling three five-sided dice (so random number between 3 and 15).&lt;br /&gt;
&lt;br /&gt;
== Data Types ==&lt;br /&gt;
&lt;br /&gt;
Formula System supports different types of data, which can be stored as a variables and are used in evaluations:&lt;br /&gt;
&lt;br /&gt;
* Numbers: like 0, 1, 2 etc. Floating-point numbers are not supported. 0 is equal to logical 'false', any other number is 'true'.&lt;br /&gt;
&lt;br /&gt;
* Text strings: &lt;br /&gt;
&lt;br /&gt;
 'this is a text string' &lt;br /&gt;
&lt;br /&gt;
* Lists: A list is a sequence of values. For example, ai.my_units is a list of unit objects. A list is represented as square brackets, [], surrounding a comma-seperated list. For instance: &lt;br /&gt;
&lt;br /&gt;
 [4, 8, 7] &lt;br /&gt;
&lt;br /&gt;
is a list of three numbers, and &lt;br /&gt;
&lt;br /&gt;
 []&lt;br /&gt;
&lt;br /&gt;
is a empty list. Various functions can operate on lists.&lt;br /&gt;
&lt;br /&gt;
== AI Formula Language ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
The formula language must be able to access information about the scenario being played to make intelligent decisions. Thus there are various 'inputs' that one may access. A simple example of an input is the turn number one is on, given by the input, 'turn'. Try bringing up the formula command line using 'f' and then type in&lt;br /&gt;
&lt;br /&gt;
 turn&lt;br /&gt;
&lt;br /&gt;
The AI will print out the current turn number the game is on.&lt;br /&gt;
&lt;br /&gt;
The 'turn' input is a simple integer. However, some inputs are complex types which contain other inputs, or which may be lists of inputs. For instance, the input 'my_units' contains a list of all the AI's units.&lt;br /&gt;
&lt;br /&gt;
A complex input such as a unit will contain a variety of inputs inside it. If one has a unit input, called 'u' for instance, one can access the 'x' co-ordinate of that unit by using u.loc.x -- u.loc accesses the 'location' object inside the 'unit' object, and the 'location' object contains 'x' and 'y' inputs inside it, which are the x and y co-ordinate of the unit.&lt;br /&gt;
&lt;br /&gt;
=== Built-in functions ===&lt;br /&gt;
The formula language contains a large number of built-in functions which allow you to carry out all kinds of complex tasks. Syntax used to explain functions usage in this document is:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;result&amp;gt; = &amp;lt;function name&amp;gt;( &amp;lt;comma-separated list of parameters&amp;gt; [, &amp;lt;comma-separated list of optional parameters] )&lt;br /&gt;
&lt;br /&gt;
Function may return &amp;lt;result&amp;gt; as:&lt;br /&gt;
* &amp;lt;variable&amp;gt; - any of the supported variable types&lt;br /&gt;
* &amp;lt;boolean&amp;gt; - false ( 0 or null ) or true ( 1 )&lt;br /&gt;
* &amp;lt;unit&amp;gt; - unit&lt;br /&gt;
* &amp;lt;location&amp;gt; - place on a gamemap&lt;br /&gt;
* &amp;lt;action&amp;gt; - object, which, if later passed to 'move= ' as the result of formula evaluation, make the AI perform a desired action.&lt;br /&gt;
* &amp;lt;result&amp;gt; - any of the above&lt;br /&gt;
&lt;br /&gt;
Also function may return only single argument, or be able to return a whole list.&lt;br /&gt;
&lt;br /&gt;
There are a wide variety of functions which can be used to accomplish many different tasks. You can also [[#Custom Functions|define your own functions]]. &lt;br /&gt;
&lt;br /&gt;
==== 'attack' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;action&amp;gt; = attack( &amp;lt;attacker's position&amp;gt;, &amp;lt;destination&amp;gt;, &amp;lt;attack location&amp;gt; [,  &amp;lt;weapon&amp;gt; ] )&lt;br /&gt;
&lt;br /&gt;
The first three parameters are locations. At the begining, unit which is standing at &amp;lt;attacker's position&amp;gt; is moved to &amp;lt;destination&amp;gt; place. Then, from that place unit is attacking unit which stands in place marked by &amp;lt;attack location&amp;gt;. Fourth optional parameter is number, and indicates which weapon attacker should use - if not specified, best possible weapon is chosed automatically.&lt;br /&gt;
&lt;br /&gt;
==== 'abs' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;number&amp;gt; = abs( &amp;lt;input number&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
Function returns absolute value of an &amp;lt;input number&amp;gt;, for example&lt;br /&gt;
&lt;br /&gt;
 abs( -5 )&lt;br /&gt;
&lt;br /&gt;
will return 5.&lt;br /&gt;
&lt;br /&gt;
==== 'chance to hit' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;number&amp;gt; = chance_to_hit( &amp;lt;unit&amp;gt; , &amp;lt;location&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function returns how possible ( in % ) it is to hit given &amp;lt;unit&amp;gt; in a specific &amp;lt;location&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
 chance_to_hit( my_leader , my_leader.loc )&lt;br /&gt;
&lt;br /&gt;
shows how easy it is to hit your leader has in a place he is currently standing on.&lt;br /&gt;
&lt;br /&gt;
==== 'choose' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;result&amp;gt; = choose( &amp;lt;input list&amp;gt; , &amp;lt;formula&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function evaluates &amp;lt;formula&amp;gt; for each item in the &amp;lt;input list&amp;gt;. Will evaluate to the one item which &amp;lt;formula&amp;gt; gave the highest value. For example:&lt;br /&gt;
&lt;br /&gt;
 choose(my_units, level)&lt;br /&gt;
&lt;br /&gt;
gives back the unit with the highest level.&lt;br /&gt;
&lt;br /&gt;
==== 'close enemies' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;units list&amp;gt; = close_enemies( &amp;lt;location&amp;gt; , &amp;lt;distance&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function gets a list of enemies in the given or smaller distance from the location. For example:&lt;br /&gt;
&lt;br /&gt;
 close_enemies(loc(10,10), 5)&lt;br /&gt;
&lt;br /&gt;
gives back a list of enemies in the distance of 5 tiles or less from the tile (10, 10).&lt;br /&gt;
&lt;br /&gt;
==== 'dir' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;list of names&amp;gt; = dir ( &amp;lt;input object&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function return list with all names of &amp;lt;input object's&amp;gt; members. For example:&lt;br /&gt;
&lt;br /&gt;
 dir( my_leader )&lt;br /&gt;
&lt;br /&gt;
will result in output:&lt;br /&gt;
&lt;br /&gt;
 [ 'x', 'y', 'loc', 'id', 'leader', 'hitpoints', 'max_hitpoints', 'experience', 'max_experience', 'level',&lt;br /&gt;
 'total_movement', 'movement_left', 'side', 'is_enemy', 'is_mine']&lt;br /&gt;
&lt;br /&gt;
This command is useful in formula command line, to get information about members of different type of data. To get list of members of the ai, type:&lt;br /&gt;
&lt;br /&gt;
 dir( self )&lt;br /&gt;
&lt;br /&gt;
==== 'distance_between' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;number&amp;gt; = distance_between( &amp;lt;location A&amp;gt; , &amp;lt;location B&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function returns distance (in hexes) between &amp;lt;location A&amp;gt; and &amp;lt;location B&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
 distance_between( loc( 1, 1) , loc( 3, 3) )&lt;br /&gt;
&lt;br /&gt;
will return 3.&lt;br /&gt;
&lt;br /&gt;
==== 'distance_to_nearest_unowned_village' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;number&amp;gt; = distance_to_nearest_unowned_village( &amp;lt;location A&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function returns distance (in hexes) between &amp;lt;location A&amp;gt; and nearest unowned village.&lt;br /&gt;
&lt;br /&gt;
==== 'defense_on' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;number&amp;gt; = defense_on( &amp;lt;unit&amp;gt; , &amp;lt;location&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function returns defense rate of given &amp;lt;unit&amp;gt; in a specific &amp;lt;location&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
 defense_on( my_leader , my_leader.loc )&lt;br /&gt;
&lt;br /&gt;
shows how good defense your leader has in a place he is currently standing on.&lt;br /&gt;
&lt;br /&gt;
==== 'evaluate_for_position' function ====&lt;br /&gt;
&lt;br /&gt;
==== 'fallback' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;action&amp;gt; = fallback( &amp;lt;name&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function allows to chose different AI which will take control over side untill the end of current turn. For example:&lt;br /&gt;
&lt;br /&gt;
 fallback( 'default' )&lt;br /&gt;
&lt;br /&gt;
will transfer control to the default C++ AI.&lt;br /&gt;
&lt;br /&gt;
==== 'filter' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;reult list&amp;gt; = filter( &amp;lt;input list&amp;gt;, &amp;lt;formula&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function will run &amp;lt;formula&amp;gt; on each item in the &amp;lt;input list&amp;gt;. Will evaluate to a &amp;lt;result list&amp;gt; which only contains items the &amp;lt;formula&amp;gt; was true for. For example:&lt;br /&gt;
&lt;br /&gt;
 filter(my_units, hitpoints &amp;lt; max_hitpoints)&lt;br /&gt;
&lt;br /&gt;
will return all of your units which have less than maximum hitpoints. For instance this could be used if looking for candidates for healing.&lt;br /&gt;
&lt;br /&gt;
==== 'find' function ====&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;result&amp;gt; = find( &amp;lt;input list&amp;gt;, &amp;lt;formula&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function will run &amp;lt;formula&amp;gt; on each item in the &amp;lt;input list&amp;gt; and will return a first item for which &amp;lt;formula&amp;gt; was true. For example:&lt;br /&gt;
&lt;br /&gt;
 filter(units, id = 'Elvish Archer' )&lt;br /&gt;
&lt;br /&gt;
will return first unit with id equal to 'Elvish Archer'.&lt;br /&gt;
&lt;br /&gt;
==== 'head' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;variable&amp;gt; = head( &amp;lt;list of variables&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
Head returns first item from the &amp;lt;list of variables&amp;gt;, for example&lt;br /&gt;
&lt;br /&gt;
 head( [ 5, 7, 9] )            #returns 5&lt;br /&gt;
 head( [ 'Orc', 'Human' ] )    #returns 'Orc'&lt;br /&gt;
&lt;br /&gt;
==== 'is_village' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;boolean&amp;gt; = is_village( &amp;lt;map or ai.map&amp;gt; , &amp;lt;location&amp;gt; )   #1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;boolean&amp;gt; = is_village( &amp;lt;map or ai.map&amp;gt; , &amp;lt;coordinate x&amp;gt; , &amp;lt;coordinate y&amp;gt; )   #2&lt;br /&gt;
&lt;br /&gt;
The first argument is always a 'map' - member of the ai which provides information about the gamemap.&lt;br /&gt;
&lt;br /&gt;
In #1 usage, we put in as a second argument location. In #2, second and third arguments are numbers: coordniates of the certain hex on a map. Function checks if that place is a village, and returns either 1 (yes, it is village) or 0 (no, it isn't village). Example of usage:&lt;br /&gt;
&lt;br /&gt;
 is_village( map , loc( 2, 3) )&lt;br /&gt;
&lt;br /&gt;
 is_village( map , 2, 3)&lt;br /&gt;
&lt;br /&gt;
Both check, if hex with coordinates 2,3 is a village.&lt;br /&gt;
&lt;br /&gt;
Remember, when using is_village in custom function, you either have to access map by writing 'ai.map', or specify ai as a 'default input'.&lt;br /&gt;
&lt;br /&gt;
==== 'if' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;result&amp;gt; = if( &amp;lt;condition&amp;gt; , &amp;lt;if true&amp;gt; , &amp;lt;otherwise&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;condition&amp;gt; parameter is true, the function will evaluate to being equal to its second input ( &amp;lt;if true&amp;gt; ), otherwise it will evaluate to being equal to its third input ( &amp;lt;otherwise&amp;gt; ). &lt;br /&gt;
For instance, an AI that recruits Wolf Riders on the first turn, and Orcish Grunts thereafter might look like this:&lt;br /&gt;
&lt;br /&gt;
 move=&amp;quot;if(turn = 1, recruit('Wolf Rider'), recruit('Orcish Grunt'))&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== 'loc' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;location&amp;gt; = loc( &amp;lt;X number&amp;gt;, &amp;lt;Y number&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
Function will return a location (pair of numbers) from two given input arguments.&lt;br /&gt;
&lt;br /&gt;
==== 'map' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;result list&amp;gt; = map( &amp;lt;input list&amp;gt; , &amp;lt;formula&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function will run &amp;lt;formula&amp;gt; on each item in the &amp;lt;input list&amp;gt;, and evaluate to a new &amp;lt;result list&amp;gt; which contains the same number of items as in &amp;lt;input list&amp;gt;, with the formulas run on each item. For example:&lt;br /&gt;
&lt;br /&gt;
 map(my_units, hitpoints) &lt;br /&gt;
&lt;br /&gt;
will give a list back with the number of hitpoints each unit has. This is more useful in conjunction with other functions.&lt;br /&gt;
&lt;br /&gt;
==== 'max' function ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;number&amp;gt; = max( &amp;lt;list of numbers&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
Function will return maximal number from a list,&lt;br /&gt;
&lt;br /&gt;
 max( [ 2, 8, -10, 3] )&lt;br /&gt;
&lt;br /&gt;
will return 8.&lt;br /&gt;
&lt;br /&gt;
==== 'max_possible_damage' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;number&amp;gt; = max_possible_damage( &amp;lt;attacking unit&amp;gt; , &amp;lt;defending unit&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
Function returns highest possible damage that &amp;lt;attacking unit&amp;gt; can inflict to &amp;lt;defending unit&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== 'min' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;number&amp;gt; = min( &amp;lt;list of numbers&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
Function will return minimal number from a list,&lt;br /&gt;
&lt;br /&gt;
 min( [ 3, 7, -2, 6] )&lt;br /&gt;
&lt;br /&gt;
will return -2.&lt;br /&gt;
&lt;br /&gt;
==== 'move' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;action&amp;gt; = move( &amp;lt;source&amp;gt; , &amp;lt;destination&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
For example unit formula like:&lt;br /&gt;
&lt;br /&gt;
 move(me.loc, loc(me.loc.x, me.loc.y - 1) )&lt;br /&gt;
&lt;br /&gt;
will make unit move one hex north.&lt;br /&gt;
&lt;br /&gt;
==== 'nearest_keep' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;keep location&amp;gt; = nearest_keep( &amp;lt;input location&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
Function returns location of nearest keep to the specified &amp;lt;input location&amp;gt;, or null if there is no keep on the map.&lt;br /&gt;
&lt;br /&gt;
==== 'recruit' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;action&amp;gt; = recruit( &amp;lt;unit name&amp;gt; [, &amp;lt;location&amp;gt; ] )&lt;br /&gt;
&lt;br /&gt;
This function results in recruting a unit specifed by &amp;lt;unit name&amp;gt; at first free castle hex, or at given &amp;lt;location&amp;gt;. Function:&lt;br /&gt;
&lt;br /&gt;
 recruit('Footpad', loc(3,3) ) &lt;br /&gt;
&lt;br /&gt;
will result in recruting Footpad at castle hex with coordinates 3,3.&lt;br /&gt;
&lt;br /&gt;
==== 'set_var' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;action&amp;gt; = set_var( &amp;lt;key&amp;gt; , &amp;lt;value&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This action sets new variable, for example:&lt;br /&gt;
&lt;br /&gt;
 set_var( 'Number one' , 1 )&lt;br /&gt;
&lt;br /&gt;
Will create variable with name 'Number one' and assign 1 to it.&lt;br /&gt;
&lt;br /&gt;
==== 'size' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;number&amp;gt; = size( &amp;lt;list of variables&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function returns how many variables are stored in a list:&lt;br /&gt;
&lt;br /&gt;
 size( [ 5, 7, 9] )                #return 3&lt;br /&gt;
 size( [ 'Archer', 'Fighter' ] )   #return 2&lt;br /&gt;
&lt;br /&gt;
==== 'sort' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;result list&amp;gt; = sort( &amp;lt;input list&amp;gt; , &amp;lt;formula&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function evaluates to a &amp;lt;result list&amp;gt; sorted according to the comparison &amp;lt;formula&amp;gt; for each item 'a' and its successor 'b'. For instance, sorting units according to hitpoints would be done by:&lt;br /&gt;
&lt;br /&gt;
 sort( my_units, a.hitpoints &amp;gt; b.hitpoints )&lt;br /&gt;
&lt;br /&gt;
==== 'sum' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;number&amp;gt; = sum( &amp;lt;list of numbers&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
This function evaluates to the sum of the items in the &amp;lt;list of numbers&amp;gt;. For example&lt;br /&gt;
&lt;br /&gt;
 sum( [ 2, 5, 8] )&lt;br /&gt;
&lt;br /&gt;
returns 15, and:&lt;br /&gt;
&lt;br /&gt;
 sum( map( my_units,  max_hitpoints - hitpoints ) )&lt;br /&gt;
&lt;br /&gt;
finds the total damage your units have taken.&lt;br /&gt;
&lt;br /&gt;
==== 'switch' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;result&amp;gt; = switch( &amp;lt;variable&amp;gt;, &amp;lt;value 1&amp;gt;, &amp;lt;outcome 1&amp;gt;, ... , &amp;lt;value N&amp;gt;, &amp;lt;outcome N&amp;gt; [, &amp;lt;default outcome&amp;gt; ] &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Switch funtion takes variable, and checks if it is equal to any of the specified &amp;lt;values&amp;gt;. If matching value is found, &amp;lt;outcome&amp;gt; assigned to it is returned, if not, then function returns either &amp;lt;default outcome&amp;gt; (if specified) or null.&lt;br /&gt;
&lt;br /&gt;
==== 'unit_at' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;unit&amp;gt; = unit_at( &amp;lt;location&amp;gt; ) &lt;br /&gt;
&lt;br /&gt;
This function takes only one argument - location, and returns unit if there is one standing in that location, or null otherwise. Example of usage:&lt;br /&gt;
&lt;br /&gt;
 unit_at( loc( 4, 4) )&lt;br /&gt;
&lt;br /&gt;
==== 'unit_moves' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;locations list&amp;gt; = unit_moves( &amp;lt;unit location&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
Function returns list of all possible locations which unit standing at &amp;lt;unit location&amp;gt; can reach. If unit can't move, or there is no unit standing at given location, empty list is returned.&lt;br /&gt;
&lt;br /&gt;
==== 'units_can_reach' function ====&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;units list&amp;gt; = units_can_reach( &amp;lt;possible moves list&amp;gt;, &amp;lt;location&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
Function takes as an input list of possible moves ( ai.my_moves for units that belong to AI, or ai.enemy_moves for units that belong to the opponent ) and checks which units from that list can reach &amp;lt;location&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Custom Functions ===&lt;br /&gt;
&lt;br /&gt;
* You can define your own functions. A function is a formula which takes some inputs as parameters. Suppose we wanted to define a function that puts some value on a unit, we might add the following to the [ai] tag:&lt;br /&gt;
&lt;br /&gt;
 [function]&lt;br /&gt;
 name=value_unit&lt;br /&gt;
 inputs=&amp;quot;unit&amp;quot;&lt;br /&gt;
 formula=&amp;quot;unit.hitpoints + unit.level*4&amp;quot;&lt;br /&gt;
 [/function]&lt;br /&gt;
&lt;br /&gt;
This has defined a new function which takes a 'unit' as an input, and runs the given calculation over it.&lt;br /&gt;
&lt;br /&gt;
* We can have multiple inputs in our functions, to define them, just create comma-separated inputs list:&lt;br /&gt;
&lt;br /&gt;
 inputs=&amp;quot;attacker,defender&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This has defined a new function which takes both 'attacker' and 'defender' as an inputs.&lt;br /&gt;
&lt;br /&gt;
* Sometimes, we use one of our inputs really often in our function - to make our life easier we can make its members (inputs) directly accessible from within the formula. This is improved version of function from above:&lt;br /&gt;
&lt;br /&gt;
 [function]&lt;br /&gt;
 name=value_unit&lt;br /&gt;
 inputs=&amp;quot;unit*&amp;quot;&lt;br /&gt;
 formula=&amp;quot;hitpoints + level*4&amp;quot;&lt;br /&gt;
 [/function]&lt;br /&gt;
&lt;br /&gt;
As you can see, if we define input with a * char at the end, we make it a 'default input' for a formula. Note, that you can define only one default input per function.&lt;br /&gt;
&lt;br /&gt;
* It is important to know difference between formulas defined in custom functions, and formula defined by a 'move=' in a [ai] tag. For example, if we want to get info about leader, we write in formula 'my_leader' - which acces member of the AI. To be able to use 'my_leader' in custom functions we have to add 'ai' as an input for our function:&lt;br /&gt;
&lt;br /&gt;
 inputs=&amp;quot;ai&amp;quot;&lt;br /&gt;
&lt;br /&gt;
allows us to access leader info by writing 'ai.my_leader', or:&lt;br /&gt;
&lt;br /&gt;
 inputs=&amp;quot;ai*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
allows us to access leader info by simply writing 'my_leader'&lt;br /&gt;
&lt;br /&gt;
* You can also use 'def' [[#Keywords|keyword]] to define custom functions&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
Comments in Formula AI scripts are enclosed by {}:&lt;br /&gt;
&lt;br /&gt;
 {Define opening move} &lt;br /&gt;
 def opening(*ai) &lt;br /&gt;
  if(turn = 1,&lt;br /&gt;
   move(loc(11,23), loc(14,22)),&lt;br /&gt;
  [])&lt;br /&gt;
&lt;br /&gt;
Comments may also be included at the end of a line:&lt;br /&gt;
 &lt;br /&gt;
 def opening(*ai) &lt;br /&gt;
  if(turn = 1,&lt;br /&gt;
   move(loc(11,23), loc(14,22)), {capture village}&lt;br /&gt;
  []) {do nothing}&lt;br /&gt;
&lt;br /&gt;
and they may also be used inline:&lt;br /&gt;
&lt;br /&gt;
 def opening(*ai)&lt;br /&gt;
  if(turn = 1,&lt;br /&gt;
   move(loc(11,23) {my_leader}, loc(14,24) {closest village}),&lt;br /&gt;
  []) {do nothing}&lt;br /&gt;
&lt;br /&gt;
== Keywords == &lt;br /&gt;
&lt;br /&gt;
The formula language has some reserved keywords to provide primitive functionality.  Currently the following keywords are defined:&lt;br /&gt;
&lt;br /&gt;
* where: This keyword is used to defining statements in formulas. You can define multiple comma-separated statements. Syntax:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;formula&amp;gt; where &amp;lt;comma-separated list of statements&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example formula:&lt;br /&gt;
&lt;br /&gt;
  a + b where a = 2, b = 4&lt;br /&gt;
&lt;br /&gt;
will give as result 6.&lt;br /&gt;
&lt;br /&gt;
* functions: Returns a list of all built-in and custom functions available to the AI&lt;br /&gt;
&lt;br /&gt;
* def: This keyword creates functions using the syntax:&lt;br /&gt;
&lt;br /&gt;
  def function_name(arg1, arg2, ....) function_body&lt;br /&gt;
&lt;br /&gt;
For example,   &lt;br /&gt;
&lt;br /&gt;
  def sum(x,y) x + y&lt;br /&gt;
&lt;br /&gt;
creates a function sum taking two arguments and returns their sum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unit Formulas ==&lt;br /&gt;
&lt;br /&gt;
You san specify a formula for any kind of unit. This is a simple way of doing it:&lt;br /&gt;
&lt;br /&gt;
 [unit]&lt;br /&gt;
   ...&lt;br /&gt;
   formula=&amp;quot;move(me.loc, loc(me.loc.x, me.loc.y - 1))&amp;quot;&lt;br /&gt;
 [/unit]&lt;br /&gt;
&lt;br /&gt;
Custom unit formulas are executed first at the begining of side's turn. Above formula will simply move unit one hex to the north every turn. Note how &amp;quot;me&amp;quot; keyword allows access to unit itself.&lt;br /&gt;
&lt;br /&gt;
You can also define AI unit-specific variables and use them in you formulas:&lt;br /&gt;
&lt;br /&gt;
 [unit]&lt;br /&gt;
  ...&lt;br /&gt;
  formula=&amp;quot;if(attack, attack, move(me.loc, choose(unit_moves(me.loc), -distance_between(self, me.vars.guard_loc))))&lt;br /&gt;
  where attack = choose(filter(attacks, units = [me.loc] and distance_between(me.vars.guard_loc, target) &amp;lt;= me.vars.guard_radius), avg_damage_inflicted)&amp;quot;&lt;br /&gt;
  [ai_vars]&lt;br /&gt;
    guard_radius=3&lt;br /&gt;
    guard_loc=&amp;quot;loc(8,5)&amp;quot;&lt;br /&gt;
  [/ai_vars]&lt;br /&gt;
 [/unit]&lt;br /&gt;
&lt;br /&gt;
This formula will get location position from variable guard_loc and make sure that unit attacks opponent which is 3 hexes (value specified by guard_radius variable) or less from guard_loc.&lt;br /&gt;
&lt;br /&gt;
Types of variables that are supported:&lt;br /&gt;
*number:&lt;br /&gt;
 variable=3&lt;br /&gt;
*text (important: note the ' ' within &amp;quot; &amp;quot;):&lt;br /&gt;
 name=&amp;quot;'I am variable'&amp;quot;&lt;br /&gt;
*list:&lt;br /&gt;
 number_list=[ 1, 2, 3]&lt;br /&gt;
*location:&lt;br /&gt;
 place=&amp;quot;loc(X,Y)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Tool Support =&lt;br /&gt;
&lt;br /&gt;
== ctags ==&lt;br /&gt;
&lt;br /&gt;
For some rudimentary support for exuberant ctags, add the following to .ctags (or create the file if it doesn't exist):&lt;br /&gt;
&lt;br /&gt;
 --langdef=formulaai&lt;br /&gt;
 --langmap=formulaai:.fai&lt;br /&gt;
 --regex-formulaai=/^def[ \t]*([a-zA-Z0-9_]+)/\1/d,definition/&lt;br /&gt;
&lt;br /&gt;
This is especially nice when used with an editor or plugin with ctags support, such as Taglist for Vim.&lt;br /&gt;
&lt;br /&gt;
== Vim ==&lt;br /&gt;
&lt;br /&gt;
===Syntax Highlighting===&lt;br /&gt;
&lt;br /&gt;
Follow these steps to enjoy vim syntax highlighting support for Formula AI.&lt;br /&gt;
&lt;br /&gt;
# Grab the Formula AI vim syntax file, [http://svn.gna.org/viewcvs/*checkout*/wesnoth/trunk/data/tools/vim/formulaai.vim formulaai.vim].&lt;br /&gt;
# Copy formulaai.vim to .vim/syntax &lt;br /&gt;
# Add the following to .vimrc :&lt;br /&gt;
 autocmd! BufRead,BufNewFile *.fai setfiletype formulaai&lt;br /&gt;
&lt;br /&gt;
===Taglist Support===&lt;br /&gt;
&lt;br /&gt;
First you will need the very nice [http://www.vim.org/scripts/script.php?script_id=273 taglist plugin].  Follow the link for downloads and install directions if you don't already have it installed.&lt;br /&gt;
&lt;br /&gt;
Next, you'll need Formula AI support for exuberant ctags, follow the instructions in the [[#ctags|ctags]] section.  &lt;br /&gt;
&lt;br /&gt;
Once you have all that, simply add the following line to your .vimrc:&lt;br /&gt;
 &lt;br /&gt;
 let tlist_formulaai_settings = 'formulaai;d:definition'&lt;br /&gt;
&lt;br /&gt;
To test it all out, open a Formula AI script file and enter the command &lt;br /&gt;
 :Tlist&lt;br /&gt;
&lt;br /&gt;
You should now have some nice highlighting and be able to easily navigate through formula, enjoy!&lt;br /&gt;
  &lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=24941</id>
		<title>FormulaAIandAdaptation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=24941"/>
		<updated>2008-03-30T21:27:36Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Personal Information==&lt;br /&gt;
I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest in AI and plan to work on that in the near future and I am eager to learn. Out of the more interesting things that I have programmed I could point out an algorithmic, non-bruteforce SuDoku solver, a Mastermind solver and a Java 3d pipeline.&lt;br /&gt;
&lt;br /&gt;
==The Idea==&lt;br /&gt;
Create a FormulaAI based AI for Wesnoth. Write additional FormulaAI syntax if needed for a better AI. Provide the non-programmer users a simple way to define special characteristics of the AI that would override the default AI preferences (for example make a certain story unit behave in some specific way).&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
After the discussions about the AI on the IRC, I was reading up and thought about an, in my opinion, interesting approach to the problem. First of all, from playing the game and talking to other player (done before summer begins) we get the idea of tactics and ideas they use while playing. We also need to make the AI be able to add to the tactic and strategy base on its own considering the outcome of each move. Obviously, with the mass of the possible options in the game, the full base would never be completed, so we need to use another method to ensure the effect. The AI would not only have the information on the tactics, but a large base of environment relations (like how one unit scales with the other and the land effect on them). Based on the current case, the strategy and tactics base and the world information it would compare and scale how close to a successful plan it can get from the current state, a similarity engine, if you will (for example, if one powerful unit could defeat the enemy, and we have two weaker units, maybe their combined power can defeat the enemy too). This type of strategy is a valid option in a TBS AI development and was used in other games like Civilization. Of course, there will always be some uncertainty, and that will be solved with probabilistic reasoning.&lt;br /&gt;
===The Case (Strategy and tactics) base===&lt;br /&gt;
This would be the plan and strategy base, updated on each action taken. The base plans and tactics would be inserted from user experience. The others the AI would formulate itself, with probability of success. After setting the major goal, such as defence or attack, the AI could use genetic algorithms to evaluate or create the best plan. Since the variations are too great, there would be an iteration limit set (this could also relate to difficulty: the harder the opponent, the more iterations).&lt;br /&gt;
===The Knowledge Base===&lt;br /&gt;
This would hold the information on every aspect of the game and would be updated with user created content as available. For example it would know that some two units are both archers, along with their statistics. This is quite straight forward: arrays of information on units (probably split into logical groups) with connections between (so we can select healers from elves or elves from healers, depending on how we sort them. The knowledge base would also hold information on terrain effects on units.&lt;br /&gt;
===The Similarity Engine===&lt;br /&gt;
This would compare the existing plans to the available resources and choose the best solution. For example, if we know that two fighters can defeat an enemy, it scales what are the chances of, lets say a fighter and a healer or two rangers. It wouldn't chose what looks closer, but what *looks  better* (lets say in this case, the two rangers). Simple evaluation function could look something like (unit.hitpoints/hitpoints_in_plan * i + unit.damage/damage_in_plan * j) where i and j would be based on priorities (to survive or to do more damage)&lt;br /&gt;
&lt;br /&gt;
==Timeline==&lt;br /&gt;
*The first part would be to integrate the knowledge base to the AI, since it would need grouping and connections.&lt;br /&gt;
*The second part would be to write a case base so it could store plans and create new plans, along with the probability of success.&lt;br /&gt;
*The third part would be to write effective evaluation functions along with a probability engine to calculate success rate of possible plans. This may be done by using the Monte Carlo method (it is used when there are large arrays of data and discreet calculations are impossible)&lt;br /&gt;
&lt;br /&gt;
==Overall==&lt;br /&gt;
The result should be an AI with both overall and detailed customization (e.g. overall would be aggressive or defensive and detailed would be guarding or assassinating) and adaptiveness to new strategic plans and user created content.&lt;br /&gt;
&lt;br /&gt;
==Commits==&lt;br /&gt;
*An additional formula and functions in pathutil [http://svn.gna.org/viewcvs/wesnoth?rev=25349&amp;amp;view=rev]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
On a side note, I'd like to say that I am really interested in game development and would gladly continue working on Wesnoth after Google Summer of Code. Also, the reason why I can't contribute much now is that I have to attend the university and we are having some midterm exams, so I need to study a bit.&lt;br /&gt;
[[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=24927</id>
		<title>FormulaAIandAdaptation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=24927"/>
		<updated>2008-03-30T17:38:24Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Personal Information==&lt;br /&gt;
I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest in AI and plan to work on that in the near future and I am eager to learn. Out of the more interesting things that I have programmed I could point out an algorithmic, non-bruteforce SuDoku solver, a Mastermind solver and a Java 3d pipeline.&lt;br /&gt;
&lt;br /&gt;
==The Idea==&lt;br /&gt;
Create a FormulaAI based AI for Wesnoth. Write additional FormulaAI syntax if needed for a better AI. Provide the non-programmer users a simple way to define special characteristics of the AI that would override the default AI preferences (for example make a certain story unit behave in some specific way).&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
After the discussions about the AI on the IRC, I was reading up and thought about an, in my opinion, interesting approach to the problem. First of all, from playing the game and talking to other player (done before summer begins) we get the idea of tactics and ideas they use while playing. We also need to make the AI be able to add to the tactic and strategy base on its own considering the outcome of each move. Obviously, with the mass of the possible options in the game, the full base would never be completed, so we need to use another method to ensure the effect. The AI would not only have the information on the tactics, but a large base of environment relations (like how one unit scales with the other and the land effect on them). Based on the current case, the strategy and tactics base and the world information it would compare and scale how close to a successful plan it can get from the current state, a similarity engine, if you will (for example, if one powerful unit could defeat the enemy, and we have two weaker units, maybe their combined power can defeat the enemy too). This type of strategy is a valid option in a TBS AI development and was used in other games like Civilization. Of course, there will always be some uncertainty, and that will be solved with probabilistic reasoning.&lt;br /&gt;
===The Case (Strategy and tactics) base===&lt;br /&gt;
This would be the plan and strategy base, updated on each action taken. The base plans and tactics would be inserted from user experience. The others the AI would formulate itself, with probability of success. After setting the major goal, such as defence or attack, the AI could use genetic algorithms to evaluate or create the best plan. Since the variations are too great, there would be an iteration limit set (this could also relate to difficulty: the harder the opponent, the more iterations).&lt;br /&gt;
===The Knowledge Base===&lt;br /&gt;
This would hold the information on every aspect of the game and would be updated with user created content as available. For example it would know that some two units are both archers, along with their statistics. This is quite straight forward: arrays of information on units (probably split into logical groups) with connections between (so we can select healers from elves or elves from healers, depending on how we sort them. The knowledge base would also hold information on terrain effects on units.&lt;br /&gt;
===The Similarity Engine===&lt;br /&gt;
This would compare the existing plans to the available resources and choose the best solution. For example, if we know that two fighters can defeat an enemy, it scales what are the chances of, lets say a fighter and a healer or two rangers. It wouldn't chose what looks closer, but what *looks  better* (lets say in this case, the two rangers). Simple evaluation function could look something like (unit.hitpoints/hitpoints_in_plan * i + unit.damage/damage_in_plan * j) where i and j would be based on priorities (to survive or to do more damage)&lt;br /&gt;
&lt;br /&gt;
==Timeline==&lt;br /&gt;
*The first part would be to integrate the knowledge base to the AI, since it would need grouping and connections.&lt;br /&gt;
*The second part would be to write a case base so it could store plans and create new plans, along with the probability of success.&lt;br /&gt;
*The third part would be to write effective evaluation functions along with a probability engine to calculate success rate of possible plans. This may be done by using the Monte Carlo method (it is used when there are large arrays of data and discreet calculations are impossible)&lt;br /&gt;
&lt;br /&gt;
==Overall==&lt;br /&gt;
The result should be an AI with both overall and detailed customization (e.g. overall would be aggressive or defensive and detailed would be guarding or assassinating) and adaptiveness to new strategic plans and user created content.&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
On a side note, I'd like to say that I am really interested in game development and would gladly continue working on Wesnoth after Google Summer of Code. Also, the reason why I can't contribute much now is that I have to attend the university and we are having some midterm exams, so I need to study a bit.&lt;br /&gt;
[[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=24520</id>
		<title>FormulaAIandAdaptation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=24520"/>
		<updated>2008-03-24T23:24:34Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: /* Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Personal Information==&lt;br /&gt;
I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest in AI and plan to work on that in the near future and I am eager to learn.&lt;br /&gt;
&lt;br /&gt;
==The Idea==&lt;br /&gt;
Create a FormulaAI based AI for Wesnoth. Write additional FormulaAI syntax if needed for a better AI. Provide the non-programmer users a simple way to define special characteristics of the AI that would override the default AI preferences (for example make a certain story unit behave in some specific way).&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
After the discussions about the AI on the IRC, I was reading up and thought about an, in my opinion, interesting approach to the problem. First of all, from playing the game and talking to other player (done before summer begins) we get the idea of tactics and ideas they use while playing. We also need to make the AI be able to add to the tactic and strategy base on its own considering the outcome of each move. Obviously, with the mass of the possible options in the game, the full base would never be completed, so we need to use another method to ensure the effect. The AI would not only have the information on the tactics, but a large base of environment relations (like how one unit scales with the other and the land effect on them). Based on the current case, the strategy and tactics base and the world information it would compare and scale how close to a successful plan it can get from the current state, a similarity engine, if you will (for example, if one powerful unit could defeat the enemy, and we have two weaker units, maybe their combined power can defeat the enemy too). This type of strategy is a valid option in a TBS AI development and was used in other games like Civilization. Of course, there will always be some uncertainty, and that will be solved with probabilistic reasoning.&lt;br /&gt;
===The Case (Strategy and tactics) base===&lt;br /&gt;
This would be the plan and strategy base, updated on each action taken. The base plans and tactics would be inserted from user experience. The others the AI would formulate itself, with probability of success.&lt;br /&gt;
===The Knowledge Base===&lt;br /&gt;
This would hold the information on every aspect of the game and would be updated with user created content as available. For example it would know that some two units are both archers, along with their statistics.&lt;br /&gt;
===The Similarity Engine===&lt;br /&gt;
This would compare the existing plans to the available resources and choose the best solution. For example, if we know that two fighters can defeat an enemy, it scales what are the chances of, lets say a fighter and a healer or two rangers. It wouldn't chose what looks closer, but what *looks  better* (lets say in this case, the two rangers).&lt;br /&gt;
&lt;br /&gt;
==Overall==&lt;br /&gt;
The result should be an AI with both overall and detailed customization (e.g. overall would be aggressive or defensive and detailed would be guarding or assassinating) and adaptiveness to new strategic plans and user created content.&lt;br /&gt;
&lt;br /&gt;
[[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=24037</id>
		<title>FormulaAIandAdaptation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=24037"/>
		<updated>2008-03-20T22:00:24Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: /* Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Personal Information==&lt;br /&gt;
I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest in AI and plan to work on that in the near future and I am eager to learn.&lt;br /&gt;
&lt;br /&gt;
==The Idea==&lt;br /&gt;
Create a FormulaAI based AI for Wesnoth. Write additional FormulaAI syntax if needed for a better AI. Provide the non-programmer users a simple way to define special characteristics of the AI that would override the default AI preferences (for example make a certain story unit behave in some specific way).&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
After the discussions about the AI on the IRC, I was reading up and thought about an, in my opinion, interesting approach to the problem. First of all, from playing the game and talking to other player (done before summer begins) we get the idea of tactics and ideas they use while playing. We also need to make the AI be able to add to the tactic and strategy base on its own considering the outcome of each move. Obviously, with the mass of the possible options in the game, the full base would never be completed, so we need to use another method to ensure the effect. The AI would not only have the information on the tactics, but a large base of environment relations (like how one unit scales with the other and the land effect on them). Based on the current case, the strategy and tactics base and the world information it would compare and scale how close to a successful plan it can get from the current state, a similarity engine, if you will (for example, if one powerful unit could defeat the enemy, and we have two weaker units, maybe their combined power can defeat the enemy too). This type of strategy is a valid option in a TBS AI development and was used in other games like Civilization.&lt;br /&gt;
===The Case (Strategy and tactics) base===&lt;br /&gt;
This would be the plan and strategy base, updated on each action taken. The base plans and tactics would be inserted from user experience. The others the AI would formulate itself, with probability of success.&lt;br /&gt;
===The Knowledge Base===&lt;br /&gt;
This would hold the information on every aspect of the game and would be updated with user created content as available. For example it would know that some two units are both archers, along with their statistics.&lt;br /&gt;
===The Similarity Engine===&lt;br /&gt;
This would compare the existing plans to the available resources and choose the best solution. For example, if we know that two fighters can defeat an enemy, it scales what are the chances of, lets say a fighter and a healer or two rangers. It wouldn't chose what looks closer, but what *looks  better* (lets say in this case, the two rangers).&lt;br /&gt;
&lt;br /&gt;
==Overall==&lt;br /&gt;
The result should be an AI with both overall and detailed customization (e.g. overall would be aggressive or defensive and detailed would be guarding or assassinating) and adaptiveness to new strategic plans and user created content.&lt;br /&gt;
&lt;br /&gt;
[[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=24017</id>
		<title>FormulaAIandAdaptation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FormulaAIandAdaptation&amp;diff=24017"/>
		<updated>2008-03-20T17:49:20Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: New page: ==Personal Information== I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Personal Information==&lt;br /&gt;
I am Alesis Novik, a computer science student. My IRC name is Alesis-Novik. I am quite good at programming c++ and writing effective algorithms. I hold an interest in AI and plan to work on that in the near future and I am eager to learn.&lt;br /&gt;
&lt;br /&gt;
==The Idea==&lt;br /&gt;
Create a FormulaAI based AI for Wesnoth. Write additional FormulaAI syntax if needed for a better AI. Provide the non-programmer users a simple way to define special characteristics of the AI that would override the default AI preferences (for example make a certain story unit behave in some specific way).&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
After the discussions about the AI on the IRC, I was reading up and thought about an, in my opinion, interesting approach to the problem. First of all, from playing the game and talking to other player (done before summer begins) we get the idea of tactics and ideas they use while playing. We also need to make the AI be able to add to the tactic and strategy base on its own considering the outcome of each move. Obviously, with the mass of the possible options in the game, the full base would never be completed, so we need to use another method to ensure the effect. The AI would not only have the information on the tactics, but a large base of environment relations (like how one unit scales with the other and the land effect on them). Based on the current case, the strategy and tactics base and the world information it would compare and scale how close to a successful plan it can get from the current state, a similarity engine, if you will (for example, if one powerful unit could defeat the enemy, and we have two weaker units, maybe their combined power can defeat the enemy too). This type of strategy is a valid option in a TBS AI development and was used in other games like Civilization.&lt;br /&gt;
&lt;br /&gt;
==Overall==&lt;br /&gt;
The result should be an AI with both overall and detailed customization (e.g. overall would be aggressive or defensive and detailed would be guarding or assassinating) and adaptiveness to new strategic plans and user created content.&lt;br /&gt;
&lt;br /&gt;
[[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeIdeas&amp;diff=24012</id>
		<title>SummerOfCodeIdeas</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeIdeas&amp;diff=24012"/>
		<updated>2008-03-20T17:27:05Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: /* FormulaAIandAdaptation (Alesis-Novik) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a compilation of ideas from ML. Needs to be refined (more detailed description, deliverables, workload estimation?):&lt;br /&gt;
&lt;br /&gt;
== I want to be one of your Google Summer of Code students, what should I do... ==&lt;br /&gt;
&lt;br /&gt;
Here is a quick list of things to do to get you started&lt;br /&gt;
* Create an account on gna.org&lt;br /&gt;
* Create an account on the wesnoth forum&lt;br /&gt;
* Join the irc channel (#wesnoth-dev on irc.freenode.net) and introduce yourself. We will not give formal interviews, but we will clearly favor people we have learnt to know during the selection process&lt;br /&gt;
* Contact one of our SummerOfCode people (Ivanovic, Sirp, Boucman, Mordante) to have your forum nick marked as a Summer of code student&lt;br /&gt;
&lt;br /&gt;
* Start a wiki page about your idea, add a link on the bottom of this page and add this information on it:&lt;br /&gt;
** List your account names (gna, forum, irc nick) so that we can recognize you&lt;br /&gt;
** Fill the questionnaire on this page: [[SoC_Information_for_Google#Does_your_organization_have_an_application_template_you_would_like_to_see_students_use.3F_If_so.2C_please_provide_it_now.| List of questions to answer]]&lt;br /&gt;
** Detail your idea as much as possible, look at other students pages, and please give milestones and studies you've done&lt;br /&gt;
&lt;br /&gt;
* Though not mandatory, it is highly advisable to go to the [[EasyCoding]] and [[NotSoEasyCoding]] pages and implement one of these ideas (or any idea of similar scope) so we have an idea how you work. Be sure to use your gna account when submitting these patches so we know who it is coming from. You can also implement some features from our feature request database at gna. When you implement something, also list it on your own page with a reference to the patch.&lt;br /&gt;
&lt;br /&gt;
== List of Ideas for the Project (Suggestions from the wesnoth developers) ==&lt;br /&gt;
&lt;br /&gt;
Here is only a short description of possible Ideas we have, each has a page of its own with a more detailed version on it.&lt;br /&gt;
&lt;br /&gt;
=== Writing an AI based on the formula AI ===&lt;br /&gt;
&lt;br /&gt;
Wesnoth has always had a simple C++ based AI. David (our lead developer) has been working on a simple language to write AI in Wesnoth: [[FormulaAI]]&lt;br /&gt;
&lt;br /&gt;
The Wesnoth AI is used as an opponent in most campaigns, and as such is an important piece of code for the Wesnoth project. Unfortunately, because the skills required to understand and modify it are rather arcane, it is also one of the most neglected parts of the Wesnoth code. This is a place where a lot of research and useful work could be done. But keep in mind that [[WhyWritingAWesnothAIIsHard|writing an AI for Wesnoth is difficult]].&lt;br /&gt;
&lt;br /&gt;
[[SoC Ideas FormulaAI]] - Full version of the idea, with detailed information&lt;br /&gt;
&lt;br /&gt;
=== Extending the Multiplayer server ===&lt;br /&gt;
&lt;br /&gt;
Our multiplayer community is generally strong and healthy, but we believe its growth is limited by some problems in the interface of the multiplayer lobby.&lt;br /&gt;
&lt;br /&gt;
[[SoC Ideas Multiplayer server]] - Full version of the idea, with detailed information&lt;br /&gt;
&lt;br /&gt;
=== Scenario/Campaign editor ===&lt;br /&gt;
&lt;br /&gt;
Currently, in order to create campaign or multiplayer scenarios, it is necessary to manually edit WML files - XML-like configuration files. The goal of this project would be to create a graphical editor to make the creative process easier.&lt;br /&gt;
&lt;br /&gt;
[[SoC Ideas Scenario and Campaign Editor]] - Full version of the idea, with detailed information&lt;br /&gt;
&lt;br /&gt;
=== Addon server ===&lt;br /&gt;
Wesnoth has an addon server which offers users to upload user &lt;br /&gt;
made content (UMC). This allows all other users of Wesnoth&lt;br /&gt;
to easily download and install this content. The server was &lt;br /&gt;
originally written for user-made campaigns but contains a lot&lt;br /&gt;
more types of addons nowadays. Both the server side and the &lt;br /&gt;
client side need to be improved.&lt;br /&gt;
&lt;br /&gt;
[[SoC Ideas Addon Server]] - Full version of the idea, with detailed information&lt;br /&gt;
&lt;br /&gt;
=== Map editor ===&lt;br /&gt;
The map editor in Wesnoth serves two goals, making it easy to create&lt;br /&gt;
a new map and helping the terrain artists to test their new terrains.&lt;br /&gt;
&lt;br /&gt;
[[SoC_Ideas_Map_Editor]] - Full version of the idea, with detailed information&lt;br /&gt;
&lt;br /&gt;
=== Other possible ideas to be fleshed out ===&lt;br /&gt;
A MapGenerator rewrite - better scalable for outdoor maps, plus the possibility to define areas (similar to the caverns in the cave generator) etc.&lt;br /&gt;
&lt;br /&gt;
=== Make your own ideas ===&lt;br /&gt;
If you have your own idea the best thing is to join IRC wesnoth-dev at irc.freenode.net and discuss the idea with the developers there. If the developers think your idea is interesting and like the feature you can start to turn it into a full proposal. Once done discuss it again on IRC so the developers can accept your idea.&lt;br /&gt;
&lt;br /&gt;
== Information about our Project ==&lt;br /&gt;
The information we provided google with about our project can be looked up at the site [[SoC Information for Google]].&lt;br /&gt;
&lt;br /&gt;
== People to bug on IRC ==&lt;br /&gt;
We have prepared a list of people with their &amp;quot;area of competence&amp;quot;. This is to give you an idea on which areas those people can be of help for you. Of course you should always just ask in the IRC chan, but those are the most likely ones to answer questions in the respective area. And here is the list:&lt;br /&gt;
&lt;br /&gt;
[[SoC People to bug on IRC]]&lt;br /&gt;
&lt;br /&gt;
== GSoC Student Applicant Ideas == &lt;br /&gt;
&lt;br /&gt;
Every student interested to work on Wesnoth as part of Summer of Code should create a page of his own where several things should be listed. Here is a short list of what should be mentioned on the list (the more info for us, the better...):&lt;br /&gt;
&lt;br /&gt;
* Who are you? Please list your IRC and forum nickname in here and describe yourself so that we get you to know.&lt;br /&gt;
* What do you want to work on? Please flesh out your personal ideas, so that we get to know what you plan to work on.&lt;br /&gt;
* If you already submitted patches, please list those so that we have a reference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== [[FormulaAIandDynamicScripting]] (barbarianhero) ===&lt;br /&gt;
This project idea uses Formula AI and Dynamic Scripting to create a tunable and adaptive AI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===[[FormulaAIandAdaptation]] (Alesis-Novik) ===&lt;br /&gt;
The new idea and aproach using strategic and inside game knowledge&lt;br /&gt;
&lt;br /&gt;
===[[ExtensibleScenarioEditor]] (david.hilton) ===&lt;br /&gt;
On a conceptual level, this idea combines a finite state machine editor with a code generator to create scenarios.&lt;br /&gt;
&lt;br /&gt;
===[[RandomCampaignGenerator]] (kartik thakore) ===&lt;br /&gt;
Procedural Campaign generation that combines random map generation, story generation, and strategy generation.&lt;br /&gt;
&lt;br /&gt;
===[[LaoSoCIdeas]] by lao ===&lt;br /&gt;
Under Construction...&lt;br /&gt;
&lt;br /&gt;
===[[AddonServer]] (giebfried) ===&lt;br /&gt;
This project is to improve the server and client sides of the addon server, as suggested above.&lt;br /&gt;
&lt;br /&gt;
===[[EvolutionaryMapEditor]] (xonev) ===&lt;br /&gt;
Under Construction&lt;br /&gt;
[[Category:Summer of Code|*]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeIdeas&amp;diff=23781</id>
		<title>SummerOfCodeIdeas</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeIdeas&amp;diff=23781"/>
		<updated>2008-03-18T17:59:32Z</updated>

		<summary type="html">&lt;p&gt;Alesis-Novik: /* GSoC Student Applicant Ideas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a compilation of ideas from ML. Needs to be refined (more detailed description, deliverables, workload estimation?):&lt;br /&gt;
&lt;br /&gt;
== I want to be one of your Google Summer of Code students, what should I do... ==&lt;br /&gt;
&lt;br /&gt;
Here is a quick list of things to do to get you started&lt;br /&gt;
* Create an account on gna.org&lt;br /&gt;
* Create an account on the wesnoth forum&lt;br /&gt;
* Join the irc channel (#wesnoth-dev on irc.freenode.net) and introduce yourself. We will not give formal interviews, but we will clearly favor people we have learnt to know during the selection process&lt;br /&gt;
* Contact one of our SummerOfCode people (Ivanovic, Sirp, Boucman, Mordante) to have your forum nick marked as a Summer of code student&lt;br /&gt;
&lt;br /&gt;
* Start a wiki page about your idea, add a link on the bottom of this page and add this information on it:&lt;br /&gt;
** List your account names (gna, forum, irc nick) so that we can recognize you&lt;br /&gt;
** Fill the questionnaire on this page: [[SoC_Information_for_Google#Does_your_organization_have_an_application_template_you_would_like_to_see_students_use.3F_If_so.2C_please_provide_it_now.| List of questions to answer]]&lt;br /&gt;
** Detail your idea as much as possible, look at other students pages, and please give milestones and studies you've done&lt;br /&gt;
&lt;br /&gt;
* Though not mandatory, it is highly advisable to go to the [[EasyCoding]] and [[NotSoEasyCoding]] pages and implement one of these ideas (or any idea of similar scope) so we have an idea how you work. Be sure to use your gna account when submitting these patches so we know who it is coming from. You can also implement some features from our feature request database at gna. When you implement something, also list it on your own page with a reference to the patch.&lt;br /&gt;
&lt;br /&gt;
== List of Ideas for the Project (Suggestions from the wesnoth developers) ==&lt;br /&gt;
&lt;br /&gt;
Here is only a short description of possible Ideas we have, each has a page of its own with a more detailed version on it.&lt;br /&gt;
&lt;br /&gt;
=== Writing an AI based on the formula AI ===&lt;br /&gt;
&lt;br /&gt;
Wesnoth has always had a simple C++ based AI. David (our lead developer) has been working on a simple language to write AI in Wesnoth: [[FormulaAI]]&lt;br /&gt;
&lt;br /&gt;
The Wesnoth AI is used as an opponent in most campaigns, and as such is an important piece of code for the Wesnoth project. Unfortunately, because the skills required to understand and modify it are rather arcane, it is also one of the most neglected parts of the Wesnoth code. This is a place where a lot of research and useful work could be done.&lt;br /&gt;
&lt;br /&gt;
[[SoC Ideas FormulaAI]] - Full version of the idea, with detailed information&lt;br /&gt;
&lt;br /&gt;
=== Extending the Multiplayer server ===&lt;br /&gt;
&lt;br /&gt;
Our multiplayer community is generally strong and healthy, but we believe its growth is limited by some problems in the interface of the multiplayer lobby.&lt;br /&gt;
&lt;br /&gt;
[[SoC Ideas Multiplayer server]] - Full version of the idea, with detailed information&lt;br /&gt;
&lt;br /&gt;
=== Scenario/Campaign editor ===&lt;br /&gt;
&lt;br /&gt;
Currently, in order to create campaign or multiplayer scenarios, it is necessary to manually edit WML files - XML-like configuration files. The goal of this project would be to create a graphical editor to make the creative process easier.&lt;br /&gt;
&lt;br /&gt;
[[SoC Ideas Scenario and Campaign Editor]] - Full version of the idea, with detailed information&lt;br /&gt;
&lt;br /&gt;
=== Addon server ===&lt;br /&gt;
Wesnoth has an addon server which offers users to upload user &lt;br /&gt;
made content (UMC). This allows all other users of Wesnoth&lt;br /&gt;
to easily download and install this content. The server was &lt;br /&gt;
originally written for user-made campaigns but contains a lot&lt;br /&gt;
more types of addons nowadays. Both the server side and the &lt;br /&gt;
client side need to be improved.&lt;br /&gt;
&lt;br /&gt;
[[SoC Ideas Addon Server]] - Full version of the idea, with detailed information&lt;br /&gt;
&lt;br /&gt;
=== Map editor ===&lt;br /&gt;
The map editor in Wesnoth serves two goals, making it easy to create&lt;br /&gt;
a new map and helping the terrain artists to test their new terrains.&lt;br /&gt;
&lt;br /&gt;
[[SoC_Ideas_Map_Editor]] - Full version of the idea, with detailed information&lt;br /&gt;
&lt;br /&gt;
=== Other possible ideas to be fleshed out ===&lt;br /&gt;
A MapGenerator rewrite - better scalable for outdoor maps, plus the possibility to define areas (similar to the caverns in the cave generator) etc.&lt;br /&gt;
&lt;br /&gt;
=== Make your own ideas ===&lt;br /&gt;
If you have your own idea the best thing is to join IRC wesnoth-dev at irc.freenode.net and discuss the idea with the developers there. If the developers think your idea is interesting and like the feature you can start to turn it into a full proposal. Once done discuss it again on IRC so the developers can accept your idea.&lt;br /&gt;
&lt;br /&gt;
== Information about our Project ==&lt;br /&gt;
The information we provided google with about our project can be looked up at the site [[SoC Information for Google]].&lt;br /&gt;
&lt;br /&gt;
== People to bug on IRC ==&lt;br /&gt;
We have prepared a list of people with their &amp;quot;area of competence&amp;quot;. This is to give you an idea on which areas those people can be of help for you. Of course you should always just ask in the IRC chan, but those are the most likely ones to answer questions in the respective area. And here is the list:&lt;br /&gt;
&lt;br /&gt;
[[SoC People to bug on IRC]]&lt;br /&gt;
&lt;br /&gt;
== GSoC Student Applicant Ideas == &lt;br /&gt;
&lt;br /&gt;
Every student interested to work on Wesnoth as part of Summer of Code should create a page of his own where several things should be listed. Here is a short list of what should be mentioned on the list (the more info for us, the better...):&lt;br /&gt;
&lt;br /&gt;
* Who are you? Please list your IRC and forum nickname in here and describe yourself so that we get you to know.&lt;br /&gt;
* What do you want to work on? Please flesh out your personal ideas, so that we get to know what you plan to work on.&lt;br /&gt;
* If you already submitted patches, please list those so that we have a reference.&lt;br /&gt;
&lt;br /&gt;
=== [[FormulaAIandDynamicScripting]] (barbarianhero) ===&lt;br /&gt;
This project idea uses Formula AI and Dynamic Scripting to create a tunable and adaptive AI.&lt;br /&gt;
&lt;br /&gt;
===[[FormulaAIStancesSearchandEvaluation]] (andrewbwm) ===&lt;br /&gt;
This project implements Unit Behavioral Stances that are determinet by Search &amp;amp; Evaluation algorithms to determine a flexibile AI.&lt;br /&gt;
&lt;br /&gt;
===[[FormulaAIandThinkingAhead]] (Alesis-Novik) ===&lt;br /&gt;
This project idea uses methods to make the AI *think* ahead.&lt;br /&gt;
&lt;br /&gt;
[[Category:Future]]&lt;/div&gt;</summary>
		<author><name>Alesis-Novik</name></author>
		
	</entry>
</feed>