Commit graph

774 commits

Author SHA1 Message Date
mattsc
c06529aa18 Micro AIs: add check for valid full move and error message
This now checks whether the move intended to be done with ai.move_full
is possible and display an error message if it is not.
2014-02-27 17:06:19 -08:00
mattsc
70e3fc58bd Micro AIs: add check for valid attacks and error message
This will now check whether the attack intended to be done with
ai.attack is possible and display an error message if it is not.
2014-02-27 17:06:18 -08:00
mattsc
47e78471b9 Simple Attack MAI test scenario: move Lua filter function into preload event
… so that it is available after a reload as well.
2014-02-21 12:23:35 -08:00
mattsc
ac5acf69af Forest Animals MAI: make the rabbit-type animals replay safe
They need to be put on the map and taken off using ai.synced_command(),
otherwise it causes OOS errors.
2014-02-20 21:04:24 -08:00
mattsc
a66a87dad6 Healer support MAI test scenario: change event from die to last breath 2014-02-20 20:14:00 -08:00
mattsc
e78462c395 Remove function ai_helper.random()
This was using the synced RNG which is exactly the wrong thing to do
within the AI evaluation/execution functions.
2014-02-20 11:33:05 -08:00
mattsc
77d258474e Hang Out MAI: use [ai][avoid] if [micro_ai][avoid] is not given
The scenario author now has the option to use either the default AI
[avoid] tag or a specialized [avoid] tag inside the [micro_ai] tag.  If
neither is given, the default remains all castle terrain.
2014-02-11 14:00:21 -08:00
mattsc
62273f51b3 RCA AI: revert gold saving default back to 'off'
This was discussed both on the wesnoth-dev mailing list and on the
forums and the overall consensus was that it should be off, although
some scenarios will benefit from it.  It should be enabled specifically
in such scenarios as they are identified.
Reference:
https://mail.gna.org/public/wesnoth-dev/2014-01/msg00001.html
and links therein
2014-01-22 06:51:19 -08:00
mattsc
ed4fe91b44 Wolves MAI: add optional parameter attack_only_prey=
By default, the wolves attack any enemy unit they can reach.  If this
key is set, only prey units are attacked.
2014-01-19 12:06:20 -08:00
mattsc
f856cadff6 Coward Micro AI: add optional tag [filter_second]
This tag determines from which units the coward flees.  It defaults to
all enemy units, but can be set to enemy and/or allied units if
specified.
2014-01-03 19:03:06 -08:00
mattsc
c65d8d4ae1 Wolves MAI: fix bug that sometimes kept predators from attacking
The attacks aspect may only be modified if the avoid_type= key is set
in the [micro_ai] tag, otherwise all attacks get disabled.
2013-12-20 09:00:01 -08:00
Ignacio R. Morelle
cc7afb5d67 Fix a typo in a translatable string
("handle" -> "handled")
2013-12-06 06:03:11 -03:00
mattsc
21c8c5c860 ai_helper: add functions to get direction indices and strings
These consist of a number of supplementary functions, plus three
function get_cardinal_directions, get_intercardinal_directions and
get_hex_facing which return strings for the directions (in cartesian or
hex coordinates) between two hexes.
2013-12-02 11:01:44 -08:00
mattsc
623036af16 ai_helper.put_labels: display content of strings rather than 'nan' 2013-12-02 10:58:49 -08:00
mattsc
ffbf2c2891 Simple Attack MAI: add optional parameter 'weapon' 2013-11-25 19:37:20 -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
c0ee2c8e87 Add wmllint spelling exceptions for files in data/ai/ 2013-11-02 20:20:10 -07:00
mattsc
b340188038 Hunter MAI [micro_ai] tag: add optional [filter] tag 2013-11-01 17:13:06 -07:00
mattsc
08a722e248 All Guardian MAI [micro_ai] tags: add optional [filter] tag 2013-11-01 17:13:05 -07:00
mattsc
0670630ff9 Patrol MAI [micro_ai] tag: add optional [filter] tag 2013-11-01 17:13:05 -07: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
46bf12a523 Old AIs in ai/dev/: change descriptions displayed in MP selection menu
These are the AIs that are only visible in debug mode.  They were very
ambiguous and two of them were even exactly the same.
2013-10-31 15:32:21 -07:00
mattsc
9b553b86b5 Fix the old 'Default AI with poisoning formula' development AI
None of the RCA AI CAs were included, which means this was effectively
an idle AI.
2013-10-31 14:46:53 -07: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
1d488a2c35 Rename ai/micro_ais/ais/ to ai/micro_ais/engines/
... in order to distinguish between AI files containing full engines
and those containing individual CA eval/exec functions
2013-10-30 12:55:08 -07:00
mattsc
e469df1d50 Move and rename [micro_ai] tag setup file
... to a more logical location given the recent reorganization.
2013-10-30 12:55:08 -07:00