SoC2012 TorminaTor AI Campaigns

From The Battle for Wesnoth Wiki
Revision as of 19:40, 20 March 2013 by Esr (talk | contribs) (Questionnaire)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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


Philipp Battenberg - AI: teach the AI to play Wesnoth's mainline campaigns

Well, what the title says, which includes some AI improvements in general.

Your suggestions

  1. move a unit to location
  2. keep a unit alive
  3. keep an ally alive
  4. keep as much money and high-level recalls as possible
  5. do a proper recall
  6. protect units close to level up better.
  7. improve interaction of the player with AI allies.
  8. if you almost lost, try to make it possible for an ally to save you (by retreating the leader and critical units, for example)

possible requirements

These are things which could be needed (if yes, then it will be implemented).

  • better defending capabilities (I don't remember if the main campaign requieres it)
  • better recruiting (synergizes with 5.)
  • better AI interface

Yes, those things are other ideas, but with far more limited extent. (As much as is needed to prevent the AI from dying of stupidity)




1) Basics

1.1) Write a small introduction to yourself.

My name is Philipp Battenberg, 21 year old computer science student.

1.2) State your preferred email address.

p.Battenberg at

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?

  • To gain more experience
  • An unexplainable urge to help a OpenSource-project
  • It is better than finding a job unrelated to my abilities.

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

I study computer science at the TU Darmstadt and will be in my fifth semester.

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

I am from Germany and will try to be online a lot, but as I don't know my exact schedule yet, I can only guarantee 17-22 GMT.

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

Well, I do study. (Who would've guessed?)

2) Experience

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

  • Communication between PC and PLC(Programmable logic controller) (commercial)
  • small games (educational and private)
  • vector stuff (for e.g. Rendering) (educational)
  • some network-programming (private)
  • calculations on/with/for grids (private and OpenSource-Projects)
  • a lot of different small stuff (educational and private)

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

Yes, see below.

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?

No, first timer here.

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

I am involved with "Zero-Projekt" (, where I am head of Story/Gameplay and am mostly doing Ruleset (inclusive implementation), and some small AI-stuff.

2.5) Gaming experience - Are you a gamer?

A little bit.

2.5.1) What type of gamer are you?

I AM an occasional gamer, but played a lot of computer games in my youth. But in general I play pretty much single player only.

2.5.2) What type of games?

  • Rollplaying Games (Fallout 1+2, Baldurs Gate Saga,...)
  • Adventure Games (Monkey Island 1-3, Simon The Sorcerer 1+2,...)
  • Strategie (StarCraft, Wesnoth,...)
  • Sneaking and such (Thief)

2.5.3) What type of opponents do you prefer?

Challenging ones.

2.5.4) Are you more interested in story or gameplay?

Both. I played games with crappy story and excellent gameplay and the other way around.

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

As already noted I lean toward single player, and I played it for a month or two, as I discovered Wesnoth when I was stopping gaming.

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 S­­V­­N (during the evaluation period or earlier) please state so.

No, haven't done so.

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.

It has been a long time since I actively used English and have dyslexia, so it could be a short time, until I can write nearly as fast as in my mother tongue. Reading is no problem at all.

3.2) What spoken languages are you fluent in?

German and 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.

Honestly, I do not know, as I haven't played multiplayer much or used gaming forums.

3.4) Do you give constructive advice?

Yes, or at least try as far as my knowledge allows.

3.5) Do you receive advice well?

As with critisms one has to differentiate between useful, useless, good and bad advice. If it is (at the moment) useless, but generally good advice, I try to remember it for later use.

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

I sure hope so.

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

Before implementing a feature, I would ask if there are some major limitations or mandatory elements.

It is possible that I use "quick&dirty proof of concept"-Code to convince somebody, e.g. that something DOES work.

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?

I chose "AI: teach the AI to play Wesnoth's mainline campaigns" and concentrate on exactly that: Enhancing the AI to be able to play campaigns(, which should improve the AI generally).

4.3) Why did you choose this project?

  • I am interested in AI-programming
  • As I am a kind of strategist, it should be interesting.

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".

The mid-term goal should be that the AI can play at least the less-complicated levels of the main campaign, therefore features like "move unit to" and "keep alive" would be first, with perhaps "ally interaction" The second half would be dedicated for last features, fine-tuning/optimization and final debugging. As it is not clear when my exams will take place, I can only predict, that I probably will have less time in August.

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

As I am not yet familiar with the current AI-implementation, it is hard to tell something about technical details, because a lot of things depend on that.

If possible I will try to abstract some things, so there will hopefully no difference between a human or AI ally, or between keeping alive own unit and ally unit.

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

  • more Knowledge about AI-Programming
  • see 1.4

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

It would depend on how much I will like the Wesnoth community and on my freetime (and other freetimer-projects)

5) Practical considerations

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

  • Sub­­version (used for all commits)

Worked with it several times.

  • C++ (language used for all the normal source code)


  • STL, Boost, Sdl (C++ libraries used by Wesnoth)

Until now, only SDL.

  • Python (optional, mainly used for tools)


  • build environments (eg cmake/scons)

Only compiled things with it, no writing of CMakeFiles or SConscript

  • WML (the wesnoth specific scenario language)


  • Lua (used in combination with WML to create scenarios)

Not yet.

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

Writing Code:

  • Leafpad (for short work)
  • Lazarus (for Pascal)
  • Gobby (for rest, allows collaberative development) => Syntax highlighting


  • IRC
  • pastebin
  • bpaste

5.3) What programming languages are you fluent in?

(Object)Pascal, C/C++, Java, VisualBasic, Python, Assembler(x86 AT&T), SymPas

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 wouldn't mind. I will provide the phone number.

This page was last edited on 20 March 2013, at 19:40.