Soc2012 Talbot Pierre Refactor Recruitment Algorithm
This page is related to Summer of Code 2012 |
See the list of Summer of Code 2012 Ideas |
This is a Summer of Code 2012 student page |
/!\ In construction.
Contents
- 1 Description
- 2 IRC
- 3 Questionnaire
- 3.1 1) Basics
- 3.1.1 1.1) Write a small introduction to yourself.
- 3.1.2 1.2) State your preferred email address.
- 3.1.3 1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?
- 3.1.4 1.4) Why do you want to participate in summer of code?
- 3.1.5 1.5) What are you studying, subject, level and school?
- 3.1.6 1.6) What country are you from, at what time are you most likely to be able to join IRC?
- 3.1.7 1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.
- 3.2 2) Experience
- 3.2.1 2.1) What programs/software have you worked on before?
- 3.2.2 2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)
- 3.2.3 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?
- 3.2.4 2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.
- 3.2.5 2.5) Gaming experience - Are you a gamer?
- 3.2.5.1 2.5.1) What type of gamer are you?
- 3.2.5.2 2.5.2) What type of games?
- 3.2.5.3 2.5.3) What type of opponents do you prefer?
- 3.2.5.4 2.5.4) Are you more interested in story or gameplay?
- 3.2.5.5 2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.
- 3.2.6 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 SVN (during the evaluation period or earlier) please state so.
- 3.3 3) Communication skills
- 3.3.1 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.
- 3.3.2 3.2) What spoken languages are you fluent in?
- 3.3.3 3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.
- 3.3.4 3.4) Do you give constructive advice?
- 3.3.5 3.5) Do you receive advice well?
- 3.3.6 3.6) Are you good at sorting useful criticisms from useless ones?
- 3.3.7 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
- 3.4 4) Project
- 3.4.1 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?
- 3.4.2 4.2) If you have invented your own project, please describe the project and the scope.
- 3.4.3 4.3) Why did you choose this project?
- 3.4.4 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".
- 3.4.5 4.5) Include as much technical detail about your implementation as you can
- 3.4.6 4.6) What do you expect to gain from this project?
- 3.4.7 4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?
- 3.5 5) Practical considerations
- 3.5.1 5.1) Are you familiar with any of the following tools or languages?
- 3.5.2 5.2) Which tools do you normally use for development? Why do you use them?
- 3.5.3 5.3) What programming languages are you fluent in?
- 3.5.4 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!
- 3.1 1) Basics
- 4 Proposal
Description
Talbot Pierre - Refactor Recruitment Algorithm
TODO: Write a small (1-4 sentences) description of your proposal here.
TODO: Add more first-level sections to detail your proposal
IRC
trademark
Questionnaire
1) Basics
1.1) Write a small introduction to yourself.
My name is Pierre Talbot, I'm 20 year old. I didn't discovered the programming when I was young, such we often see. Before I dive into this beautiful world I played a lot. I made the most important step in my life 3 years ago when I began my studies.
1.2) State your preferred email address.
ptalbot [at] mopong (dot) net
1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?
trademark
1.4) Why do you want to participate in summer of code?
It's for two main reasons, the first is the money. The second is to move forward my dream to become a game programmer specialised in artificial intelligence. It's also to meet new people and to discuss around a common passion. It would be the first time I code for a project of this size, I think it's a necessary step to go beyond the programmer amateur and be ready for the real world.
1.5) What are you studying, subject, level and school?
I'm finishing this year my B.Sc. in Computer Science at the University of Claude Bernard Lyon 1.
1.6) What country are you from, at what time are you most likely to be able to join IRC?
I'm from France, so I'll be able to join IRC between 3 am UTC and 6 pm UTC. I'll be the most responsive during in the morning.
1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.
I have an internship during the summer, from may to august. I discussed about it with Crab_ on IRC, I asked him if it was feasible and he helps me to do a long term planning.
I'll get up early, around 4-5 am UTC+2 and I will work for Wesnoth until 9 am UTC+2. Without any distraction and with my fresh and rested head. My internship will begin at 10 am UTC+2 and finish at 6 pm UTC+2. I'll go to sleep around 8 pm UTC+2.
The week will be dedicated to code functionalities and the week-end will be reserved to rest myself up and to think about the code design of the next week.
I'm used to work a lot and all the day, my motivation can defeat the rules of time.
2) Experience
2.1) What programs/software have you worked on before?
I mainly developed short programs for school purpose such as a chess-game in C++, a pong and a naval battle in C, an adaptation of the well-known board game "Jungle Speed" in Java. I also code few data structures module such as Hash map, Tree, List,... but also the skip-list, Red-black tree in C. I'm used to work with graph and graph algorithm in C++.
I often code short and efficient programs because I like participate in programming contest. I'm participating for the second year in Prologin, which is an algorithmic French contest. The final is a 36 hours contest where the finalists must code an artificial intelligence of a given subject. I also prepare myself for the regional ACM-ICPC contest in 2012.
2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)
Most of the projects I spoke before were in team of 2 or 3 peoples and we used version control software.
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?
Yes, I participated as a student in 2011. It was my first real experience. I was accepted in the Boost C++ Library organisation to design and code a check digit verification and computation library oriented "human-error". For example, your credit card number or the ISBN in the back of a book have a check digit. It's not for transmission error control purpose, these checksums are designed to control the human encoding errors.
I successfully finished the summer and continued to develop and work on it during the year studying permitting. My contribution to this organisation is not done yet and I will continue to prepare my library for a Boost review.
I gain a lot of experience in C++ and mostly with some Boost library such as MPL, Test, Iterator, Phoenix, Preprocessor, Range, and all the others I've forgotten that made the programmer life easier. I studied these libraries to be sure to do the most generic library as I can. I also learned to use the Boost chain-tools to document and test.
My mentor was Paul Bristow and we regularly keep in touch since the beginning of GSoC, feel free to contact him here : pbristow [at] hetp.u-net (dot) com.
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.
2.5) Gaming experience - Are you a gamer?
I was what we called a "real" gamer few years ago. I play a lot less now as my interests has slipped into the programming. Anyway I love games and this passion will never pass away.
2.5.1) What type of gamer are you?
I'm a gamer who hasn't played a lot of different games. I prefer plays online because I love the competition and progress with my rank.
2.5.2) What type of games?
- Strategy : 400 hours in Warcraft III, rank 647 in Free For All and rank 630 in Arranged team 3vs3.
- CCORPG : 3600 hours in Guild Wars over 4 years. Best rank 497 in 1vs1 (PvP, mode Hero vs Hero).
- FPS : Call of duty 4.
- Race : 100 hours in Trackmania.
There are my prefered games. Currently, when I really need a break, I like to play COD4. I also played few others games I didn't mention because I didn't play these much.
2.5.3) What type of opponents do you prefer?
In my good days, I like the opponent who defeats me, so I can learn from my losses and improved my technical skills.
In my bad days, I don't like to lose and I just want to win. Contradictorily, I don't win a lot these days.
2.5.4) Are you more interested in story or gameplay?
When I don't play online, I think the story is important and I like to enjoy the mainline story. A contrario, when I play online, I prefer a balance gameplay which allow you to create new strategy.
2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.
I started the campaign and I finished few scenarios. I played about 5 hours. I also played online in a custom game. I'm not good enough to play online as I don't know the units and the strategy used (I've started to watch game replay of experienced gamers).
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 SVN (during the evaluation period or earlier) please state so.
A bug: Bug #19538.
While I read the code I improve a function and did a patch: Patch #3236.
3) 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 only write my program in English (even if there are unimportant) and I document them in English as well. I haven't problem to discuss in English.
3.2) What spoken languages are you fluent in?
French.
3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.
I know how the gamers can be, and mostly when they are experimented. I'll try to do my best to be, as soon as possible, an experienced gamer. I treated guys of noob and be treated as well, I've been on the both side so I know what is good to say or not.
3.4) Do you give constructive advice?
I'm member of a French forum "Developpez.com" where I give advices and help people. I'm not always good but I try to respond with precision and completeness, I want to show them all the possible tracks I know.
3.5) Do you receive advice well?
I have difficulties to receive advices from guys of the same level as me, I'm reluctant to follow their ideas if I don't see what's the aimed or the improvement.
From my mentor or an experienced coder, I follow the ideas more easily because I trust them. Anyway, whatever the advices is it, I try to keep my critical. For example, I change my coding style the last year for Boost, I indent with 2-spaces instead of a tab now.
3.6) Are you good at sorting useful criticisms from useless ones?
I think so, because, as explain above, I only fully consider criticisms I understand well.
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 like to lay down on paper my ideas to be clear. If I'm really not sure about something, I'll ask for help on IRC, forum,... Otherwise, I code it. I have difficulties to thrown away my code, but I have the feeling that is a better way to take a decision. It's a debate in my head and I'll try to code sooner to "see how it turn out".
4) Project
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?
4.2) If you have invented your own project, please describe the project and the scope.
4.3) Why did you choose this project?
I choose this project because I think that programming AI is like a playground to implement all the theory we want, such as the graph theory.
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".
4.5) Include as much technical detail about your implementation as you can
4.6) What do you expect to gain from this project?
4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?
5) Practical considerations
5.1) Are you familiar with any of the following tools or languages?
- Subversion: Yes, I used it during my previous GSoC. For my personal projects, I'm using git.
- C++: My level is correct, I can easily debug and understand the concept and features of this language.
- STL, Boost, Sdl: I know a large part of the STL and some libraries from Boost (MPL, Phoenix, Range,...). I used very few the SDL during a C project.
- Python (optional, mainly used for tools): I wrote one project with it: a SAT solver.
- build environments (eg cmake/scons): I recently used these to compile Wesnoth, but I need to learn deeply how they work (add file,...).
- WML (the wesnoth specific scenario language): I read the manual and some files' campaign.
- Lua (used in combination with WML to create scenarios): No.
5.2) Which tools do you normally use for development? Why do you use them?
I'm using VIM and g++, because they are open-source, light and everything is in the terminal, so I rarely quit my keyboard to use the mouse. I'm using git because there are local commit and branches.
However I also programmed under Visual Studio the last year.
5.3) What programming languages are you fluent in?
C++ mostly but also C and Java.
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!
I'll let you my number in the official form but I'm not very confident in my comprehension and speaking. However, if you speak clearly, it should be alright.
Proposal
There are few points to refactor. I try to explain these with an incremental approach, for a specific point, there is few steps and they can't be jump. This is useful to code & test and directly spot the potential bugs.
The class recruitment_phase and aspect_recruitment_phase are the main classes related to this proposal. But the entire file ai/testing/ca.* and the directory ai/testing/* will be usefull as well. Of course, we are not limited to these files.
Recruiting with multiple leaders
Current implementation
During the evaluation phase, BAD_SCORE is returned if the first leader is not on keep, if the castle is full or if there is no leader available. During the execution phase, only one location is considered.
Goal
AI should consider multiple leaders and use a list of leaders which are on a keep.
If the leaders are not on keep, we must choose a castle not too far and not too close from the battle for each leaders. Anyway, if it's not possible we choose the furthest keep from the battle and we don't move a leader to the closest.
Implementation
The function find_leaders will help us to achieve this goal. We'll need to modify recruitment_phase::evaluate() and when counting neutral village (for the scout), consider all the keeps. The scouts will distributed on all the keeps which have neutral villages.
Returns: The different location of neutral village per leaders. Every map_location is unique. std::vector<std::pair<unit_iterator, map_location> > get_neutral_village(std::vector<unit_iterator> &leaders);
analyze_potential_recruit_combat should be leader specific.
Random units
A good part of the AI is to choose random units when it doesn't know what to do. We should improve it to recruit the best units against the closest enemies and against the most numerous units. Another criteria should be the units that threaten the leaders.