Commit graph

55 commits

Author SHA1 Message Date
gfgtdf
b21c110f30 run wmlindent 2020-10-19 23:53:52 +02:00
mattsc
fefe431360 AI: fix remove castle_switch CA from default AI 2020-03-04 06:55:35 -08:00
mattsc
e36e8e1ac3 AI: remove castle_switch CA from default AI
It causes more harm than good in many singleplayer scenarios, for example when there is an allied AI keep close to the player's AI.

The candidate action is still part of the Experimental AI, and its marco remains available, so it can easily be included in a scenario if desired.
2020-03-04 06:49:43 -08:00
mattsc
c93b1db30a AI: do not use village hunt CA in any AI config
The algorithm used in this CA is too simple to work reliably in a general setting, it tends to send whole groups of units toward small numbers of villages, or even individual ones. In its current version, it should not be used at all, not even in the Experimental AI. The recommended way to emphasize village hunting is to set the village_value aspect to a larger-than-default value and let the move-to-targets CA take care of it.

We are, however, leaving the CA code and the macros in place for potential future work.
2019-12-07 14:02:52 -08:00
mattsc
1e01df84ff AI: do not use new grab_villages CA for default AI
The old villages CA is quite a bit better at distributing multiple units across multiple villages. The advantage of the new grab_villages CA is that it has a variable score, sometimes grabbing villages before, and sometimes after attacks. This does not outweigh its shortcomings though.

So for now, the default AI will continue to use the previous CA, and the Experimental AI will use the new one. Thus, the two AIs are not quite identical any more (but still very similar).

I also added a todo comment that the grab_villages CA might be reinstated if it is improved.
2019-12-06 08:18:47 -08:00
mattsc
038dc2d7fe AI: remove old retreat_phase CA from AI configs
It is now superseded by the retreat_injured CA (of the former Experimental AI).
2019-12-06 08:18:47 -08:00
mattsc
a38356e61c Experimental AI: add comments that it is now same as default 2019-11-29 19:22:56 -08:00
mattsc
3bd6613dda AI: Set up macros for Experimental AI candidate actions
In the same way as they are set up for the default AI
2019-11-29 19:22:56 -08:00
mattsc
74c7c17ec8 Experimental AI: fix AI setup max_score values
The return scores were changed in commit 4999b20bd1, but the max_score values in the configurations have not been updated yet. As the relative ranking was not changed, this should not have any effect on gameplay.
2019-11-21 21:11:34 -08:00
mattsc
6dc199d4f8 ExpAI recruiting: make high_level_fraction parameter configurable
This also sets its default value to zero, in order to have consistent default behavior with versions from before this parameter was introduced.

It also provides a macro so that the ExpAI can be used with custom parameters in a scenario config, and adds high_level_fraction as an optional parameter to the Recruit Rushers Micro AI.
2019-10-08 12:45:59 -07:00
mattsc
c0bc8c548c AI: deprecate ai_depth related macros 2018-11-16 06:47:54 -08:00
mattsc
8c8cafaa70 Deprecate EXPERIMENTAL_AI macro 2018-11-15 06:46:41 -08:00
Celtic Minstrel
e2bc73b27b Add omitted final [] to [modify_ai] paths in core macros and UtBS 2018-10-23 22:40:01 -04:00
Severin Glöckner
c48735c0fb Core Macro Reference: Fix hint
[ci skip]

(cherry-picked from commit 00e41b9857)
2018-10-07 03:25:00 +00:00
mattsc
800947594c Experimental AI: convert to using external CAs
(cherry-picked from commit 5474785718)
2018-10-07 03:24:44 +00:00
mattsc
d781e6263a High XP attacks: adapt other AIs to existence of new CA
This means:
1. Adding the new CA to AI configs
2. Removing it whenever the combat CA is removed
3. Preventing conflicts for AIs that previously used overlapping scores
2016-09-03 20:00:12 -07:00
mattsc
f161a3cc1c Fix AI_FORMULA_AI_EXPERIMENTAL_RECRUITMENT macro
This also deletes the AI_SIMPLE_FORMULA_AI_EXPERIMENTAL_RECRUITMENT
macro. There is no point in keeping both of them.
2016-03-26 15:34:39 -07:00
mattsc
ae8df114f6 Fix indenting 2016-03-24 05:27:45 -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
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
1f93899652 New macros AI_SAVE_GOLD and AI_SAVE_GOLD_DEFAULT
… to make enabling gold saving for the AI simpler in a scenario now
that it is not the default any more.
2014-01-25 20:29:15 -08:00
Groggy Dice
6e47a1818d ai.cfg: fix "#ifdef MEDIUM" to NORMAL in attack_depth
Though this may be in vain, as I read on the wiki that attack_depth is not
working with the RCA ai and is deprecated. While this bug might break
attack_depth on one difficulty level, it shouldn't have broken it entirely,
so this is probably not the reason it doesn't seem to be working.
2014-01-03 11:09:00 -05:00
mattsc
d5e27a2e3f Correct the example given for MODIFY_AI_ADD_ASPECT
The [facet] tag is needed, but was not shown.
2013-12-27 10:20:24 -08:00
mattsc
12c73569ca AI macros: update comments for display on wiki reference page
This is for the auto-generated page at
http://www.wesnoth.org/macro-reference.html
2013-12-26 20:00:45 -08:00
mattsc
c214c12611 ExpAI: add retreating and village hunting CAs 2013-11-01 09:36:26 -07:00
mattsc
d9aa43ef44 ExpAI: fix the name= value of Place Healers CA
It doesn't really matter for anything in practice, but should be done
right.
2013-11-01 09:35:43 -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
0ef41090c0 Move AI_CONTROLLER_ALLOW_LEADER_CONTROL macro
... from data/core/macros/ai.cfg to data/core/macros/ai_controller.cfg
2013-10-04 08:08:29 -07:00
flix
545c9b2057 Hang in new recruitment CA.
- Alter macro {AI_CA_RECRUITMENT} to point to the new CA
- Create a new AI cfg file for a stronger AI
- Create a new AI cfg (dev) file for choosing the old recruitment CA in debug mode.
- Alter macro {AI_NO_RECRUITMENT}
2013-09-25 15:32:20 +02: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
d11edb6ec7 Make Experimental AI available in MP and SP
This is done through a new macro EXPERIMENTAL_AI.  Previously, it was
only available as a multiplayer AI.
2013-06-14 20:35:31 -07:00
Ignacio R. Morelle
fbd8f6ae59 Ran wmlindent 2012-01-11 21:49:32 +00:00
Iurii Chernyi
1f667d3bf8 Fix bug #18122:
AI leaders set to defensive will now follow human-set leader goals
anyway, even to the death.
2011-08-11 21:36:17 +00:00
Steven Panek
4a7ec6b8c3 Made it so that AI_CONTROLLER_ALLOW_LEADER_CONTROL's menu item...
...only appears if the leader it's supposed to control is alive.
2011-07-26 20:19:32 +00:00
Eric S. Raymond
e7d337a676 Reindent mainline. 2010-09-23 13:04:56 +00:00
Iurii Chernyi
5fc4765bb5 fix bug #15390:
...add a try_delete action to modify_ai which has 'delete if exists,
don't complain if not exists' semantics
2010-03-09 19:39:15 +00:00
Eric S. Raymond
c62c55e1a2 More macro argument typechecking. No mismatches in mainline. 2010-02-12 00:25:20 +00:00
Eric S. Raymond
75f2727548 More nacro argument type checking. No mismatches in mainline. 2010-02-11 22:45:04 +00:00
Iurii Chernyi
6117d5b021 fixed a segfault in fai_candidate_action serialization code,
...removed some old stubs, used better and simpler AI syntax in LoW::1,
LoW::2, LoW::3 , split candidate action WML snippets to their own file
2009-12-25 01:25:34 +00:00
Eric S. Raymond
0aa99781cf Reindent mainline. 2009-11-23 14:39:03 +00:00
Iurii Chernyi
22c6537c93 rework of ai macros comments,
...added a macro to limit attack_depth depending on difficulty level
2009-11-12 11:02:15 +00:00
Iurii Chernyi
ac44576f15 additional changes to AI macros 2009-11-11 21:16:55 +00:00
Iurii Chernyi
be779c5d73 LoW: fix bug # 14404:
...made special right-click leader control actions disappear on
victory
2009-09-30 20:57:50 +00:00
Iurii Chernyi
9563cfd035 modified AI_CONTROLLER_ALLOW_LEADER_CONTROL macro...
...to show a better menu item description and to allow I18N of menu
item description
2009-09-24 00:06:28 +00:00
Iurii Chernyi
62e66e9110 a useful AI macro: a menu item to ask allied leaders to move to target hex 2009-09-23 00:29:41 +00:00
Iurii Chernyi
eb77fed2dc added empty stage, used experimental fai recruitment for LoW::2,
...disabled extra debug output in formula ai recruitment, disabled
recruitment of Ulfserkers and Berserkers in LoW::2
2009-09-22 23:45:23 +00:00
Nils Kneuper
64abf3e200 add a default textdomain declaration...
...(using "./utils/change-textdomain -t data/")
2009-09-20 13:53:46 +00:00
Iurii Chernyi
7d2d62cb33 added macros to use new formula_ai recruitment (experimental!).
The simplest way is to include
{AI_SIMPLE_FORMULA_AI_EXPERIMENTAL_RECRUITMENT} in [side][ai]
2009-09-05 22:10:09 +00:00
Iurii Chernyi
afcb29c338 reworked AI macros, added support for moving leader to goal...
...as a candidate action, fixed some bugs, changed modify_ai syntax to
make it more resilient to bugs and to allow reuse of subtags
2009-09-03 23:23:37 +00:00
Iurii Chernyi
90dcb12256 fixed usage of an outdated AI macro 2009-09-01 10:08:05 +00:00