The Battle for Wesnoth  1.17.0-dev
registry.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2021
3  by Yurii Chernyi <terraninfo@terraninfo.net>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 /**
17  * All known c++ AI parts. Workaround to a linker feature of not including all symbols from files, and including only actually referenced stuff. this is not good for 'static registry' pattern. (other workarounds such as --whole-archive for ld are possible, but require messing with all buildsystems)
18  * @file
19  */
20 
21 #include "ai/registry.hpp"
22 
23 #include "config.hpp" // for config, operator<<
24 #include "terrain/filter.hpp" // for terrain_filter
25 #include "ai/composite/engine.hpp" // for register_engine_factory
26 #include "ai/composite/stage.hpp" // for ministage, idle_stage, etc
27 #include "ai/composite/rca.hpp"
28 #include "ai/game_info.hpp" // for attacks_vector
29 #include "ai/composite/ai.hpp" // for ai_composite
30 #include "ai/composite/aspect.hpp" // for composite_aspect, etc
31 #include "ai/default/engine_cpp.hpp" // for engine_cpp
32 #include "ai/formula/engine_fai.hpp" // for engine_fai
33 #include "ai/lua/engine_lua.hpp" // for engine_lua
34 #include "ai/composite/goal.hpp" // for register_goal_factory, etc
36 #include "ai/default/recruitment.hpp" // for recruitment
37 #include "ai/default/aspect_attacks.hpp" // for aspect_attacks
38 #include "ai/default/ca.hpp" // for leader_shares_keep_phase, etc
40 #include "ai/default/stage_rca.hpp"
41 
42 #include <string> // for string
43 #include <vector> // for vector
44 
45 
46 namespace ai {
47 // =======================================================================
48 // Engines
49 // =======================================================================
50 
51 static register_engine_factory<engine_cpp>
53 
54 static register_engine_factory<engine_fai>
56 
57 static register_engine_factory<engine_lua>
59 
60 // =======================================================================
61 // Stages
62 // =======================================================================
63 
64 static register_stage_factory<ai_default_rca::candidate_action_evaluation_loop>
65  candidate_action_evaluation_loop_factory("ai_default_rca::candidate_action_evaluation_loop");
66 
67 static register_stage_factory<idle_stage>
68  ai_idle_stage_factory("empty");
69 
70 // === Also keep the old syntax ===
71 static register_stage_factory<ai_default_rca::candidate_action_evaluation_loop>
72  old_candidate_action_evaluation_loop_factory("testing_ai_default::candidate_action_evaluation_loop");
73 
74 // =======================================================================
75 // Candidate actions
76 // =======================================================================
77 
78 static register_candidate_action_factory<ai_default_rca::goto_phase>
79  goto_phase_factory("ai_default_rca::goto_phase");
80 
81 static register_candidate_action_factory<ai_default_rca::combat_phase>
82  combat_phase_factory("ai_default_rca::combat_phase");
83 
84 static register_candidate_action_factory<ai_default_rca::move_leader_to_goals_phase>
85  move_leader_to_goals_phase_factory("ai_default_rca::move_leader_to_goals_phase");
86 
87 static register_candidate_action_factory<ai_default_rca::move_leader_to_keep_phase>
88  move_leader_to_keep_phase_factory("ai_default_rca::move_leader_to_keep_phase");
89 
90 static register_candidate_action_factory<ai_default_rca::get_villages_phase>
91  get_villages_phase_factory("ai_default_rca::get_villages_phase");
92 
93 static register_candidate_action_factory<ai_default_rca::get_healing_phase>
94  get_healing_phase_factory("ai_default_rca::get_healing_phase");
95 
96 static register_candidate_action_factory<ai_default_rca::retreat_phase>
97  retreat_phase_factory("ai_default_rca::retreat_phase");
98 
99 static register_candidate_action_factory<ai_default_rca::move_to_targets_phase>
100  default_move_to_targets_phase_factory("ai_default_rca::move_to_targets_phase");
101 
102 static register_candidate_action_factory<ai_default_rca::leader_control_phase>
103  leader_control_phase_factory("ai_default_rca::leader_control_phase");
104 
105 static register_candidate_action_factory<ai_default_rca::leader_shares_keep_phase>
106  leader_shares_keep_phase_factory("ai_default_rca::leader_shares_keep_phase");
107 
108 //Also keep passive_leader_shares_keep_phase for backward compatibility
109 static register_candidate_action_factory<ai_default_rca::leader_shares_keep_phase>
110  passive_leader_shares_keep_phase_factory("ai_default_rca::passive_leader_shares_keep_phase");
111 
112 static register_candidate_action_factory<default_recruitment::recruitment>
113  default_recruitment_factory("default_recruitment::recruitment");
114 
115 // === Also keep the old syntax ===
116 static register_candidate_action_factory<ai_default_rca::goto_phase>
117  old_goto_phase_factory("testing_ai_default::goto_phase");
118 
119 static register_candidate_action_factory<ai_default_rca::combat_phase>
120  old_combat_phase_factory("testing_ai_default::combat_phase");
121 
122 static register_candidate_action_factory<ai_default_rca::move_leader_to_goals_phase>
123  old_move_leader_to_goals_phase_factory("testing_ai_default::move_leader_to_goals_phase");
124 
125 static register_candidate_action_factory<ai_default_rca::move_leader_to_keep_phase>
126  old_move_leader_to_keep_phase_factory("testing_ai_default::move_leader_to_keep_phase");
127 
128 static register_candidate_action_factory<ai_default_rca::get_villages_phase>
129  old_get_villages_phase_factory("testing_ai_default::get_villages_phase");
130 
131 static register_candidate_action_factory<ai_default_rca::get_healing_phase>
132  old_get_healing_phase_factory("testing_ai_default::get_healing_phase");
133 
134 static register_candidate_action_factory<ai_default_rca::retreat_phase>
135  old_retreat_phase_factory("testing_ai_default::retreat_phase");
136 
137 static register_candidate_action_factory<ai_default_rca::move_to_targets_phase>
138  old_default_move_to_targets_phase_factory("testing_ai_default::default_move_to_targets_phase");
139 
140 static register_candidate_action_factory<ai_default_rca::move_to_targets_phase>
141  old_testing_move_to_targets_phase_factory("testing_ai_default::testing_move_to_targets_phase");
142 
143 static register_candidate_action_factory<ai_default_rca::leader_control_phase>
144  old_leader_control_phase_factory("testing_ai_default::leader_control_phase");
145 
146 static register_candidate_action_factory<ai_default_rca::leader_shares_keep_phase>
147  old_passive_leader_shares_keep_phase_factory("testing_ai_default::passive_leader_shares_keep_phase");
148 
149 // =======================================================================
150 // Goals
151 // =======================================================================
152 
153 static register_goal_factory<target_unit_goal>
154  goal_factory("");
155 
156 
157 static register_goal_factory<target_unit_goal>
158  goal_factory_target("target");
159 
160 
161 static register_goal_factory<target_unit_goal>
162  goal_factory_target_unit("target_unit");
163 
164 
165 static register_goal_factory<target_location_goal>
166  goal_factory_target_location("target_location");
167 
168 
169 static register_goal_factory<protect_location_goal>
170  goal_factory_protect_location("protect_location");
171 
172 
173 static register_goal_factory<protect_unit_goal>
174  goal_factory_protect_unit("protect_unit");
175 
176 static register_goal_factory<lua_goal>
177  goal_factory_lua_goal("lua_goal");
178 
179 
180 // =======================================================================
181 // Aspects
182 // =======================================================================
183 
184 //name=composite_aspect
185 
186 static register_aspect_factory< composite_aspect< unit_advancements_aspect >>
187  advancements__composite_aspect_factory("advancements*composite_aspect");
188 
189 static register_aspect_factory< composite_aspect<double>>
190  aggression__composite_aspect_factory("aggression*composite_aspect");
191 
192 static register_aspect_factory< composite_aspect< attacks_vector >>
193  attacks__composite_aspect_factory("attacks*composite_aspect");
194 
195 static register_aspect_factory< composite_aspect< terrain_filter >>
196  avoid__composite_aspect_factory("avoid*composite_aspect");
197 
198 static register_aspect_factory< composite_aspect<double>>
199  caution__composite_aspect_factory("caution*composite_aspect");
200 
201 static register_aspect_factory< composite_aspect<std::string>>
202  grouping__composite_aspect_factory("grouping*composite_aspect");
203 
204 static register_aspect_factory< composite_aspect<double>>
205  leader_aggression__composite_aspect_factory("leader_aggression*composite_aspect");
206 
207 static register_aspect_factory< composite_aspect<config>>
208  leader_goal__composite_aspect_factory("leader_goal*composite_aspect");
209 
210 static register_aspect_factory< composite_aspect<utils::variant<bool, std::vector<std::string>>>>
211  leader_igores_keep__composite_aspect_factory("leader_ignores_keep*composite_aspect");
212 
213 static register_aspect_factory< composite_aspect<double>>
214  leader_value__composite_aspect_factory("leader_value*composite_aspect");
215 
216 static register_aspect_factory< composite_aspect<utils::variant<bool, std::vector<std::string>>>>
217  passive_leader__composite_aspect_factory("passive_leader*composite_aspect");
218 
219 static register_aspect_factory< composite_aspect<utils::variant<bool, std::vector<std::string>>>>
220  passive_leader_shares_keep__composite_aspect_factory("passive_leader_shares_keep*composite_aspect");
221 
222 static register_aspect_factory< composite_aspect<double>>
223  recruitment_diversity__composite_aspect_factory("recruitment_diversity*composite_aspect");
224 
225 static register_aspect_factory< composite_aspect<config>>
226  recruitment_instructions__composite_aspect_factory("recruitment_instructions*composite_aspect");
227 
228 static register_aspect_factory< composite_aspect< std::vector<std::string>>>
229  recruitment_more__composite_aspect_factory("recruitment_more*composite_aspect");
230 
231 static register_aspect_factory< composite_aspect< std::vector<std::string>>>
232  recruitment_pattern__composite_aspect_factory("recruitment_pattern*composite_aspect");
233 
234 static register_aspect_factory< composite_aspect<int>>
235  recruitment_randomness__composite_aspect_factory("recruitment_randomness*composite_aspect");
236 
237 static register_aspect_factory< composite_aspect<config>>
238  recruitment_save_gold__composite_aspect_factory("recruitment_save_gold*composite_aspect");
239 
240 static register_aspect_factory< composite_aspect<double>>
241  retreat_enemy_weight__composite_aspect_factory("retreat_enemy_weight*composite_aspect");
242 
243 static register_aspect_factory< composite_aspect<double>>
244  retreat_factor__composite_aspect_factory("retreat_factor*composite_aspect");
245 
246 static register_aspect_factory< composite_aspect<double>>
247  scout_village_targeting__composite_aspect_factory("scout_village_targeting*composite_aspect");
248 
249 static register_aspect_factory< composite_aspect<bool>>
250  simple_targeting__composite_aspect_factory("simple_targeting*composite_aspect");
251 
252 static register_aspect_factory< composite_aspect<bool>>
253  support_villages__composite_aspect_factory("support_villages*composite_aspect");
254 
255 static register_aspect_factory< composite_aspect<double>>
256  village_value__composite_aspect_factory("village_value*composite_aspect");
257 
258 static register_aspect_factory< composite_aspect<int>>
259  villages_per_scout__composite_aspect_factory("villages_per_scout*composite_aspect");
260 
261 
262 //name=standard_aspect
263 static register_aspect_factory< standard_aspect< unit_advancements_aspect >>
264  advancements__standard_aspect_factory("advancements*standard_aspect");
265 
266 static register_aspect_factory< standard_aspect<double>>
267  aggression__standard_aspect_factory("aggression*standard_aspect");
268 
269 static register_aspect_factory< ai_default_rca::aspect_attacks >
270  attacks__testing_ai_default_aspect_attacks_factory("attacks*ai_default_rca::aspect_attacks");
271 
272 static register_aspect_factory< standard_aspect< terrain_filter >>
273  avoid__standard_aspect_factory("avoid*standard_aspect");
274 
275 static register_aspect_factory< standard_aspect<double>>
276  caution__standard_aspect_factory("caution*standard_aspect");
277 
278 static register_aspect_factory< standard_aspect<std::string>>
279  grouping__standard_aspect_factory("grouping*standard_aspect");
280 
281 static register_aspect_factory< standard_aspect<double>>
282  leader_aggression__standard_aspect_factory("leader_aggression*standard_aspect");
283 
284 static register_aspect_factory< standard_aspect<config>>
285  leader_goal__standard_aspect_factory("leader_goal*standard_aspect");
286 
287 static register_aspect_factory< standard_aspect<utils::variant<bool, std::vector<std::string>>>>
288  leader_ignores_keep__standard_aspect_factory("leader_ignores_keep*standard_aspect");
289 
290 static register_aspect_factory< standard_aspect<double>>
291  leader_value__standard_aspect_factory("leader_value*standard_aspect");
292 
293 static register_aspect_factory< standard_aspect<utils::variant<bool, std::vector<std::string>>>>
294  passive_leader__standard_aspect_factory("passive_leader*standard_aspect");
295 
296 static register_aspect_factory< standard_aspect<utils::variant<bool, std::vector<std::string>>>>
297  passive_leader_shares_keep__standard_aspect_factory("passive_leader_shares_keep*standard_aspect");
298 
299 static register_aspect_factory< standard_aspect<double>>
300  recruitment_diversity__standard_aspect_factory("recruitment_diversity*standard_aspect");
301 
302 static register_aspect_factory< default_recruitment::recruitment_aspect >
303  recruitment_instructions__standard_aspect_factory("recruitment_instructions*standard_aspect");
304 
305 static register_aspect_factory< standard_aspect< std::vector<std::string>>>
306  recruitment_more__standard_aspect_factory("recruitment_more*standard_aspect");
307 
308 static register_aspect_factory< standard_aspect< std::vector<std::string>>>
309  recruitment_pattern__standard_aspect_factory("recruitment_pattern*standard_aspect");
310 
311 static register_aspect_factory< standard_aspect<int>>
312  recruitment_randomness__standard_aspect_factory("recruitment_randomness*standard_aspect");
313 
314 static register_aspect_factory< standard_aspect<config>>
315  recruitment_save_gold__standard_aspect_factory("recruitment_save_gold*standard_aspect");
316 
317 static register_aspect_factory< standard_aspect<double>>
318  retreat_enemy_weight__standard_aspect_factory("retreat_enemy_weight*standard_aspect");
319 
320 static register_aspect_factory< standard_aspect<double>>
321  retreat_factor__standard_aspect_factory("retreat_factor*standard_aspect");
322 
323 static register_aspect_factory< standard_aspect<double>>
324  scout_village_targeting__standard_aspect_factory("scout_village_targeting*standard_aspect");
325 
326 static register_aspect_factory< standard_aspect<bool>>
327  simple_targeting__standard_aspect_factory("simple_targeting*standard_aspect");
328 
329 static register_aspect_factory< standard_aspect<bool>>
330  support_villages__standard_aspect_factory("support_villages*standard_aspect");
331 
332 static register_aspect_factory< standard_aspect<double>>
333  village_value__standard_aspect_factory("village_value*standard_aspect");
334 
335 static register_aspect_factory< standard_aspect<int>>
336  villages_per_scout__standard_aspect_factory("villages_per_scout*standard_aspect");
337 
338 
339 // Also keep the old syntax
340 static register_aspect_factory< ai_default_rca::aspect_attacks >
341  old_attacks__testing_ai_default_aspect_attacks_factory("attacks*testing_ai_default::aspect_attacks");
342 
343 //name = default
344 static register_aspect_factory< standard_aspect< unit_advancements_aspect >>
346 
347 static register_aspect_factory< standard_aspect<double>>
349 
350 static register_aspect_factory< ai_default_rca::aspect_attacks >
352 
353 static register_aspect_factory< standard_aspect< terrain_filter >>
355 
356 static register_aspect_factory< standard_aspect<double>>
358 
359 static register_aspect_factory< standard_aspect<std::string>>
361 
362 static register_aspect_factory< standard_aspect<double>>
363  leader_aggression__standard_aspect_factory2("leader_aggression*");
364 
365 static register_aspect_factory< standard_aspect<config>>
367 
368 static register_aspect_factory< standard_aspect<utils::variant<bool, std::vector<std::string>>>>
369  leader_ignores_keep__standard_aspect_factory2("leader_ignores_keep*");
370 
371 static register_aspect_factory< standard_aspect<double>>
373 
374 static register_aspect_factory< standard_aspect<utils::variant<bool, std::vector<std::string>>>>
375  passive_leader__standard_aspect_factory2("passive_leader*");
376 
377 static register_aspect_factory< standard_aspect<utils::variant<bool, std::vector<std::string>>>>
378  passive_leader_shares_keep__standard_aspect_factory2("passive_leader_shares_keep*");
379 
380 static register_aspect_factory< standard_aspect<double>>
381  recruitment_diversity__standard_aspect_factory2("recruitment_diversity*");
382 
383 static register_aspect_factory< default_recruitment::recruitment_aspect >
384  recruitment_instructions__standard_aspect_factory2("recruitment_instructions*");
385 
386 static register_aspect_factory< standard_aspect< std::vector<std::string>>>
387  recruitment_more__standard_aspect_factory2("recruitment_more*");
388 
389 static register_aspect_factory< standard_aspect< std::vector<std::string>>>
390  recruitment_pattern__standard_aspect_factory2("recruitment_pattern*");
391 
392 static register_aspect_factory< standard_aspect<int>>
393  recruitment_randomness__standard_aspect_factory2("recruitment_randomness*");
394 
395 static register_aspect_factory< standard_aspect<config>>
396  recruitment_save_gold__standard_aspect_factory2("recruitment_save_gold*");
397 
398 static register_aspect_factory< standard_aspect<double>>
399  retreat_enemy_weight__standard_aspect_factory2("retreat_enemy_weight*");
400 
401 static register_aspect_factory< standard_aspect<double>>
402  retreat_factor__standard_aspect_factory2("retreat_factor*");
403 
404 static register_aspect_factory< standard_aspect<double>>
405  scout_village_targeting__standard_aspect_factory2("scout_village_targeting*");
406 
407 static register_aspect_factory< standard_aspect<bool>>
408  simple_targeting__standard_aspect_factory2("simple_targeting*");
409 
410 static register_aspect_factory< standard_aspect<bool>>
411  support_villages__standard_aspect_factory2("support_villages*");
412 
413 static register_aspect_factory< standard_aspect<double>>
414  village_value__standard_aspect_factory2("village_value*");
415 
416 static register_aspect_factory< standard_aspect<int>>
417  villages_per_scout__standard_aspect_factory2("villages_per_scout*");
418 
419 
420 //name = lua
421 static register_lua_aspect_factory< lua_aspect< unit_advancements_aspect >>
422  advancements__lua_aspect_factory("advancements*lua_aspect");
423 
424 static register_lua_aspect_factory< lua_aspect<double>>
425  aggression__lua_aspect_factory("aggression*lua_aspect");
426 
427 static register_lua_aspect_factory< aspect_attacks_lua >
428  attacks__lua_aspect_factory("attacks*lua_aspect");
429 
430 static register_lua_aspect_factory< lua_aspect<terrain_filter>>
431  avoid__lua_aspect_factory("avoid*lua_aspect");
432 
433 static register_lua_aspect_factory< lua_aspect<double>>
434  caution__lua_aspect_factory("caution*lua_aspect");
435 
436 static register_lua_aspect_factory< lua_aspect<std::string>>
437  grouping__lua_aspect_factory("grouping*lua_aspect");
438 
439 static register_lua_aspect_factory< lua_aspect<double>>
440  leader_aggression__lua_aspect_factory("leader_aggression*lua_aspect");
441 
442 static register_lua_aspect_factory< lua_aspect<config>>
443  leader_goal__lua_aspect_factory("leader_goal*lua_aspect");
444 
445 static register_lua_aspect_factory< lua_aspect<utils::variant<bool, std::vector<std::string>>>>
446  leader_ignores_keep__lua_aspect_factory("leader_ignores_keep*lua_aspect");
447 
448 static register_lua_aspect_factory< lua_aspect<double>>
449  leader_value__lua_aspect_factory("leader_value*lua_aspect");
450 
451 static register_lua_aspect_factory< lua_aspect<utils::variant<bool, std::vector<std::string>>>>
452  passive_leader__lua_aspect_factory("passive_leader*lua_aspect");
453 
454 static register_lua_aspect_factory< lua_aspect<utils::variant<bool, std::vector<std::string>>>>
455  passive_leader_shares_keep__lua_aspect_factory("passive_leader_shares_keep*lua_aspect");
456 
457 static register_lua_aspect_factory< lua_aspect<double>>
458  retreat_enemy_weight__lua_aspect_factory("retreat_enemy_weight*lua_aspect");
459 
460 static register_lua_aspect_factory< lua_aspect<double>>
461  retreat_factor__lua_aspect_factory("retreat_factor*lua_aspect");
462 
463 static register_lua_aspect_factory< lua_aspect<double>>
464  scout_village_targeting__lua_aspect_factory("scout_village_targeting*lua_aspect");
465 
466 static register_lua_aspect_factory< lua_aspect<bool>>
467  simple_targeting__lua_aspect_factory("simple_targeting*lua_aspect");
468 
469 static register_lua_aspect_factory< lua_aspect<bool>>
470  support_villages__lua_aspect_factory("support_villages*lua_aspect");
471 
472 static register_lua_aspect_factory< lua_aspect<double>>
473  village_value__lua_aspect_factory("village_value*lua_aspect");
474 
475 static register_lua_aspect_factory< lua_aspect<int>>
476  villages_per_scout__lua_aspect_factory("villages_per_scout*lua_aspect");
477 
478 static register_lua_aspect_factory< lua_aspect< std::vector<std::string>>>
479  recruitment_pattern__lua_aspect_factory("recruitment_pattern*lua_aspect");
480 
481 
482 // Some compatibility - recruitment is a removed aspect, but its syntax
483 // is compatible with recruitment_instructions
484 static register_aspect_factory< composite_aspect<config>>
485  recruitments__composite_aspect_factory("recruitment*composite_aspect");
486 
487 static register_aspect_factory< default_recruitment::recruitment_aspect >
488  recruitment__standard_aspect_factory("recruitment*standard_aspect");
489 
490 static register_aspect_factory< default_recruitment::recruitment_aspect >
492 
494 {
495 }
496 
497 } //end of namespace ai
static register_engine_factory< engine_cpp > composite_ai_factory_cpp("cpp")
static register_lua_aspect_factory< lua_aspect< std::vector< std::string > > > recruitment_pattern__lua_aspect_factory("recruitment_pattern*lua_aspect")
static register_candidate_action_factory< ai_default_rca::retreat_phase > old_retreat_phase_factory("testing_ai_default::retreat_phase")
static register_aspect_factory< standard_aspect< utils::variant< bool, std::vector< std::string > > > > passive_leader__standard_aspect_factory("passive_leader*standard_aspect")
static register_candidate_action_factory< ai_default_rca::move_to_targets_phase > old_default_move_to_targets_phase_factory("testing_ai_default::default_move_to_targets_phase")
static register_aspect_factory< composite_aspect< unit_advancements_aspect > > advancements__composite_aspect_factory("advancements*composite_aspect")
static register_aspect_factory< composite_aspect< double > > leader_aggression__composite_aspect_factory("leader_aggression*composite_aspect")
static register_candidate_action_factory< ai_default_rca::move_to_targets_phase > old_testing_move_to_targets_phase_factory("testing_ai_default::testing_move_to_targets_phase")
static register_candidate_action_factory< ai_default_rca::leader_control_phase > old_leader_control_phase_factory("testing_ai_default::leader_control_phase")
static register_candidate_action_factory< ai_default_rca::leader_shares_keep_phase > passive_leader_shares_keep_phase_factory("ai_default_rca::passive_leader_shares_keep_phase")
static register_aspect_factory< composite_aspect< double > > leader_value__composite_aspect_factory("leader_value*composite_aspect")
static register_aspect_factory< standard_aspect< std::vector< std::string > > > recruitment_more__standard_aspect_factory("recruitment_more*standard_aspect")
static register_candidate_action_factory< ai_default_rca::leader_control_phase > leader_control_phase_factory("ai_default_rca::leader_control_phase")
static register_goal_factory< target_unit_goal > goal_factory_target_unit("target_unit")
static register_candidate_action_factory< ai_default_rca::move_leader_to_goals_phase > old_move_leader_to_goals_phase_factory("testing_ai_default::move_leader_to_goals_phase")
static register_lua_aspect_factory< lua_aspect< double > > caution__lua_aspect_factory("caution*lua_aspect")
FAI AI Support engine - creating specific ai components from config.
static register_aspect_factory< composite_aspect< utils::variant< bool, std::vector< std::string > > > > passive_leader_shares_keep__composite_aspect_factory("passive_leader_shares_keep*composite_aspect")
static register_aspect_factory< standard_aspect< std::string > > grouping__standard_aspect_factory("grouping*standard_aspect")
static register_aspect_factory< standard_aspect< terrain_filter > > avoid__standard_aspect_factory2("avoid*")
static register_lua_aspect_factory< lua_aspect< double > > village_value__lua_aspect_factory("village_value*lua_aspect")
CPP AI Support engine - creating specific ai components from config.
Composite AI stages.
static register_aspect_factory< default_recruitment::recruitment_aspect > recruitment__standard_aspect_factory("recruitment*standard_aspect")
AI Support engine - creating specific ai components from config.
static register_aspect_factory< standard_aspect< config > > recruitment_save_gold__standard_aspect_factory("recruitment_save_gold*standard_aspect")
static register_aspect_factory< composite_aspect< bool > > simple_targeting__composite_aspect_factory("simple_targeting*composite_aspect")
static register_aspect_factory< standard_aspect< double > > retreat_factor__standard_aspect_factory("retreat_factor*standard_aspect")
static register_aspect_factory< standard_aspect< double > > scout_village_targeting__standard_aspect_factory("scout_village_targeting*standard_aspect")
static register_aspect_factory< composite_aspect< config > > leader_goal__composite_aspect_factory("leader_goal*composite_aspect")
static register_goal_factory< lua_goal > goal_factory_lua_goal("lua_goal")
static register_aspect_factory< composite_aspect< int > > recruitment_randomness__composite_aspect_factory("recruitment_randomness*composite_aspect")
static register_aspect_factory< default_recruitment::recruitment_aspect > recruitment_instructions__standard_aspect_factory2("recruitment_instructions*")
static register_aspect_factory< standard_aspect< double > > aggression__standard_aspect_factory2("aggression*")
static register_aspect_factory< composite_aspect< utils::variant< bool, std::vector< std::string > > > > leader_igores_keep__composite_aspect_factory("leader_ignores_keep*composite_aspect")
static register_aspect_factory< ai_default_rca::aspect_attacks > old_attacks__testing_ai_default_aspect_attacks_factory("attacks*testing_ai_default::aspect_attacks")
static register_aspect_factory< composite_aspect< double > > retreat_enemy_weight__composite_aspect_factory("retreat_enemy_weight*composite_aspect")
Definitions for the interface to Wesnoth Markup Language (WML).
Default AI (Testing)
static register_aspect_factory< default_recruitment::recruitment_aspect > recruitment__standard_aspect_factory2("recruitment*")
static register_aspect_factory< standard_aspect< utils::variant< bool, std::vector< std::string > > > > leader_ignores_keep__standard_aspect_factory2("leader_ignores_keep*")
static register_candidate_action_factory< ai_default_rca::move_leader_to_keep_phase > move_leader_to_keep_phase_factory("ai_default_rca::move_leader_to_keep_phase")
static register_aspect_factory< composite_aspect< double > > caution__composite_aspect_factory("caution*composite_aspect")
static register_lua_aspect_factory< lua_aspect< unit_advancements_aspect > > advancements__lua_aspect_factory("advancements*lua_aspect")
static register_lua_aspect_factory< lua_aspect< double > > retreat_enemy_weight__lua_aspect_factory("retreat_enemy_weight*lua_aspect")
static register_aspect_factory< standard_aspect< double > > retreat_enemy_weight__standard_aspect_factory("retreat_enemy_weight*standard_aspect")
static register_goal_factory< protect_location_goal > goal_factory_protect_location("protect_location")
static register_candidate_action_factory< ai_default_rca::retreat_phase > retreat_phase_factory("ai_default_rca::retreat_phase")
static register_aspect_factory< composite_aspect< double > > recruitment_diversity__composite_aspect_factory("recruitment_diversity*composite_aspect")
A small explanation about what&#39;s going on here: Each action has access to two game_info objects First...
Definition: actions.cpp:61
static register_candidate_action_factory< ai_default_rca::leader_shares_keep_phase > leader_shares_keep_phase_factory("ai_default_rca::leader_shares_keep_phase")
static register_candidate_action_factory< default_recruitment::recruitment > default_recruitment_factory("default_recruitment::recruitment")
static register_aspect_factory< composite_aspect< double > > village_value__composite_aspect_factory("village_value*composite_aspect")
static register_aspect_factory< standard_aspect< int > > recruitment_randomness__standard_aspect_factory("recruitment_randomness*standard_aspect")
static register_aspect_factory< composite_aspect< config > > recruitment_instructions__composite_aspect_factory("recruitment_instructions*composite_aspect")
static register_aspect_factory< standard_aspect< double > > caution__standard_aspect_factory("caution*standard_aspect")
static register_lua_aspect_factory< lua_aspect< config > > leader_goal__lua_aspect_factory("leader_goal*lua_aspect")
static register_aspect_factory< standard_aspect< int > > villages_per_scout__standard_aspect_factory("villages_per_scout*standard_aspect")
static register_goal_factory< target_unit_goal > goal_factory_target("target")
static register_lua_aspect_factory< lua_aspect< double > > scout_village_targeting__lua_aspect_factory("scout_village_targeting*lua_aspect")
Composite AI with turn sequence which is a vector of stages.
static register_aspect_factory< composite_aspect< std::vector< std::string > > > recruitment_more__composite_aspect_factory("recruitment_more*composite_aspect")
static register_aspect_factory< standard_aspect< config > > leader_goal__standard_aspect_factory("leader_goal*standard_aspect")
static register_aspect_factory< composite_aspect< terrain_filter > > avoid__composite_aspect_factory("avoid*composite_aspect")
static register_aspect_factory< standard_aspect< double > > leader_value__standard_aspect_factory("leader_value*standard_aspect")
static register_aspect_factory< standard_aspect< double > > village_value__standard_aspect_factory("village_value*standard_aspect")
static register_aspect_factory< standard_aspect< double > > retreat_enemy_weight__standard_aspect_factory2("retreat_enemy_weight*")
static register_aspect_factory< standard_aspect< utils::variant< bool, std::vector< std::string > > > > leader_ignores_keep__standard_aspect_factory("leader_ignores_keep*standard_aspect")
Recruitment Engine by flix See https://wiki.wesnoth.org/AI_Recruitment.
static register_candidate_action_factory< ai_default_rca::move_leader_to_keep_phase > old_move_leader_to_keep_phase_factory("testing_ai_default::move_leader_to_keep_phase")
static register_lua_aspect_factory< aspect_attacks_lua > attacks__lua_aspect_factory("attacks*lua_aspect")
static register_aspect_factory< composite_aspect< double > > scout_village_targeting__composite_aspect_factory("scout_village_targeting*composite_aspect")
void init()
Initializes the GUI subsystems.
Definition: registry.cpp:493
static register_aspect_factory< standard_aspect< terrain_filter > > avoid__standard_aspect_factory("avoid*standard_aspect")
candidate action evaluator
static register_aspect_factory< standard_aspect< std::vector< std::string > > > recruitment_pattern__standard_aspect_factory2("recruitment_pattern*")
static register_candidate_action_factory< ai_default_rca::goto_phase > old_goto_phase_factory("testing_ai_default::goto_phase")
static register_aspect_factory< standard_aspect< double > > retreat_factor__standard_aspect_factory2("retreat_factor*")
static register_candidate_action_factory< ai_default_rca::move_to_targets_phase > default_move_to_targets_phase_factory("ai_default_rca::move_to_targets_phase")
static register_aspect_factory< standard_aspect< int > > villages_per_scout__standard_aspect_factory2("villages_per_scout*")
static register_aspect_factory< composite_aspect< int > > villages_per_scout__composite_aspect_factory("villages_per_scout*composite_aspect")
static register_candidate_action_factory< ai_default_rca::get_healing_phase > old_get_healing_phase_factory("testing_ai_default::get_healing_phase")
static register_aspect_factory< standard_aspect< std::vector< std::string > > > recruitment_pattern__standard_aspect_factory("recruitment_pattern*standard_aspect")
static register_candidate_action_factory< ai_default_rca::get_villages_phase > old_get_villages_phase_factory("testing_ai_default::get_villages_phase")
Game information for the AI.
static register_aspect_factory< standard_aspect< std::string > > grouping__standard_aspect_factory2("grouping*")
static register_aspect_factory< standard_aspect< double > > scout_village_targeting__standard_aspect_factory2("scout_village_targeting*")
static register_lua_aspect_factory< lua_aspect< double > > leader_aggression__lua_aspect_factory("leader_aggression*lua_aspect")
static register_stage_factory< ai_default_rca::candidate_action_evaluation_loop > candidate_action_evaluation_loop_factory("ai_default_rca::candidate_action_evaluation_loop")
static register_aspect_factory< standard_aspect< bool > > simple_targeting__standard_aspect_factory2("simple_targeting*")
static register_stage_factory< idle_stage > ai_idle_stage_factory("empty")
static register_lua_aspect_factory< lua_aspect< bool > > simple_targeting__lua_aspect_factory("simple_targeting*lua_aspect")
static register_aspect_factory< standard_aspect< bool > > support_villages__standard_aspect_factory2("support_villages*")
static register_lua_aspect_factory< lua_aspect< utils::variant< bool, std::vector< std::string > > > > leader_ignores_keep__lua_aspect_factory("leader_ignores_keep*lua_aspect")
static register_aspect_factory< composite_aspect< bool > > support_villages__composite_aspect_factory("support_villages*composite_aspect")
static register_stage_factory< ai_default_rca::candidate_action_evaluation_loop > old_candidate_action_evaluation_loop_factory("testing_ai_default::candidate_action_evaluation_loop")
static register_aspect_factory< standard_aspect< bool > > simple_targeting__standard_aspect_factory("simple_targeting*standard_aspect")
static register_aspect_factory< standard_aspect< unit_advancements_aspect > > advancements__standard_aspect_factory2("advancements*")
static register_aspect_factory< composite_aspect< attacks_vector > > attacks__composite_aspect_factory("attacks*composite_aspect")
static register_aspect_factory< composite_aspect< config > > recruitment_save_gold__composite_aspect_factory("recruitment_save_gold*composite_aspect")
static register_engine_factory< engine_lua > composite_ai_factory_lua("lua")
static register_aspect_factory< composite_aspect< std::vector< std::string > > > recruitment_pattern__composite_aspect_factory("recruitment_pattern*composite_aspect")
static register_lua_aspect_factory< lua_aspect< bool > > support_villages__lua_aspect_factory("support_villages*lua_aspect")
static register_lua_aspect_factory< lua_aspect< utils::variant< bool, std::vector< std::string > > > > passive_leader_shares_keep__lua_aspect_factory("passive_leader_shares_keep*lua_aspect")
Aspect: attacks.
static register_aspect_factory< standard_aspect< double > > leader_value__standard_aspect_factory2("leader_value*")
static register_aspect_factory< standard_aspect< utils::variant< bool, std::vector< std::string > > > > passive_leader__standard_aspect_factory2("passive_leader*")
static register_lua_aspect_factory< lua_aspect< double > > aggression__lua_aspect_factory("aggression*lua_aspect")
static register_candidate_action_factory< ai_default_rca::combat_phase > combat_phase_factory("ai_default_rca::combat_phase")
Strategic movement routine, for experimentation.
static register_aspect_factory< composite_aspect< double > > aggression__composite_aspect_factory("aggression*composite_aspect")
static register_aspect_factory< standard_aspect< int > > recruitment_randomness__standard_aspect_factory2("recruitment_randomness*")
static register_candidate_action_factory< ai_default_rca::move_leader_to_goals_phase > move_leader_to_goals_phase_factory("ai_default_rca::move_leader_to_goals_phase")
static register_lua_aspect_factory< lua_aspect< double > > retreat_factor__lua_aspect_factory("retreat_factor*lua_aspect")
static register_aspect_factory< composite_aspect< std::string > > grouping__composite_aspect_factory("grouping*composite_aspect")
static register_aspect_factory< standard_aspect< std::vector< std::string > > > recruitment_more__standard_aspect_factory2("recruitment_more*")
static register_engine_factory< engine_fai > composite_ai_factory_fai("fai")
static register_lua_aspect_factory< lua_aspect< int > > villages_per_scout__lua_aspect_factory("villages_per_scout*lua_aspect")
static register_aspect_factory< standard_aspect< double > > leader_aggression__standard_aspect_factory2("leader_aggression*")
static register_aspect_factory< standard_aspect< double > > aggression__standard_aspect_factory("aggression*standard_aspect")
static register_candidate_action_factory< ai_default_rca::leader_shares_keep_phase > old_passive_leader_shares_keep_phase_factory("testing_ai_default::passive_leader_shares_keep_phase")
static register_candidate_action_factory< ai_default_rca::combat_phase > old_combat_phase_factory("testing_ai_default::combat_phase")
static register_goal_factory< target_unit_goal > goal_factory("")
static register_aspect_factory< standard_aspect< config > > recruitment_save_gold__standard_aspect_factory2("recruitment_save_gold*")
static register_lua_aspect_factory< lua_aspect< std::string > > grouping__lua_aspect_factory("grouping*lua_aspect")
static register_lua_aspect_factory< lua_aspect< double > > leader_value__lua_aspect_factory("leader_value*lua_aspect")
static register_aspect_factory< default_recruitment::recruitment_aspect > recruitment_instructions__standard_aspect_factory("recruitment_instructions*standard_aspect")
static register_goal_factory< protect_unit_goal > goal_factory_protect_unit("protect_unit")
static register_candidate_action_factory< ai_default_rca::get_healing_phase > get_healing_phase_factory("ai_default_rca::get_healing_phase")
static register_lua_aspect_factory< lua_aspect< terrain_filter > > avoid__lua_aspect_factory("avoid*lua_aspect")
static register_aspect_factory< standard_aspect< double > > leader_aggression__standard_aspect_factory("leader_aggression*standard_aspect")
static register_aspect_factory< ai_default_rca::aspect_attacks > attacks__testing_ai_default_aspect_attacks_factory("attacks*ai_default_rca::aspect_attacks")
static register_goal_factory< target_location_goal > goal_factory_target_location("target_location")
LUA AI Support engine - creating specific ai components from config.
static register_aspect_factory< composite_aspect< utils::variant< bool, std::vector< std::string > > > > passive_leader__composite_aspect_factory("passive_leader*composite_aspect")
static register_candidate_action_factory< ai_default_rca::get_villages_phase > get_villages_phase_factory("ai_default_rca::get_villages_phase")
static register_aspect_factory< composite_aspect< double > > retreat_factor__composite_aspect_factory("retreat_factor*composite_aspect")
static register_aspect_factory< standard_aspect< utils::variant< bool, std::vector< std::string > > > > passive_leader_shares_keep__standard_aspect_factory("passive_leader_shares_keep*standard_aspect")
static register_lua_aspect_factory< lua_aspect< utils::variant< bool, std::vector< std::string > > > > passive_leader__lua_aspect_factory("passive_leader*lua_aspect")
static register_aspect_factory< standard_aspect< utils::variant< bool, std::vector< std::string > > > > passive_leader_shares_keep__standard_aspect_factory2("passive_leader_shares_keep*")
static register_aspect_factory< standard_aspect< double > > recruitment_diversity__standard_aspect_factory("recruitment_diversity*standard_aspect")
static register_aspect_factory< standard_aspect< double > > caution__standard_aspect_factory2("caution*")
static register_aspect_factory< standard_aspect< double > > recruitment_diversity__standard_aspect_factory2("recruitment_diversity*")
All known AI parts.
static register_aspect_factory< standard_aspect< bool > > support_villages__standard_aspect_factory("support_villages*standard_aspect")
candidate action framework
static register_aspect_factory< composite_aspect< config > > recruitments__composite_aspect_factory("recruitment*composite_aspect")
static register_aspect_factory< ai_default_rca::aspect_attacks > attacks__testing_ai_default_aspect_attacks_factory2("attacks*")
static register_candidate_action_factory< ai_default_rca::goto_phase > goto_phase_factory("ai_default_rca::goto_phase")
static register_aspect_factory< standard_aspect< config > > leader_goal__standard_aspect_factory2("leader_goal*")
static register_aspect_factory< standard_aspect< unit_advancements_aspect > > advancements__standard_aspect_factory("advancements*standard_aspect")
static register_aspect_factory< standard_aspect< double > > village_value__standard_aspect_factory2("village_value*")