[Commits] [wesnoth/wesnoth] f6cdd8: AI helper functions: code cleanup, first pass

GitHub noreply at github.com
Fri Apr 18 04:03:43 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: f6cdd851820e5571fd1683106774b1c0327bdab1
      https://github.com/wesnoth/wesnoth/commit/f6cdd851820e5571fd1683106774b1c0327bdab1
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2014-04-17 (Thu, 17 Apr 2014)

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

  Log Message:
  -----------
  AI helper functions: code cleanup, first pass

These function libraries are still work in progress and change
frequently, so the code cleanup is mostly just to make sure the syntax
is consistent with that used in the Micro AIs.  Changes or improvements
to the algorithms might be made at a later time.


  Commit: 19eff08fd7602d6f01eec47d61bf6ab08bcc49de
      https://github.com/wesnoth/wesnoth/commit/19eff08fd7602d6f01eec47d61bf6ab08bcc49de
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2014-04-17 (Thu, 17 Apr 2014)

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

  Log Message:
  -----------
  Fix a typo


  Commit: e87240c67f843657b5d9dbd952f02a69a02fd33a
      https://github.com/wesnoth/wesnoth/commit/e87240c67f843657b5d9dbd952f02a69a02fd33a
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2014-04-17 (Thu, 17 Apr 2014)

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

  Log Message:
  -----------
  battle_calcs.lua: avoid using formula= in SUFs

It’s slow for finding units with moves or attacks left. The alternative
method of getting all units and then looping over the table with a
condition is much faster.


  Commit: 9701a724a8618aa856db8977232438861abf5234
      https://github.com/wesnoth/wesnoth/commit/9701a724a8618aa856db8977232438861abf5234
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2014-04-17 (Thu, 17 Apr 2014)

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

  Log Message:
  -----------
  ai_helper.lua: avoid using table.remove

It’s slow. The inverse logic using table.insert is much faster,
especially for large tables.


  Commit: 9d440fac8e81ebb3b7117ae18eaf8899af551a6e
      https://github.com/wesnoth/wesnoth/commit/9d440fac8e81ebb3b7117ae18eaf8899af551a6e
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2014-04-17 (Thu, 17 Apr 2014)

  Changed paths:
    M data/ai/micro_ais/scenarios/protect_unit.cfg

  Log Message:
  -----------
  Protect Unit MAI test scenario: use fight_on_without_leader=yes

So that the scenario continues even if the side 2 leader is killed.


Compare: https://github.com/wesnoth/wesnoth/compare/965a2a5d1c55...9d440fac8e81


More information about the Commits mailing list