[wesnoth-commits] [wesnoth/wesnoth] a68663: Lua AIs: use unit methods instead of wesnoth funct...

GitHub noreply at github.com
Sat Sep 22 13:18:35 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: a6866390dfa64097fa4cb099b39736c3e2220ce4
      https://github.com/wesnoth/wesnoth/commit/a6866390dfa64097fa4cb099b39736c3e2220ce4
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-27 (Mon, 27 Aug 2018)

  Changed paths:
    M data/ai/lua/ai_helper.lua
    M data/ai/lua/battle_calcs.lua
    M data/ai/lua/ca_high_xp_attack.lua
    M data/ai/lua/generic_recruit_engine.lua
    M data/ai/lua/generic_rush_engine.lua
    M data/ai/lua/retreat.lua
    M data/ai/micro_ais/cas/ca_assassin_move.lua
    M data/ai/micro_ais/cas/ca_bottleneck_move.lua
    M data/ai/micro_ais/cas/ca_fast_attack_utils.lua
    M data/ai/micro_ais/cas/ca_fast_move.lua
    M data/ai/micro_ais/cas/ca_goto.lua
    M data/ai/micro_ais/cas/ca_healer_move.lua
    M data/ai/micro_ais/cas/ca_herding_sheep_move.lua
    M data/ai/micro_ais/cas/ca_messenger_move.lua
    M data/ai/micro_ais/cas/ca_protect_unit_move.lua
    M data/ai/micro_ais/cas/ca_stationed_guardian.lua
    M data/ai/micro_ais/cas/ca_zone_guardian.lua
    M data/campaigns/The_Rise_Of_Wesnoth/ai/ca_aggressive_attack_no_suicide.lua

  Log Message:
  -----------
  Lua AIs: use unit methods instead of wesnoth functions


  Commit: b3058e8e8eb119db883a1543143bd4523c93f239
      https://github.com/wesnoth/wesnoth/commit/b3058e8e8eb119db883a1543143bd4523c93f239
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-27 (Mon, 27 Aug 2018)

  Changed paths:
    M data/ai/micro_ais/cas/ca_messenger_move.lua

  Log Message:
  -----------
  Messenger MAI Lua code: change proxy unit location directly


  Commit: 83c4ef24189c9986eae7535b10ba4babb921e3b8
      https://github.com/wesnoth/wesnoth/commit/83c4ef24189c9986eae7535b10ba4babb921e3b8
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-27 (Mon, 27 Aug 2018)

  Changed paths:
    M data/ai/lua/battle_calcs.lua
    M data/ai/lua/generic_rush_engine.lua
    M data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua
    M data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua
    M data/campaigns/The_Rise_Of_Wesnoth/ai/ca_aggressive_attack_no_suicide.lua
    M data/campaigns/The_Rise_Of_Wesnoth/ai/ca_retreat.lua

  Log Message:
  -----------
  Lua AIs: remove unused debug output


  Commit: 3f54908b0ba69173442107105889caeb891b922d
      https://github.com/wesnoth/wesnoth/commit/3f54908b0ba69173442107105889caeb891b922d
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-27 (Mon, 27 Aug 2018)

  Changed paths:
    M data/ai/lua/ai_helper.lua
    M data/ai/lua/battle_calcs.lua
    M data/ai/lua/generic_recruit_engine.lua
    M data/ai/lua/generic_rush_engine.lua

  Log Message:
  -----------
  Lua AIs: replace print() by std_print()


  Commit: 8af988c6972abe75e985d0e43bd8186fe4826cb6
      https://github.com/wesnoth/wesnoth/commit/8af988c6972abe75e985d0e43bd8186fe4826cb6
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-27 (Mon, 27 Aug 2018)

  Changed paths:
    M data/ai/lua/battle_calcs.lua
    M data/ai/lua/ca_high_xp_attack.lua
    M data/ai/lua/generic_rush_engine.lua

  Log Message:
  -----------
  Lua AIs: get unit cost/level directly from proxy unit

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.


  Commit: 133568efe6851944f0b9ddaaf75ccaff0cad6a4d
      https://github.com/wesnoth/wesnoth/commit/133568efe6851944f0b9ddaaf75ccaff0cad6a4d
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-27 (Mon, 27 Aug 2018)

  Changed paths:
    M data/ai/micro_ais/micro_ai_unit_variables.lua

  Log Message:
  -----------
  Micro AIs: simplify unit variable handling functions

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.


  Commit: aa59ac54557bc24615cb3f990bcd1dbf6f5d1ea9
      https://github.com/wesnoth/wesnoth/commit/aa59ac54557bc24615cb3f990bcd1dbf6f5d1ea9
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-28 (Tue, 28 Aug 2018)

  Changed paths:
    M data/ai/lua/battle_calcs.lua
    M data/ai/lua/generic_recruit_engine.lua

  Log Message:
  -----------
  Lua AIs: avoid using __cfg for accessing weapon specials


  Commit: 5335a2af335ffdce65097e26359e96a0cbe2c733
      https://github.com/wesnoth/wesnoth/commit/5335a2af335ffdce65097e26359e96a0cbe2c733
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-29 (Wed, 29 Aug 2018)

  Changed paths:
    M data/ai/lua/battle_calcs.lua

  Log Message:
  -----------
  Lua AI utility functions: fix for chance-to-hit specials without id

All mainline chance-to-hit weapon specials have ids, but it is not required for UMC specials.


  Commit: 8a996c55b968b14b04a551db46b7ab3de735696f
      https://github.com/wesnoth/wesnoth/commit/8a996c55b968b14b04a551db46b7ab3de735696f
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-29 (Wed, 29 Aug 2018)

  Changed paths:
    M data/ai/lua/generic_recruit_engine.lua
    M data/ai/lua/generic_rush_engine.lua
    M data/ai/micro_ais/cas/ca_forest_animals_move.lua
    M data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua

  Log Message:
  -----------
  Lua AIs: remove inclusions of unused libraries


  Commit: 1680436f729a42ede1bd2e1898ef4583c36b14d3
      https://github.com/wesnoth/wesnoth/commit/1680436f729a42ede1bd2e1898ef4583c36b14d3
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-29 (Wed, 29 Aug 2018)

  Changed paths:
    M data/ai/micro_ais/micro_ai_helper.lua

  Log Message:
  -----------
  Lua AIs: remove another unused library inclusion


  Commit: f4f2a441e41cea635861630eb555af9f510c9b52
      https://github.com/wesnoth/wesnoth/commit/f4f2a441e41cea635861630eb555af9f510c9b52
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-29 (Wed, 29 Aug 2018)

  Changed paths:
    M data/ai/micro_ais/cas/ca_fast_attack_utils.lua
    M data/ai/micro_ais/cas/ca_fast_combat.lua
    M data/ai/micro_ais/cas/ca_fast_combat_leader.lua
    M data/ai/micro_ais/cas/ca_fast_move.lua

  Log Message:
  -----------
  Fast Micro AI: code cleanup

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.


  Commit: cb423b2fbd40fdf5e14549a301fee06237bf4626
      https://github.com/wesnoth/wesnoth/commit/cb423b2fbd40fdf5e14549a301fee06237bf4626
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-30 (Thu, 30 Aug 2018)

  Changed paths:
    M data/ai/lua/ai_helper.lua
    M data/ai/lua/battle_calcs.lua
    M data/ai/lua/generic_rush_engine.lua
    M data/ai/lua/retreat.lua
    M data/ai/micro_ais/cas/ca_big_animals.lua
    M data/ai/micro_ais/cas/ca_bottleneck_attack.lua
    M data/ai/micro_ais/cas/ca_bottleneck_move.lua
    M data/ai/micro_ais/cas/ca_coward.lua
    M data/ai/micro_ais/cas/ca_fast_combat.lua
    M data/ai/micro_ais/cas/ca_fast_combat_leader.lua
    M data/ai/micro_ais/cas/ca_fast_move.lua
    M data/ai/micro_ais/cas/ca_forest_animals_move.lua
    M data/ai/micro_ais/cas/ca_forest_animals_tusker_attack.lua
    M data/ai/micro_ais/cas/ca_forest_animals_tusklet_move.lua
    M data/ai/micro_ais/cas/ca_goto.lua
    M data/ai/micro_ais/cas/ca_hang_out.lua
    M data/ai/micro_ais/cas/ca_healer_move.lua
    M data/ai/micro_ais/cas/ca_herding_attack_close_enemy.lua
    M data/ai/micro_ais/cas/ca_herding_herd_sheep.lua
    M data/ai/micro_ais/cas/ca_hunter.lua
    M data/ai/micro_ais/cas/ca_messenger_attack.lua
    M data/ai/micro_ais/cas/ca_messenger_escort_move.lua
    M data/ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua
    M data/ai/micro_ais/cas/ca_messenger_move.lua
    M data/ai/micro_ais/cas/ca_protect_unit_attack.lua
    M data/ai/micro_ais/cas/ca_protect_unit_move.lua
    M data/ai/micro_ais/cas/ca_simple_attack.lua
    M data/ai/micro_ais/cas/ca_stationed_guardian.lua
    M data/ai/micro_ais/cas/ca_wolves_move.lua
    M data/ai/micro_ais/cas/ca_wolves_multipacks_attack.lua
    M data/ai/micro_ais/cas/ca_wolves_multipacks_functions.lua
    M data/ai/micro_ais/cas/ca_wolves_multipacks_wander.lua
    M data/ai/micro_ais/cas/ca_wolves_wander.lua
    M data/ai/micro_ais/cas/ca_zone_guardian.lua
    M data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua
    M data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua
    M data/campaigns/The_Rise_Of_Wesnoth/ai/ca_aggressive_attack_no_suicide.lua
    M data/campaigns/Two_Brothers/lua/muff_toras_move.lua

  Log Message:
  -----------
  Lua AIs: use math.huge to initialize extrema variables


  Commit: 80ae232935f2bbe5d0eb97c5a15136f8dc625068
      https://github.com/wesnoth/wesnoth/commit/80ae232935f2bbe5d0eb97c5a15136f8dc625068
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-30 (Thu, 30 Aug 2018)

  Changed paths:
    M data/ai/micro_ais/cas/ca_herding_attack_close_enemy.lua

  Log Message:
  -----------
  Herding Micro AI: fix variabls not being local


  Commit: 0e7c09f7b549bb43aec248bad04fcf0bffef17d5
      https://github.com/wesnoth/wesnoth/commit/0e7c09f7b549bb43aec248bad04fcf0bffef17d5
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-30 (Thu, 30 Aug 2018)

  Changed paths:
    M data/ai/lua/generic_recruit_engine.lua
    M data/ai/lua/generic_rush_engine.lua
    M data/ai/lua/retreat.lua
    M data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua

  Log Message:
  -----------
  Lua AIs: no need to set variables to nil explicitely

This is mostly done for consistency across the Lua AI code


  Commit: a23f06dc2052ece4d6de9fc1d80008f82761be4f
      https://github.com/wesnoth/wesnoth/commit/a23f06dc2052ece4d6de9fc1d80008f82761be4f
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-30 (Thu, 30 Aug 2018)

  Changed paths:
    M data/ai/lua/generic_rush_engine.lua
    M data/ai/micro_ais/cas/ca_forest_animals_tusklet_move.lua
    M data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua
    M data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua
    M data/campaigns/The_Rise_Of_Wesnoth/ai/ca_aggressive_attack_no_suicide.lua

  Log Message:
  -----------
  Lua AIs: don't initiate variables as empty tables

... if they might not be needed.


  Commit: 35d257f8fd35fad70539dfdc57da69e38bc10536
      https://github.com/wesnoth/wesnoth/commit/35d257f8fd35fad70539dfdc57da69e38bc10536
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-30 (Thu, 30 Aug 2018)

  Changed paths:
    M data/ai/lua/generic_recruit_engine.lua
    M data/ai/micro_ais/cas/ca_hang_out.lua

  Log Message:
  -----------
  Lua AIs: don't compare variables with nil

... unless there is a difference between nil and false. Done mostly for consistency with all the other uses.


  Commit: 1040dbe5c9e58ce2ac592b126e0b4b9b033f722c
      https://github.com/wesnoth/wesnoth/commit/1040dbe5c9e58ce2ac592b126e0b4b9b033f722c
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-30 (Thu, 30 Aug 2018)

  Changed paths:
    A data/campaigns/Two_Brothers/ai/ca_muff_toras_move.lua
    R data/campaigns/Two_Brothers/lua/muff_toras_move.lua
    M data/campaigns/Two_Brothers/scenarios/02_The_Chase.cfg

  Log Message:
  -----------
  AToTB S2: rename custom AI file

For consistency with the other mainline campaigns


  Commit: c2635abde1c6eea8bb74019ab78c61bddb219fff
      https://github.com/wesnoth/wesnoth/commit/c2635abde1c6eea8bb74019ab78c61bddb219fff
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-31 (Fri, 31 Aug 2018)

  Changed paths:
    M data/ai/lua/generic_recruit_engine.lua
    M data/ai/lua/generic_rush_engine.lua
    M data/ai/lua/move_to_any_target.lua

  Log Message:
  -----------
  Experimental AI: fix eval/exec debug output

This involves making the output independent of the stats CA (which is not used any more) and adding missing output to some CAs.


  Commit: 547478571871ffe59c5cf7ff59339a72a61c07dc
      https://github.com/wesnoth/wesnoth/commit/547478571871ffe59c5cf7ff59339a72a61c07dc
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-08-31 (Fri, 31 Aug 2018)

  Changed paths:
    A data/ai/lua/ca_castle_switch.lua
    A data/ai/lua/ca_grab_villages.lua
    A data/ai/lua/ca_move_to_any_enemy.lua
    A data/ai/lua/ca_place_healers.lua
    A data/ai/lua/ca_recruit_rushers.lua
    A data/ai/lua/ca_retreat_injured.lua
    A data/ai/lua/ca_spread_poison.lua
    A data/ai/lua/ca_village_hunt.lua
    R data/ai/lua/generic_rush_engine.lua
    R data/ai/lua/move_to_any_target.lua
    M data/core/macros/ai.cfg

  Log Message:
  -----------
  Experimental AI: convert to using external CAs


  Commit: 42b443084125ab7a989465e5f7f19835a17ba85b
      https://github.com/wesnoth/wesnoth/commit/42b443084125ab7a989465e5f7f19835a17ba85b
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-01 (Sat, 01 Sep 2018)

  Changed paths:
    M data/ai/lua/ca_spread_poison.lua
    M data/ai/micro_ais/cas/ca_healer_move.lua

  Log Message:
  -----------
  Lua AIs: avoid calling wesnoth.get_terrain() more than needed

It probably doen't make a noticeable difference for these AIs, but in general we should not call the slow functions more than necessary.


  Commit: 62625fd5e2821472181c53932ffe7f6b264373c5
      https://github.com/wesnoth/wesnoth/commit/62625fd5e2821472181c53932ffe7f6b264373c5
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-02 (Sun, 02 Sep 2018)

  Changed paths:
    M data/ai/micro_ais/cas/ca_protect_unit_move.lua

  Log Message:
  -----------
  Protect Unit MAI: remove unused configuration variables

They cannot be set for the MAI, and they would have to be set through 'cfg' not 'data' anyway.


  Commit: 3bfd59f28ba7f70a6ac32782e98cba9ca6c2a44a
      https://github.com/wesnoth/wesnoth/commit/3bfd59f28ba7f70a6ac32782e98cba9ca6c2a44a
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-02 (Sun, 02 Sep 2018)

  Changed paths:
    M data/ai/lua/ca_castle_switch.lua
    M data/ai/lua/ca_grab_villages.lua
    M data/ai/lua/ca_high_xp_attack.lua
    M data/ai/lua/ca_move_to_any_enemy.lua
    M data/ai/lua/ca_retreat_injured.lua
    M data/ai/lua/ca_spread_poison.lua
    M data/ai/micro_ais/cas/ca_bottleneck_attack.lua
    M data/ai/micro_ais/cas/ca_bottleneck_move.lua
    M data/ai/micro_ais/cas/ca_fast_combat.lua
    M data/ai/micro_ais/cas/ca_fast_combat_leader.lua
    M data/campaigns/The_Rise_Of_Wesnoth/ai/ca_aggressive_attack_no_suicide.lua
    M data/campaigns/The_Rise_Of_Wesnoth/ai/ca_retreat.lua

  Log Message:
  -----------
  Lua AIs: do not use engine's 'data' variable unless necessary

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.


  Commit: 45a3bf93636fb7b34b27a3411784d0484eeb18d6
      https://github.com/wesnoth/wesnoth/commit/45a3bf93636fb7b34b27a3411784d0484eeb18d6
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-02 (Sun, 02 Sep 2018)

  Changed paths:
    M data/ai/lua/ca_castle_switch.lua
    M data/ai/micro_ais/cas/ca_forest_animals_move.lua
    M data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua
    M data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua

  Log Message:
  -----------
  Lua AIs: replace tabs with spaces


  Commit: 0bcb98cf5026710871d8b90919752c90808c56d0
      https://github.com/wesnoth/wesnoth/commit/0bcb98cf5026710871d8b90919752c90808c56d0
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-03 (Mon, 03 Sep 2018)

  Changed paths:
    M data/ai/lua/ca_recruit_rushers.lua

  Log Message:
  -----------
  recruit_rushers CA: check if castle_switch CA is present

So that it is possible to use the recruit_rushers CA without the castle_switch CA.


  Commit: b92d8e822639a90ca8bbfeaf8dea606e7cf4c8f2
      https://github.com/wesnoth/wesnoth/commit/b92d8e822639a90ca8bbfeaf8dea606e7cf4c8f2
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-03 (Mon, 03 Sep 2018)

  Changed paths:
    M data/ai/lua/ca_recruit_rushers.lua
    M data/ai/lua/generic_recruit_engine.lua

  Log Message:
  -----------
  recruit_rushers CA: don't reserve village for passive leader


  Commit: 35ba82050954c2cee86321e05d6706993c08e143
      https://github.com/wesnoth/wesnoth/commit/35ba82050954c2cee86321e05d6706993c08e143
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-03 (Mon, 03 Sep 2018)

  Changed paths:
    M data/ai/lua/ca_castle_switch.lua
    M data/ai/lua/ca_grab_villages.lua
    M data/ai/lua/ca_move_to_any_enemy.lua
    M data/ai/lua/ca_place_healers.lua
    M data/ai/lua/ca_recruit_rushers.lua
    M data/ai/lua/ca_retreat_injured.lua
    M data/ai/lua/generic_recruit_engine.lua

  Log Message:
  -----------
  Experimental AI: adjustments to candidate action scores

The relative ranking of the CA scores is not changed, except for one case when two CAs had the same score.

Reasons:
- All scores should be lower than the scores of the default Goto CA (200,000) and the default scores of most Micro AIs (300,000).
- Break tie, resulting in uncertain order of execution, of place_healers and retreat_injured CA. Healers should be placed first, to allow retreating injured units to adjacent hexes.
- Set default for generic_recruit_engine to slightly above default AI recruiting score. That way it takes effect even if the default CA is not removed.
- Increase move_to_any_enemy CA score from 1 to 1,000. It is still the lowest score that way, but allows for setting up custom CAs with even lower scores (even if it is just for end-of-turn statistics or the like).


  Commit: ec45b53fe29d00d25204f67a8c1ea95c86f01d9e
      https://github.com/wesnoth/wesnoth/commit/ec45b53fe29d00d25204f67a8c1ea95c86f01d9e
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-03 (Mon, 03 Sep 2018)

  Changed paths:
    A data/ai/ais/ai_experimental.cfg
    R data/ai/ais/ai_generic_rush.cfg
    M data/ai/aliases/dev_multiplayer.cfg

  Log Message:
  -----------
  Experimental AI: rename config file

This stopped being a rush AI long ago.


  Commit: 23f35546fc31c6345acc24624039f16a92bbb8b7
      https://github.com/wesnoth/wesnoth/commit/23f35546fc31c6345acc24624039f16a92bbb8b7
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-03 (Mon, 03 Sep 2018)

  Changed paths:
    M data/ai/lua/ai_helper.lua
    M data/ai/lua/generic_recruit_engine.lua
    M data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua

  Log Message:
  -----------
  Lua AIs: remove commented-out debug code


  Commit: fdc3249496e7c2418a8ab8c7ec19b85bba3f79fb
      https://github.com/wesnoth/wesnoth/commit/fdc3249496e7c2418a8ab8c7ec19b85bba3f79fb
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-04 (Tue, 04 Sep 2018)

  Changed paths:
    M data/ai/micro_ais/cas/ca_herding_herd_sheep.lua
    M data/campaigns/Two_Brothers/ai/ca_muff_toras_move.lua

  Log Message:
  -----------
  Lua AIs: use ai_helper.robust_move_and_attack()

ai_helper.robust_move_and_attack() does the stop_unit_moves automatically if the unit is at the destination hex.


  Commit: a7d80240f2ca11b01e14120f80cd9ecace3eaa85
      https://github.com/wesnoth/wesnoth/commit/a7d80240f2ca11b01e14120f80cd9ecace3eaa85
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-05 (Wed, 05 Sep 2018)

  Changed paths:
    M data/ai/lua/ai_helper.lua

  Log Message:
  -----------
  ai_helper: get_unit functions should only return live units

Live beiing defined as in get_live_units(), that is, non-petrified units


  Commit: 75843541bcf92e743b911ef49046c54a050e8a0f
      https://github.com/wesnoth/wesnoth/commit/75843541bcf92e743b911ef49046c54a050e8a0f
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-05 (Wed, 05 Sep 2018)

  Changed paths:
    M data/ai/lua/ca_grab_villages.lua
    M data/ai/lua/ca_move_to_any_enemy.lua
    M data/ai/lua/ca_retreat_injured.lua
    M data/ai/lua/ca_spread_poison.lua
    M data/ai/lua/ca_village_hunt.lua
    M data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua
    M data/campaigns/The_Rise_Of_Wesnoth/ai/ca_aggressive_attack_no_suicide.lua
    M data/campaigns/The_Rise_Of_Wesnoth/ai/ca_retreat.lua

  Log Message:
  -----------
  Lua AIs: use ai_helper get_unit functions where applicable

The ai_helper functions are optimized for speed (as much as possible in a general setting) and do all the necessary tests.  For example, get_units_with_attacks() checks both whether the unit has attacks left, and whether it has any attacks in the first place.


  Commit: 10463fdf608ade3ff223a58ad7cc43a1e475b803
      https://github.com/wesnoth/wesnoth/commit/10463fdf608ade3ff223a58ad7cc43a1e475b803
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-07 (Fri, 07 Sep 2018)

  Changed paths:
    M data/ai/lua/ai_helper.lua

  Log Message:
  -----------
  ai_helper: new function get_locations_no_borders()


  Commit: dcadab91a418f4f7392bab2544367df580d46ecf
      https://github.com/wesnoth/wesnoth/commit/dcadab91a418f4f7392bab2544367df580d46ecf
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-07 (Fri, 07 Sep 2018)

  Changed paths:
    M data/ai/lua/ai_helper.lua
    M data/ai/lua/ca_castle_switch.lua
    M data/ai/lua/generic_recruit_engine.lua
    M data/ai/micro_ais/cas/ca_forest_animals_move.lua
    M data/ai/micro_ais/cas/ca_goto.lua
    M data/ai/micro_ais/cas/ca_hang_out.lua
    M data/ai/micro_ais/cas/ca_wolves_multipacks_wander.lua
    M data/ai/micro_ais/cas/ca_zone_guardian.lua

  Log Message:
  -----------
  Lua AIs: use ai_helper.get_locations_no_borders()


  Commit: a7811395363f9edd1a40adb11e0748bd0b81c385
      https://github.com/wesnoth/wesnoth/commit/a7811395363f9edd1a40adb11e0748bd0b81c385
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-07 (Fri, 07 Sep 2018)

  Changed paths:
    M data/ai/lua/generic_recruit_engine.lua

  Log Message:
  -----------
  generic_recruit_engine: remove unnecessary variable assignment


  Commit: 2591e435a5c71b0d840174c486fa2bde392d352a
      https://github.com/wesnoth/wesnoth/commit/2591e435a5c71b0d840174c486fa2bde392d352a
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-07 (Fri, 07 Sep 2018)

  Changed paths:
    M data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua

  Log Message:
  -----------
  EI custom ogre AI: remove a commented out line


  Commit: 81ef9ea390ec54e023390e2b6226e408a555226e
      https://github.com/wesnoth/wesnoth/commit/81ef9ea390ec54e023390e2b6226e408a555226e
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2018-09-22 (Sat, 22 Sep 2018)

  Changed paths:
    A data/ai/ais/ai_experimental.cfg
    R data/ai/ais/ai_generic_rush.cfg
    M data/ai/aliases/dev_multiplayer.cfg
    M data/ai/lua/ai_helper.lua
    M data/ai/lua/battle_calcs.lua
    A data/ai/lua/ca_castle_switch.lua
    A data/ai/lua/ca_grab_villages.lua
    M data/ai/lua/ca_high_xp_attack.lua
    A data/ai/lua/ca_move_to_any_enemy.lua
    A data/ai/lua/ca_place_healers.lua
    A data/ai/lua/ca_recruit_rushers.lua
    A data/ai/lua/ca_retreat_injured.lua
    A data/ai/lua/ca_spread_poison.lua
    A data/ai/lua/ca_village_hunt.lua
    M data/ai/lua/generic_recruit_engine.lua
    R data/ai/lua/generic_rush_engine.lua
    R data/ai/lua/move_to_any_target.lua
    M data/ai/lua/retreat.lua
    M data/ai/micro_ais/cas/ca_assassin_move.lua
    M data/ai/micro_ais/cas/ca_big_animals.lua
    M data/ai/micro_ais/cas/ca_bottleneck_attack.lua
    M data/ai/micro_ais/cas/ca_bottleneck_move.lua
    M data/ai/micro_ais/cas/ca_coward.lua
    M data/ai/micro_ais/cas/ca_fast_attack_utils.lua
    M data/ai/micro_ais/cas/ca_fast_combat.lua
    M data/ai/micro_ais/cas/ca_fast_combat_leader.lua
    M data/ai/micro_ais/cas/ca_fast_move.lua
    M data/ai/micro_ais/cas/ca_forest_animals_move.lua
    M data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua
    M data/ai/micro_ais/cas/ca_forest_animals_tusker_attack.lua
    M data/ai/micro_ais/cas/ca_forest_animals_tusklet_move.lua
    M data/ai/micro_ais/cas/ca_goto.lua
    M data/ai/micro_ais/cas/ca_hang_out.lua
    M data/ai/micro_ais/cas/ca_healer_move.lua
    M data/ai/micro_ais/cas/ca_herding_attack_close_enemy.lua
    M data/ai/micro_ais/cas/ca_herding_herd_sheep.lua
    M data/ai/micro_ais/cas/ca_herding_sheep_move.lua
    M data/ai/micro_ais/cas/ca_hunter.lua
    M data/ai/micro_ais/cas/ca_messenger_attack.lua
    M data/ai/micro_ais/cas/ca_messenger_escort_move.lua
    M data/ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua
    M data/ai/micro_ais/cas/ca_messenger_move.lua
    M data/ai/micro_ais/cas/ca_protect_unit_attack.lua
    M data/ai/micro_ais/cas/ca_protect_unit_move.lua
    M data/ai/micro_ais/cas/ca_simple_attack.lua
    M data/ai/micro_ais/cas/ca_stationed_guardian.lua
    M data/ai/micro_ais/cas/ca_wolves_move.lua
    M data/ai/micro_ais/cas/ca_wolves_multipacks_attack.lua
    M data/ai/micro_ais/cas/ca_wolves_multipacks_functions.lua
    M data/ai/micro_ais/cas/ca_wolves_multipacks_wander.lua
    M data/ai/micro_ais/cas/ca_wolves_wander.lua
    M data/ai/micro_ais/cas/ca_zone_guardian.lua
    M data/ai/micro_ais/micro_ai_helper.lua
    M data/ai/micro_ais/micro_ai_unit_variables.lua
    M data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua
    M data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua
    M data/campaigns/The_Rise_Of_Wesnoth/ai/ca_aggressive_attack_no_suicide.lua
    M data/campaigns/The_Rise_Of_Wesnoth/ai/ca_retreat.lua
    A data/campaigns/Two_Brothers/ai/ca_muff_toras_move.lua
    R data/campaigns/Two_Brothers/lua/muff_toras_move.lua
    M data/campaigns/Two_Brothers/scenarios/02_The_Chase.cfg
    M data/core/macros/ai.cfg

  Log Message:
  -----------
  Merge pull request #3506 from mattsc/lua_ai_cleanup

Lua AI Cleanup


Compare: https://github.com/wesnoth/wesnoth/compare/9536f3825e86...81ef9ea390ec
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the Commits mailing list