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

GitHub noreply at github.com
Fri Apr 18 04:05:35 UTC 2014


  Branch: refs/heads/1.12
  Home:   https://github.com/wesnoth/wesnoth
  Commit: fe49356eba1a045e3512760af96cdcce00aa2756
      https://github.com/wesnoth/wesnoth/commit/fe49356eba1a045e3512760af96cdcce00aa2756
  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: 7d88f9211a293807bb4a009168e9ce38c0845a97
      https://github.com/wesnoth/wesnoth/commit/7d88f9211a293807bb4a009168e9ce38c0845a97
  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: f7049e114002b7f53d6553c33fa17af4a8103d1d
      https://github.com/wesnoth/wesnoth/commit/f7049e114002b7f53d6553c33fa17af4a8103d1d
  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: cff3b5a35d9364589a0047b07db3b3524eb14be8
      https://github.com/wesnoth/wesnoth/commit/cff3b5a35d9364589a0047b07db3b3524eb14be8
  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: 14e55fc14c0ff742d44094453953eb0e4dce374e
      https://github.com/wesnoth/wesnoth/commit/14e55fc14c0ff742d44094453953eb0e4dce374e
  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/5f955447ba5c...14e55fc14c0f


More information about the Commits mailing list