187 Commits

Author SHA1 Message Date
mattsc
623036af16 ai_helper.put_labels: display content of strings rather than 'nan' 2013-12-02 10:58:49 -08:00
mattsc
ea915d36c2 battle_calcs.attack_rating: bug fix for when AI side has no leader
Check for AI side's leader's existence before trying to calculate
distance from leader.
2013-11-25 19:37:20 -08:00
mattsc
71f92aa05c ai_helper.get_dst_src(units): minor code simplification 2013-11-14 20:04:53 -08:00
mattsc
5f39a7d2dc ai_helper.get_enemy_dst_src: add optional parameter 'enemies'
If 'enemies' table is given, use it, otherwise use all enemy units.
2013-11-14 20:04:53 -08:00
mattsc
c46d8459d6 Retreat AI eval: poisoned units do not get resting healing bonus
... in evaluation of best retreat positions.
2013-11-14 20:04:52 -08:00
mattsc
24f10a37ef ai_helper: improve criterion for impassable terrain
Rather than checking whether the movement cost is <99, check whether it
is <= max_moves for the unit.
2013-11-14 20:04:52 -08:00
mattsc
c6db6cd8d5 Lua AIs: Remove unnecessary arguments in call to wesnoth.put_unit() 2013-11-14 20:04:52 -08:00
mattsc
9976eac873 Micro AI CA files: replace tabs by spaces
I had not realized that TextWrangler changes spaces to tabs when
shifting blocks of text to the left, which had been done for all CA
files when converting the engine files.
2013-11-14 10:54:14 -08:00
mattsc
cb2a22acd4 ExpAI move_to_enemy CA: fix file path
Had accidentally copied over the AI-demos path.
2013-11-01 09:44:45 -07:00
mattsc
a45cf2ac58 ExpAI: capture more villages if we can't recruit any more this turn 2013-11-01 09:27:38 -07:00
mattsc
241fd529e0 ExpAI: ignore unreachable enemy leaders when selecting keep 2013-11-01 09:24:05 -07:00
mattsc
d8c35a75c8 ExpAI: capture villages with injured units if no enemy can reach 2013-11-01 09:19:54 -07:00
mattsc
948147550a ExpAI: Encourage forward advancement when capturing villages 2013-11-01 09:14:55 -07:00
mattsc
9c86a71ef7 ExpAI retreat code: also return enemy attack map 2013-11-01 08:51:21 -07:00
mattsc
1fa06a6811 Exp AI retreat code: make function min_hp() externally accessible 2013-11-01 08:51:21 -07:00
mattsc
938b2e6520 ExpAI retreat: count amount of hp healed when choosing retreat location 2013-11-01 08:51:21 -07:00
mattsc
456f60a9ee ExpAI: make sure injured regenerating units are not stranded if ...
... no non-regenerating units can get to safe locations.
2013-11-01 08:51:20 -07:00
mattsc
76e22a3d6a Experimental AI: add a simple move to enemy CA
Set up to run if nothing else is available.
In a separate file for use as a stand-alone CA in an AI
2013-10-31 21:19:44 -07:00
mattsc
4cdedc11ee Remove () for wesnoth.require for consistency with surrounding lines 2013-10-31 21:08:13 -07:00
mattsc
3e6e7caa74 Put 'done_eval_messages()' behind 'if print_eval()' condition
... so that they only get printed when this sort of debug output is
selected.
2013-10-31 20:54:00 -07:00
mattsc
96d17690bd Clean up time stamps and debug output code 2013-10-31 20:40:18 -07:00
mattsc
d355adbacb Clean up time stamps and debug output code 2013-10-31 20:31:37 -07:00
Alarantalara
c859d0d17b Keep villages unreachable by recruited unit
If the recruited unit cannot reach the target village, try again later
2013-10-31 23:14:36 -04:00
Alarantalara
33c1e493b2 Handle more damage specials for Lua recruiting 2013-10-31 23:14:35 -04:00
mattsc
554a95749a battle_calcs.best_defense_map(): add parameter ignore_these_units
This is a table of enemy units whose ZoC is to be ignored for route
finding.  It is useful for determing where the enemy can move while
ignoring own units (enemies of the enemy) that have not moved yet.
2013-10-31 08:22:15 -07:00
mattsc
526debf3e9 battle_calcs.lua: remove some debug code 2013-10-31 08:17:47 -07:00
mattsc
8689543d9a Lua dummy engine: do not load debug_ai functions
Besides them being unnecessary, a warning message is otherwise also
displayed when external CAs are used and the game is not in debug mode.
2013-10-30 18:23:48 -07:00
mattsc
e18378369b ai_helper: remove unused function ai_helper.got_1_11() 2013-10-30 13:02:09 -07:00
mattsc
3989b4e140 Experimental AI: make Healer Placement CA work with new external CAs
Healer Placement is a Micro AI whose syntax was changed in the switch
to using external AIs.  This change adapts how this CA is called in the
Experimental AI (gerneric rush AI) to these changes.
2013-10-30 09:51:10 -07:00
mattsc
b826e5ead5 Micro AIs: make recruit_rushers work with new external CA method
The previous code did not allow to get the ai table to the execution
function.
2013-10-30 09:42:41 -07:00
mattsc
d5b994c0bb Lua AI: make persistent data variable work with external CAs
It was previously being set correctly by the engine, but was not
accessible from the Lua AI.
2013-10-23 18:39:26 -07:00
mattsc
659162371b Internal rewrite of ai_helper.get_attacks()
This is much faster than the previous version.  No change in
functionality.
2013-09-04 20:20:25 -07:00
mattsc
0891bffafb ai_helper.put_labels(): add optional keys= parameter 2013-07-16 08:32:45 -07:00
mattsc
7e0a05ed6e Experimental AI: consistently use underscores in AI ids and file names
This is the last step of making everything use consistent syntax.
2013-07-10 20:37:30 -07:00
mattsc
9c087fc348 Experimental AI: change function names in calls to healer_support AI
The healer_support internal functions were renamed in a previous commit.
2013-07-10 19:51:03 -07:00
mattsc
e78585586f ai_helper.put_labels: add show_coords= parameter 2013-07-07 10:50:05 -07:00
mattsc
019b6df9c4 Remove double spaces after periods
wmllint complains about this in WML.  This is all in Lua code, done for
consistency only.
2013-07-07 10:35:07 -07:00
Alarantalara
62c2bbcb20 Merge AI-demo and mainline experimental recruit logic
Slight speed improvement when close to unowned vilages. Correct score
for time of day damage estimates for encountering the enemy near end of
game.
2013-06-14 18:03:44 -04:00
mattsc
bf3517d1e4 ExpAI: make recruiting work with all keys of [damage] special
Previously there would be an error, and subsequently no recruiting, if
the multiply= key was not set.
2013-06-13 07:51:06 -07:00
mattsc
e6ec4152d2 ExpAI: make recruiting work with all keys of [chance_to_hit] special
Previously there would be an error, and subsequently no recruiting, if
the value= key was not set.
2013-06-07 19:17:21 -07:00
mattsc
29acfbd532 Recruiting AIs: add more combinations to terrain strings for finding keeps 2013-05-16 20:22:02 -07:00
mattsc
a44a9a0d45 Recruiting AIs: add more combinations to terrain strings for finding castles 2013-05-16 20:14:11 -07:00
mattsc
04f7993ed5 Micro and experimental AIs: turn off some debug output 2013-05-16 11:22:39 -07:00
mattsc
78f753e4dc Revert "LuaAI: (1) persistent storage mechanism now available and working properly (2) old/incomplete mechanism not removed, subject to future deprecation"
This reverts commit 754f2c2b3d5e4645453bc4a129e9c7f92f1390c0.
2013-05-13 13:15:22 -07:00
Dmitry K
754f2c2b3d LuaAI: (1) persistent storage mechanism now available and working properly (2) old/incomplete mechanism not removed, subject to future deprecation 2013-05-12 01:12:45 +03:00
mattsc
e7a71a51d7 battle_calcs library: add functions best_defense_map() and get_attack_combos_subset() 2013-05-03 07:06:22 -07:00
mattsc
5fb4dd3816 battle_calcs relative_damage_map: enemy leader needs to have unity weight 2013-05-03 07:02:23 -07:00
mattsc
7e189c1d51 battle_calcs relative_damage_map: add own and enemy damage to output 2013-05-03 07:01:21 -07:00
mattsc
122d674b9b battle_calcs library: some tweaks to attack_rating() function 2013-05-03 06:55:19 -07:00
mattsc
6b119e4039 battle_calcs library: fix formatting and indenting 2013-05-03 06:51:14 -07:00