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

Wesnoth: Micro AI 'Patrol' - Occupied Waypoints

completed by: gh0st

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 'Patrol' AI. However, the behavior of the patrol unit is undesirable when the next waypoint is occupied and the unit on it is not on the list of units to be attacked. It effectively stalls the patroller. The goal of this task is two-fold:

First, implement a behavior that avoids this situation. There are several (fundamentally different) possible approaches to do this, and it is up to you which one you want to implement.

Second, add the same waypoint method to the Messenger Escort Micro AI as well. Currently, the Messenger only moves toward a final goal along approximately the shortest route. This should be changed so that intermediate waypoints are possible. If these waypoints are occupied, they should be dealt with in the same way as in the Patrol Micro AI.

The task is completed when both AIs have been changed to use the new waypoint method and this has been documented on the Wesnoth wiki.

Documentation about Micro AIs in general, including the Patrol and Messenger Escort Micro AIs, and about the previous GCI Micro AI tasks are available on the Wesnoth wiki.