Now that all the AIs use external CAs, there is no need to use the persistent 'data' variable any more, unless information is to be exchanged between different CAs or is supposed to be persistent across save/load cycles.
(cherry-picked from commit 3bfd59f28b)
It probably doen't make a noticeable difference for these AIs, but in general we should not call the slow functions more than necessary.
(cherry-picked from commit 42b4430841)
This involves making the output independent of the stats CA (which is not used any more) and adding missing output to some CAs.
(cherry-picked from commit c2635abde1)
Most of the Fast MAI attack utils had been taken from a more general codebase and included things not needed here. This AI is supposed to be a slimmed down version doing only the absolutely necessary in as fast as possible a fashion.
(cherry-picked from commit f4f2a441e4)
The main reason for doing this, besides simplifying the code, is to avoid using the WML table dump __cfg, which is slow. This includes a change of the format in which the variables are stored, but since these are internal Micro AI utility functions, that does not matter.
(cherry-picked from commit 133568efe6)
These used to be accessible only through unit.__cfg or wesnoth.unit_types. The Fast Micro AI is not included here as it requires a larger clean-up.
(cherry-picked from commit 8af988c697)
Another efficiency improvement. This ensures that the side of the unit
is checked first before the potentially complex rest of the filter is
evaluated.
(cherry-picked from commit 6c38b8ce93)
This is for efficiency reasons, as location filters do not necessarily
change throughout a side’s turn, while fewer and fewer units have moves
left.
(cherry-picked from commit 0dcbe1d0d0)
The old method is very slightly faster in some circumstances (e.g. for
simple filters and when all units have moves/attacks/etc. left), but we
are talking fractions of micro seconds. By contrast, depending on the
filter used, the new method can save large amounts of evaluation time
once some units have move or attacked.
(cherry-picked from commit 972ecc2f56)
- Fix the rabbit AI
- Enable invoke_synced_command to also call (some) built-in commands
and give an error message in the case of an unknown command
- Remove some unnecessary implementation details
fixes#1649 . ai.synced_command could easily be used to implement all types of
undeteced cheats so it was removed. As a replacement this commit adds a
[custom_command] synced command that just calls
wesnoth.game_events.on_synced_command which calls a lua handler that
must first be set.
This removes the Lua deprecation_message function in favour of exposing the C++ variant to Lua instead.
It also moves all deprecation messages to a separate logdomain, making them easily enabled en masse.
This reverts commit 1d84d83c6c.
I had introduced use of the hidden= key in b2df837d8e, but
apparently didn't add them to the valid list of non-aspect keys.