[wesnoth-commits] [wesnoth/wesnoth] fb364c: AI helper: improve efficiency of get_unit function...
GitHub
noreply at github.com
Thu Jun 7 13:40:25 UTC 2018
Branch: refs/heads/1.14
Home: https://github.com/wesnoth/wesnoth
Commit: fb364cf2b7384aa5a3c68ed9d48948cf3405f103
https://github.com/wesnoth/wesnoth/commit/fb364cf2b7384aa5a3c68ed9d48948cf3405f103
Author: mattsc <mattsc000 at gmail.com>
Date: 2018-06-06 (Wed, 06 Jun 2018)
Changed paths:
M data/ai/lua/ai_helper.lua
Log Message:
-----------
AI helper: improve efficiency of get_unit functions
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.
Commit: 4b8870ed93f84f4aed3479c33c787a75591ed0b5
https://github.com/wesnoth/wesnoth/commit/4b8870ed93f84f4aed3479c33c787a75591ed0b5
Author: mattsc <mattsc000 at gmail.com>
Date: 2018-06-06 (Wed, 06 Jun 2018)
Changed paths:
M data/ai/micro_ais/cas/ca_goto.lua
Log Message:
-----------
Goto Micro AI: change order of SLF and SUF evaluation
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.
Commit: 7727130e244398911b574f43d705c7c69b2cce56
https://github.com/wesnoth/wesnoth/commit/7727130e244398911b574f43d705c7c69b2cce56
Author: mattsc <mattsc000 at gmail.com>
Date: 2018-06-06 (Wed, 06 Jun 2018)
Changed paths:
M data/ai/micro_ais/cas/ca_goto.lua
Log Message:
-----------
Goto Micro AI: add [and] to a filter
Another efficiency improvement. This ensures that the side of the unit
is checked first before the potentially complex rest of the filter is
evaluated.
Commit: 6071efa67d24745f982f69963a26118444fecf3f
https://github.com/wesnoth/wesnoth/commit/6071efa67d24745f982f69963a26118444fecf3f
Author: mattsc <mattsc000 at gmail.com>
Date: 2018-06-07 (Thu, 07 Jun 2018)
Changed paths:
M data/ai/lua/ai_helper.lua
M data/ai/micro_ais/cas/ca_goto.lua
Log Message:
-----------
Merge pull request #3213 from mattsc/speed_up_goto_mai
Efficiency improvements to Lua AIs
Compare: https://github.com/wesnoth/wesnoth/compare/216215830ae5...6071efa67d24
**NOTE:** This service 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