Improve AI

From The Battle for Wesnoth Wiki

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

This is a Summer of Code 2014 student page


This page is definitely not finished yet




I would like to improve the AI by implementing Global attack / retreat decision.

Elements : Anything around the unit that can cause a change to the behavior

Behavior : Determine what the enemy is going to do based on the elements.

Deliberation : Does the best move depending on the behavior previously set .

To do so I will use probality theory to determine what is best move to do.







1.1) Write a small introduction to yourself.

I'm a 21 year old student in my 2nd year of Mathematics & Informatic at Paris-est Marne la vallée University

1.2) State your preferred email address.

1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?


1.4) Why do you want to participate in summer of code?

It would be great to code during the summer while earning money, it will also help me to improve my programming skills while helping other people .

1.5) What are you studying, subject, level and school?

I'm studying Mathematics ( probality , linear algebra , combinatory and mathematical analysis) and computer sciences ( C language , Unix-shell scripts , algorithm, Databases(My Sql) , Php ),i'm in my second year of License at Paris-Est Marne la vallée University

1.6) What country are you from, at what time are you most likely to be able to join IRC?

France , while in summer , i will be able to join IRC from 12AM GMT+1 to 2-3AM GMT+1

1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.

I don't have any commitments for the summer period , i'll take some vacation 1 week in August , i still have to decide when exactly .


2.1) What programs/software have you worked on before?

Projects at my University , little games like a Snake , Chomp , a Maze , and lately the Travelling salesman problem . All in C langage . I could give the sources , but you wouldn't be able to run it since you need the libraries of my university installed on .

2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)


2.3) Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?

I've never participated , it's my first time .

2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.

No , but I use open source programs everyday

2.5) Gaming experience - Are you a gamer? Yes

2.5.1) What type of gamer are you? Confirmed , between Casual & Hardcore

2.5.2) What type of games? RTS games , like starcraft Moba , as Lol MMORPG , like world of warcraft JRPG , final fantasy , chrono trigger etc... RPG , like oblivion , skyrim, FPS . Also Indie game ( most of the games in Humble Bundle for example ) So all sorts of games

2.5.3) What type of opponents do you prefer?

Depends on the type of game , but usually i prefer fighting against AI

2.5.4) Are you more interested in story or gameplay?

It really depends on the type of game , for example , on a RPG , i think they are both important , whereas on a RTS game , i would focus on gameplay before story .

2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.

No. But if i played , i would go for single player .

2.6) If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our repository (during the evaluation period or earlier) please state so.

Communication skills

3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.

I'm fluent with written English ,and if i don't understand a word , i'll just go search online for the meaning of it.

3.2) What spoken languages are you fluent in?

I'm fluent with French & English

3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.

Never tried , but I think i can manage .

3.4) Do you give constructive advice?

I trie to do so .

3.5) Do you receive advice well?

Yes , if it helps me improve my skills , I always welcome them .

3.6) Are you good at sorting useful criticisms from useless ones?

Hmmm , if the criticisms isn't constructive , i find it less usefull than the contructive ones .

3.7) How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want

I would rather discuss intensively , i've already done the second option on other projects, but sometimes it can be usefull to do so , to see where my mistakes are and try not to do them again.


4.1) Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?

Yes , I selected " Improve AI by implementing global attack/retreat decision " I want to improve the AI by helping it doing the best move , depending on many factors .

4.2) If you have invented your own project, please describe the project and the scope.

4.3) Why did you choose this project?

Sounds like it's fun , and I think it will greatly increase my programming skills in c++

4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".

I booked a week-end in Jun for a Medieval Fair , it will be the second or the third week-end of Jun.

I also have exams at the end of Mai ( last week ) so i won't be there often during that month .

I'll have plenty of time once my exams are over .

At first I will read about the AI code and see how it is done to see where I can focus on upgrading it ,next I'll think about the algorithm to solve the problem and start coding it , depending on how it's going a this point of time , I'll see how to continue

4.5) Include as much technical detail about your implementation as you can

I would to set a factor of "importance" (I'll figure a name later ) to determine which action is the best .

Like "Would it be better to keep that village or leave it to take other one further on the map and risk loosing it"

I would calculate what is the best for each unit , and depend of the result , the IA will attack or defend .

It can be something like

if(probability_enemyUnit_attacks >= 0.8) then defend

The "0.8" valor is only there as example .

It relys on many factors .

4.6) What do you expect to gain from this project?

Increase my skills in C++ programming ( and maybe others langages ) and teamworking with more than 1 person

4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?

I would stay if the team is great .

Practical considerations

5.1) Are you familiar with any of the following tools or languages?

   Git (used for all commits) : No
   C++ (language used for all the normal source code) : No , but i'm good with C , so I think C++ will be ok
   STL, Boost, Sdl (C++ libraries used by Wesnoth) : Never used SDL directly , but a fork from my University , which is easier to use .
   Python (optional, mainly used for tools) : No
   build environments (eg cmake/scons) : No
   WML (the wesnoth specific scenario language) : No
   Lua (used in combination with WML to create scenarios) : Had a look at it , it didn't seem hard.

5.2) Which tools do you normally use for development? Why do you use them?

I usually use Kdevelop 4 on Debian as it's very powerfull and complete . gcc & make for compiling. Dropbox to get my files when i want .

5.3) What programming languages are you fluent in?

I'm fluent in C programming

5.4) Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of "there is no way to contact you" does arise!

This page was last modified on 20 March 2014, at 22:10.