- Unit formulas are replaced by inline MicroAIs or candidate actions placed in the unit's [ai] tag.
- The stationed_guardian MicroAI was chosen as the closest match to the guardian FormulaAI. It's not a perfect fit, but it's pretty close.
- The goto and patrol MicroAIs are fairly obvious substitutes for the respective unit formulas.
- The priority test in unit formulas is replaced by fairly basic inline non-external CAs with differing scores.
- The side formulas (opening.fai) have been converted to a separate Lua stage using a new opening.lua. However, that's only a partial conversion. The move and attack functionalities of opening.fai are missing from opening.lua; instead the built-in move, move leader to keep, and combat CAs are used.
- The scouting FormulaAI CA has been ported to Lua. It remains a very basic AI, probably not well-suited to genera use.
- The level up attack FormulaAI CA has been ported to Lua. Like the new scouting CA, this is mostly intended to serve as an example.
- The t_string type is now a schema built-in type and no longer attempts a regex match.
- You can also specify that non-t_string types may be optionally-translatable; this case supports a regex match on the string (but note that the translation mark is not part of the match).
- Error messages involving keys with very large values ( > 128 characters) will now truncate the value.
- To account for occasional cases where the schema is intentionally violated, the --validate command-line option now automatically defines the SCHEMA_VALIDATION preprocessor define.
A key validates as type t_string if one of the following is true:
- The key is not present
- The key has at least one segment with a translation mark
- The key is blank (an empty string)
Any type other than t_string is not allowed to be translatable by default, unless you specify allow_translatable=yes in the [type] tag.
An optionally-translatable string could also be defined as a union of t_string and some other type.
This scenario uses the huge final map from THoT, with different situations
split across different rooms of the map. THoT's final scenario was redesigned
with a completely new map in 457d9d17f, so this gives the test code its own
copy of the map.
There's a one-hex change to the original: the test puts side 1's leader in a
wall, isolated from the action. To clarify that that's intentional, the map
copy changes that hex to be passable, still surrounded by wall.
As indicated in the comment of the idle_ai config file, an AI needs to
contain at least one stage, otherwise the default AI will be injected
under certain circumstances. Unlike indicated in the comment, this now
also applies to loading a mid-scenario save. (I will add that to the
comment in the next commit.)
As this AI was in data/ai/dev/, it was previously only loaded when
Wesnoth was started in debug mode. The config was thus not available
when playing in no-debug mode, causing the default AI to be injected on
reload. This caused issue #1955.
While not strictly necessary, we keep a redirect in data/ai/dev for
backward compatibility, in case the file is included in add-ons.
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
This CA performs attacks on enemy units so close to leveling that the
default AI's combat CA would not attack them (with some exceptions).
This is meant to keep players from being able to exploit this known
weakness of the default AI.
All CAs can be store in external .lua files. If the scenario config
lacks an [engine] tag for the Lua AI engine, but still tries to use CA
with engine=lua, a dummy engine will be automatically generated,
providing the needed functionality
(1) Lua CA_wrapper slightly refactored, in preparation for adding CA
definitons using external files
(2) --debug_lua command line argument added. Unused at the moment, but
will be used for Lua debug mechanisms