SoC Ideas Whiteboard Multiple CTK 2012

From The Battle for Wesnoth Wiki
Revision as of 01:32, 20 March 2012 by Gabba (talk | contribs)

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 Idea


Whiteboard: Multiple Chance-to-kill calculations and interface polish

Page for the idea: SoC Ideas Whiteboard Multiple CTK 2012

The whiteboard (the wesnoth action-planning system) allows you to plan several attacks on a single unit. Wesnoth already computes your chances to kill an attacked unit in a 1v1 fight in the battle dialog: extend this dialog to compute total kill chances taking into account all successive planned attackers.

In addition, the whiteboard interface still has some outstanding bugs or incomplete features and usability issues. Identify as many of those problems as possible and propose ways to solve them (see details for some ideas).

Finally, do exhaustive playtesting and bugfixing involving devs and community members to make sure the whiteboard is fully reliable.

There are 8 submitted student proposals for this idea

Andriy Andriychuk - "Total defence" strategy

The idea is to group own troops so they are in advantageous position and get less damage.
See Avrilfanomar for more information.

See Kripsi for more information.

Sanka Darshana - "Implement a 'total defense' strategy"

The AI will decide the best movements considering the resources available, enemy positions and their types, enemy distribution and etc... The generated movements will be decided on the values of the each troop. As an example, a shaman will be more important if there are more troops with low health, and Archers if there are troops with health. So the AI will determine which actions to take depending on a list of variables in the game environment
See SankaD for more information.

Geoffrey Hart - Maximizing Utility

A good offense is made by identifying an opponents vulnerabilities and exploiting them. As such, a good defense is made by reducing the number of weak spots. Since there is no perfect unit and all have their own imperfections, the idea is send them out in groups of units that compliment each others strengths and weaknesses. This will allow them to rearrange themselves in a way most suitable to handle nearby enemies. Since the number of predictive steps the AI can make is limited, it can become "surprised" rather easily. Therefore, it's a good choice to maximize utility and the ability to be flexible in order to handle these surprises. Then, within action-packed skirmishes, raw processing power can be brought to bear more effectively.
See SOC - Geoffrey Hart for more information.

Christopher Conway - Defensive AI

My goal is to develop an AI which is capable of “total defense” behavior, as opposed to the current aggressive AI. It would allow for the AI to function in scenarios like controlled retreats, unit escort, or holding a given area while minimizing unit loss.
See Soc2012 Borgrumm Defensive AI for more information.

Conor Nevin - Implementing a Total Defense AI

Implementing a defensive mode of the AI, so that it is able to heal units whilst holding ground against an advancing enemy.
See Soc2012 cnevin92 Total Defense AI for more information.

Nikolay Agafonov - Line Defence Strategy

The idea of this strategy is to stick together the troops and create the defencive line. All the units should be put on hexes where they would be on the defensive in most effective way. THere would be some kinds of AI's behaviour (full retreat, banking, passive attack etc.) depending on on game factors.
See SoC2012 LineDefenceStrategy for more information.

Ed Kim - Total Defense AI

Often, the best defense is a good offense. In Wesnoth, lacking either can get you slaughtered. It is particularly important that the AI learn not only to consider immediate gains and losses off a linear formula, but to take other considerations into account, especially some foresight into human reactions and macroscopic army flux. Similar to a chess engine, if the AI could learn to take "next move" heuristics into account as well as consider positional strategies such as defensive formations (line, square) by taking unit relationships into account, the AI would become a much more versatile and formidable foe.

See SoC2012 Yokipi Total Defense AI for more information.

Additional Information

Chance-to-kill calculations for multiple planned attacks

The main challenge here besides computing the odds will be to design a good interface to accomodate this new info. You should at the very least submit UI mockups. Be aware that your UI should still work at the lowest resolution Wesnoth supports.

Optional addition: When several attacks are planned it can be hard to remember which unit is using which weapon. Try and find a way to display this information. Again, UI mockups are necessary so we can evaluate your idea.

Polishing up the Suppose Dead feature

The whiteboard has a "suppose dead" feature from GSoC 2011 which is currently disabled for lack of a good UI. This feature allows to basically remove a unit from the game temporarily to see how it affects pathfinding and zones of control. Propose visuals and a UI for this feature to try and redeem it. Yes, you guessed it, UI mockups needed.

Misc polishing

  • Ensure the interface to show/hide your allies' plans works properly and has good usability.
  • Reduce visual clutter as much as possible: more visual elements such as numbers for planned moves should probably only display when a planned action is highlighted. This and other visual choices should be made optional: show always/show on highlight/never show.
  • The interface for moves which go over multiple turns needs some work. Currently the emphasis is on the last future position of the unit (even if that is 5 turns from now), while it should probably on where the unit will end up during this turn.


Past experience has shown that properly testing the whiteboard means testing:

  • campaigns
  • multiplayer scenarios vs the AI and vs players, with and without heavy WML scripting
  • observers (can cause bugs and should be tested)
  • 2v2 matches

For proper playtesting you'll need to create several very simple scenarios that allow to quickly test all the possible planned actions, i.e. recruit, recall, move (including over several turns), attack, and eventually the "suppose dead" action if we re-enable it.

You should at first do exhaustive tests by yourself up to simulating 2v2 matches with 4 local clients, and when you're confident the game is bug-free, organise matches with devs and community members to put the whiteboard's usability to the test, and to find the last, least obvious bugs.


Prior Wesnoth playing experience is required, since you're gonna do interface design, and a multiplayer match versus the whiteboard developer will be part of the acceptance process (don't worry, he sucks at competitive Wesnoth, and you're only expected to show that you have some clue on how to play the game).

Good C++ skills are recommended, as is at least basic experience in interface design. You should also have a basic grasp of statistics, for the CTK calculations.

Note that all feature development (i.e. multiple CTK and Suppose Dead) must be finished by the GSoC midterm evaluation, after which all the time will be reserved for playtesting and further polishing.

Whom to ask about this

gabba on irc. If I'm hard to reach you can also find my email in the game's source files (if you're gonna make the effort to find it, I can make the effort to read your mail ;) ).

Crab_ on irc can point you to the existing code for chance-to-kill calculations.