799 Commits

Author SHA1 Message Date
mattsc
cccf1f8604 Change id and description of the former "Strong AI" 2016-03-24 12:57:35 -07:00
mattsc
a218e6b659 Move "Strong AI" to ai/dev/ and rename file
This means that it is now only available in debug mode.  It is not
significantly enough different from the default to be one of the main
options.
2016-03-24 12:57:35 -07:00
mattsc
c04f406bd8 Old patrol.lua: fix indenting and add deprecation message 2016-03-24 12:57:35 -07:00
mattsc
dd2d193cbd Remove move_to_targets test scenario
This was useful when the composite AI was introduced (in Wesnoth 1.7),
but does not serve a purpose any more now.
2016-03-24 10:56:45 -07:00
Celtic Minstrel
57e41387a8 Remove Strategy Formulation with RCA stage 2016-03-24 12:39:37 -04:00
Celtic Minstrel
ab443bcc18 Remove experimental recruitment 2016-03-24 12:06:10 -04:00
mattsc
be505342bf Lua AI test scenarios: rename files 2016-03-24 08:16:03 -07:00
mattsc
5774872e04 Lua AI test scenarios: update id= and name= keys 2016-03-24 08:09:59 -07:00
mattsc
961d134ee2 Fix and simplify Lua AI test scenario 2016-03-24 08:07:01 -07:00
Celtic Minstrel
d73a2486ba Deleted AI definition referencing the removed old recruitment CA 2016-03-24 00:08:11 -04:00
Celtic Minstrel
a23a368c20 Remove Akihara's recruitment and battle evaluation 2016-03-24 00:08:10 -04:00
mattsc
c60280392b Protect Unit MAI test scenario: adapt Lua engine to new syntax 2016-03-23 16:43:51 -07:00
mattsc
f920a03ebb Patrols MAI test scenario: adapt Lua engine to new syntax 2016-03-23 16:38:22 -07:00
mattsc
7c4aec9cfe Micro AI test scenario: fix incorrect aspect name 2016-03-22 18:31:42 -07:00
Celtic Minstrel
2ed5e7815f MicroAIs: Fix those that honour the avoid aspect improperly
This affects the Hang Out and Fast MAIs.
2016-03-22 07:22:22 -07:00
Celtic Minstrel
1d7c1c74f6 Improve backwards compatibility for Lua AI
This changes the following:
- Fixes the experimental AI, without changing any of its code except for that in the [engine] tag
- Returns a dummy self from the dummy Lua engine, so that external CAs are more easily switched to using [params]
- Changes the order in which parameters are passed to AI component code. The order is now:
        state/self,    params,    data
2016-03-22 07:22:22 -07:00
Celtic Minstrel
7c9e24aa29 Remove several deprecated recruitment-related aspects
- number_of_possible_recruits_to_force_recruit
- recruitment_ignore_bad_combat
- recruitment_ignore_bad_movement
2016-03-22 07:22:22 -07:00
Celtic Minstrel
ca8cb3bd6a Remove the deprecated recruitment stage, candidate action, and aspect 2016-03-22 07:22:22 -07:00
Celtic Minstrel
f8f5557eb0 Huge refactor of Lua AI engine
This commit potentially breaks any Lua AI customization, except for external Lua candidate actions.
In practice, though, Lua aspects and goals will probably continue to work for the most part.

- The ai table now has a read_only attribute.
  If true, functions that change the game state will be missing from the table.
  The read_only attribute is false in CA execution and in stages.
  It is true everywhere else.
- Every Lua AI component now supports a [args] subtag.
  The contents of this tag are passed as parameters to the component code.
  This data is immutable; components cannot alter its contents.
  (External Lua candidate actions do not receive this data.)
- Accessing the persistent engine data is now supported in all Lua components.

When calling a Lua component, the Lua engine now passes two parameters:
1. The contents of the [args] tag in the specific component.
2. The contents of the [data] tag in the Lua [engine].

The return value of the [engine] code, if any, is stored for later used.
It will be passed as the third parameter to any other Lua component.
This data can be changed, but will not be saved.
The default engine does not return any such data.
2016-03-22 07:22:22 -07:00
Celtic Minstrel
bcbba6dde3 Change ID of Idle AI 2016-03-22 07:22:22 -07:00
Celtic Minstrel
9c2027a8d8 Remove version key from AI configs
This has a lot of cascade effects and may remove support for some old syntaxes, such as [protect_unit].
2016-03-22 07:22:22 -07:00
mattsc
3d01dabce6 Protect Unit Micro AI: fix bug in AI setup 2016-03-20 10:00:02 -07:00
mattsc
11e1917d21 Guardians Micro AI test scenario: update an image path 2016-03-20 09:37:05 -07:00
mattsc
6f57ee846b Micro AIs: update to new syntax of wesnoth.put_unit() 2016-03-19 20:59:39 -07:00
mattsc
c4a34ebe2c Micro AIs: update syntax of [message][option] usages 2016-03-19 13:26:01 -07:00
mattsc
b347d2b2d6 Micro AI scenarios: adapt coordinates to changed MP map
The dimensions of the Dark Forecast map were changed.
2016-03-18 13:15:08 -07:00
gfgtdf
3e2dfed89d added border to dark forecast map
this adds borders to the 2p dark forecast survival map, it also removes
the big empty space in the upper third of the map.

This also renames the mask files to map files, becasue they are actually
just normal maps, and the [terrain_mask] just replaces the current map
with these.
2016-02-18 23:08:36 +01:00
sigurdfdragon
28e5a3fdc2 Change id of broken ai to get it off the top of list in mp debug.
A quick fix to get Default RCA to top of list in debug mode, so add-on development is easier.
2016-02-17 18:22:04 -05:00
Celtic Minstrel
9859091c7c Convert test scenario maps to new format 2015-10-07 14:19:48 -04:00
mattsc
74b54da691 Fast Micro AI: fix a typo in a parameter name 2015-09-09 06:46:58 -07:00
mattsc
e9f77d1dbf Fast Micro AI: add optional parameters for attacks by AI leader
The willingness of the AI leader to come out for attacks can be
adjusted with these.
2015-09-09 06:31:46 -07:00
mattsc
67f868306e Fast Micro AI: clean up unused debug output 2015-09-07 09:17:45 -07:00
mattsc
5533d5728a Fast Micro AI: separate out attacks by AI leader
In the previous version, the leader would sometimes leave the keep for
truly suicidal attacks. This commit adds an extra layer of analysis to
evaluate whether an attack position is safe enough.

This evaluation is too expensive to be done for all units for the
purpose of this AI, or even to be done for the leader more than once,
so this is separated out into its own candidate action that is only
evaluated once everything else is done.
2015-09-07 08:49:39 -07:00
mattsc
10ee2f65d4 Fast Micro AI: enable support of the default attacks aspect
Attackers and targets can now also be selected through the default
attacks aspect. [filter] and [filter_second] inside the [micro_ai] tag
have priority though, if either of them is given.
2015-09-06 14:12:41 -07:00
mattsc
f06030b0f5 Fast Micro AI: add support for [avoid] tags
This can either be an [avoid] tag inside the [micro_ai] tag itself, or
the [avoid] tag of the default AI (e.g. as defined in the side
definition).  If both are given, the former has priority.
2015-09-06 13:09:20 -07:00
mattsc
c6512ab869 Fast Micro AI: add optional key leader_weight
This is a multiplicative factor determining how much more the AI values
leaders than non-leader units.  The parameter was already included in
the fast_attack_utils code with a default value of 2.  This commit only
makes it configurable from the [micro_ai] tag.
2015-09-04 08:02:49 -07:00
mattsc
4b589ba1a2 Fast Micro AI: add [filter] and [filter_second] tags
These can be used to limit the attackers and attack targets in the same
way as the ‘attacks’ facet does with [filter_own] and [filter_enemy]
for the default AI combat candidate action.
This does not affect the move-to-targets candidate action of the Fast
Micro AI.
2015-09-04 07:41:20 -07:00
mattsc
455a50e30b Add Fast Micro AI test scenario 2015-09-02 19:05:38 -07:00
mattsc
334bbf6319 Micro AI test scenario: fix a menu item id
Not that it matters for anything practical in this case, but just for
consistency.
2015-09-02 17:37:00 -07:00
mattsc
3ae127dcb5 Micro AI test scenario: fix broken image path 2015-09-02 17:21:16 -07:00
mattsc
ac3b9e6325 Fast MAI: use the new attack utility functions 2015-09-02 17:05:49 -07:00
mattsc
e098ef180d Fast Micro AI: add new set attack utility functions
These functions are newer and more efficient versions of those in
battle_calcs.lua. They are much faster in many situations.
2015-09-02 17:05:49 -07:00
mattsc
9520513d81 Fast Micro AI: exclude hidden enemies from attacks by default
This is done in this way to keep computational overhead as low as
possible.

Also add an optional key attack_hidden_enemies. This can be used to
attack also hidden enemies; or to speed up the AI a little when no
hidden enemies are present.
2015-05-20 07:21:47 -07:00
mattsc
05eb2d7620 Lua AI helper functions: modify a comment 2015-05-20 07:13:11 -07:00
mattsc
25e10121f5 Lua AIs: fix bug occurring when number= in an attack is set to zero
Apparently, when this is the case, the number key is not included at
all, rather than set to zero, when the Lua table containing the attack
information is retrieved.
2015-05-19 19:54:41 -07:00
mattsc
c538e5f984 Micro AIs: issue warning if side defined in [micro_ai] tag does not exist
Previously this would cause a whole series of Lua error messages and,
potentially, some code not being executed.
2015-05-19 19:44:18 -07:00
mattsc
b657bbc862 Forest Animals MAI: bug fix, exclude border hexes for wander terrain
wesnoth.get_locations includes border hexes, so they need to be
excluded specifically. Previously this could cause error messages and
the CA to be blacklisted.
2015-04-02 08:22:23 -07:00
mattsc
38b089358a Herding Micro AI: bug fix for dogs sometimes having moves left at end
The problem is due to a dog adjacent to a sheep being excluded from the
dog_move CA (so that it can act further later on in case the sheep
moves again). It is fixed by adding another CA at the end that simply
takes all moves away from all dogs once all other CAs are done.
2015-04-02 08:22:02 -07:00
mattsc
95616c5af9 Bottleneck MAI: bug fix for when allied units are present
Hexes occupied by allied units were previously not excluded properly by
the AI, which could lead to error messages and the candidate action to
be blacklisted.
2015-04-02 08:21:36 -07:00
mattsc
1ea71c1a4d Bottleneck Micro AI: fix indenting 2015-04-02 08:19:49 -07:00