This is done in this way to keep computational overhead as low as
possible.
Also add an optional key attack_hidden_enemies. This can be used to
attack also hidden enemies; or to speed up the AI a little when no
hidden enemies are present.
Apparently, when this is the case, the number key is not included at
all, rather than set to zero, when the Lua table containing the attack
information is retrieved.
wesnoth.get_locations includes border hexes, so they need to be
excluded specifically. Previously this could cause error messages and
the CA to be blacklisted.
The problem is due to a dog adjacent to a sheep being excluded from the
dog_move CA (so that it can act further later on in case the sheep
moves again). It is fixed by adding another CA at the end that simply
takes all moves away from all dogs once all other CAs are done.
Hexes occupied by allied units were previously not excluded properly by
the AI, which could lead to error messages and the candidate action to
be blacklisted.
If the move of the attacker toward the target is interrupted by an
ambush, the attack action previously caused an error, because the
attacker did not get to its target.
In this case, it can happen that there are no goals (e.g. if there are
also no villages or if the AI has no leader). Previously, this
situation caused an error message.
In normal MP and SP games, these macros are defined previously and
including them here produces unnecessary overhead. However, they are
not defined when an AI MP game is started from the commandline with the
-m and --ai-config options.
If the lurker move is interrupted by an ambush, the attack action
previously sometimes caused an error, because the lurker might not get
to its target.
Somehow the combination of “” and new lines caused the string to be
terminated prematurely when it was extracted into the .pot file. Fixed
by removing the “”.
Previously, only terrain with C or K in the terrain code passed the
SLF. Now we check whether the hex is a castle instead, independent of
the terrain code.
This is done for cases when the value cannot be read from the unit_info
table, which might happen in some UMC. This fixes a rare bug affecting
the Fast Micro AI attack evaluation
Check whether the unit in the way has an unoccupied hex to move to.
Previously, it was only checked whether its reach was >1, which
sometimes can include only hexes occupied by units on its own side,
making the actual move impossible.
This AI is meant as a fall-back AI for scenarios where there are so
many units that attacks and moves done by the default AI are slow with
long delays before each move. It replaces the default combat and
move-to-targets candidate actions.
See http://wiki.wesnoth.org/Micro_AIs
This was an idea we tried so that we’d start with the most uncertain
attack first, but it did not work very well.
Keep the code for now, just comment it out.