GSoC/GCI Archive
Google Code-in 2012 Copyleft Games Group

Wesnoth: Micro AI 'Wolves Multipacks' - Generalize

completed by: Martin Bede

mentors: Nils Kneuper, Alarantalara, mattsc

[IMAGE http://gci.copyleftgames.org/img/icons/lua.png]
[IMAGE http://gci.copyleftgames.org/img/icons/wesnoth.png]

A number of Wesnoth AIs have recently been converted to Micro AIs, including the 'Wolves Multipacks' AI (not to be confused with the Wolves AI) defined in file microa_ais/ais/mai_animals_engine.lua). The behavior of this AI is still too specialized for a general Micro AI. The goal of this task is therefore to make it more generally useful by adding parameters to the [micro_ai] tag, as well as by generalizing the code.

First, make the unit type of the predators (currently hardcoded to Wolf) a parameter of the [micro_ai] tag. Also, add a boolean parameter "show_pack_number=" that turns the pack numbers currently displayed on the map for each wolf on or off. It should default to 'false'.

Second and more importantly, the wolves code currently only assembles packs of 3 wolves. Generalize the code such that the pack_size= is another free parameter of the [micro_ai] tag.

The task is completed when the AI has been generalized as per the steps above and this has been documented on the Wesnoth wiki.

Documentation about Micro AIs in general and about the previous GCI Micro AI tasks are available on the Wesnoth wiki.