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