Advertisement
Guest User

AI prototype

a guest
May 22nd, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 18.57 KB | None | 0 0
  1. From 00503c71cfcd69704b8a1eee64bb7d37749e9398 Mon Sep 17 00:00:00 2001
  2. From: PL_kolek <mateusz.kolaczek@gmail.com>
  3. Date: Wed, 22 May 2013 11:15:40 +0200
  4. Subject: [PATCH] Prototype for estimating enemy response.
  5.  
  6. ---
  7. data/ai/ais/ai_test.cfg                       |  32 ++++
  8.  data/core/macros/ai_candidate_actions.cfg     |  10 ++
  9.  data/multiplayer/scenarios/defensive_test.cfg |  62 ++++++++
  10.  src/CMakeLists.txt                            |   2 +
  11.  src/ai/contexts.cpp                           |   3 +
  12.  src/ai/contexts.hpp                           |   1 +
  13.  src/ai/default/attack.cpp                     | 212 +++++++++++++++++++++++++-
  14.  src/ai/default/contexts.hpp                   |  11 +-
  15.  src/ai/registry.cpp                           |  14 ++
  16.  9 files changed, 345 insertions(+), 2 deletions(-)
  17.  create mode 100644 data/ai/ais/ai_test.cfg
  18.  create mode 100644 data/multiplayer/scenarios/defensive_test.cfg
  19.  
  20. diff --git a/data/ai/ais/ai_test.cfg b/data/ai/ais/ai_test.cfg
  21. new file mode 100644
  22. index 0000000..fc01f6a
  23. --- /dev/null
  24. +++ b/data/ai/ais/ai_test.cfg
  25. @@ -0,0 +1,32 @@
  26. +{core/macros}
  27. +#textdomain wesnoth
  28. +[ai]
  29. +    id=ai_test
  30. +    description=_"Multiplayer_AI^Test test"
  31. +    version=10710     
  32. +   [aspect]
  33. +       id=attacks_test
  34. +       engine=cpp
  35. +       name=composite_aspect
  36. +       invalidate_on_gamestate_change=yes
  37. +       [default]
  38. +           engine=cpp
  39. +           name=ai_default_rca::aspect_attacks_test
  40. +           invalidate_on_gamestate_change=yes
  41. +       [/default]
  42. +   [/aspect]
  43. +    [stage]
  44. +        id=main_loop
  45. +        name=ai_default_rca::candidate_action_evaluation_loop
  46. +        {AI_CA_GOTO}
  47. +        {AI_CA_RECRUITMENT}
  48. +        {AI_CA_MOVE_LEADER_TO_GOALS}
  49. +        {AI_CA_MOVE_LEADER_TO_KEEP}
  50. +        {AI_CA_COMBAT_TEST}
  51. +        {AI_CA_HEALING}
  52. +        {AI_CA_VILLAGES}
  53. +        {AI_CA_RETREAT}
  54. +        {AI_CA_MOVE_TO_TARGETS}
  55. +        {AI_CA_LEADER_SHARES_KEEP}
  56. +    [/stage]
  57. +[/ai]
  58. diff --git a/data/core/macros/ai_candidate_actions.cfg b/data/core/macros/ai_candidate_actions.cfg
  59. index 4c625ef..e9b7a32 100644
  60. --- a/data/core/macros/ai_candidate_actions.cfg
  61. +++ b/data/core/macros/ai_candidate_actions.cfg
  62. @@ -99,6 +99,16 @@
  63.      [/candidate_action]
  64.  #enddef
  65.  
  66. +#define AI_CA_COMBAT_TEST
  67. +    [candidate_action]
  68. +        id=combat_test
  69. +        engine=cpp
  70. +        name=ai_default_rca::combat_phase_test
  71. +        max_score={AI_CA_COMBAT_SCORE}
  72. +        score={AI_CA_COMBAT_SCORE}
  73. +    [/candidate_action]
  74. +#enddef
  75. +
  76.  #define AI_CA_HEALING
  77.      [candidate_action]
  78.          id=healing
  79. diff --git a/data/multiplayer/scenarios/defensive_test.cfg b/data/multiplayer/scenarios/defensive_test.cfg
  80. new file mode 100644
  81. index 0000000..159a9e3
  82. --- /dev/null
  83. +++ b/data/multiplayer/scenarios/defensive_test.cfg
  84. @@ -0,0 +1,62 @@
  85. +[multiplayer]
  86. +   id=multiplayer_defensive_test
  87. +   name= _ "Defensive AI Test Map"
  88. +   map_data= "border_size=1
  89. +usage=map
  90. +
  91. +Gg, Gg, Gg, Gg, Ql, Gg, Ql, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  92. +Gg, 1 Gg, Ql, Ql, Ql, Ql, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  93. +Gg, Ql, Ql, Ql, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  94. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  95. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  96. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  97. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  98. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gs^Vh, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  99. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  100. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  101. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  102. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  103. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg
  104. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Ql
  105. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Ql, Ql, Gg
  106. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Ms, Gg, Gg, Gg, Gg, Ql, Ql, 2 Gg, Gg, Gg
  107. +Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Ql, Gg, Gg, Gg, Gg, Gg
  108. +"
  109. +
  110. +   {DEFAULT_SCHEDULE}
  111. +   [side]
  112. +      side=1
  113. +      canrecruit=yes
  114. +      controller=human
  115. +      id=tested
  116. +      [unit]
  117. +           id=Defender
  118. +           type=Dwarvish Guardsman
  119. +           x=9
  120. +           y=15
  121. +           side=1
  122. +      [/unit]
  123. +      [unit]
  124. +           id=Defended
  125. +           type=Dwarvish Lord
  126. +           x=7
  127. +           y=7
  128. +           side=1
  129. +           hitpoints=1
  130. +      [/unit]
  131. +   [/side]
  132. +   [side]
  133. +      side=2
  134. +      canrecruit=yes
  135. +      controller=human
  136. +      id=tester
  137. +      [unit]
  138. +           id=Defender
  139. +           type=Cavalryman
  140. +           x=7
  141. +           y=14
  142. +           side=2
  143. +      [/unit]
  144. +   [/side]
  145. +
  146. +[/multiplayer]
  147. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
  148. index 4db9a6f..37775d6 100644
  149. --- a/src/CMakeLists.txt
  150. +++ b/src/CMakeLists.txt
  151. @@ -633,7 +633,9 @@ set(wesnoth-main_SRC
  152.     ai/registry.cpp
  153.     ai/testing.cpp
  154.     ai/testing/aspect_attacks.cpp
  155. +   ai/testing/aspect_attacks_test.cpp
  156.     ai/testing/ca.cpp
  157. +   ai/testing/ca_combat_test.cpp
  158.     ai/testing/ca_global_fallback.cpp
  159.     ai/testing/ca_testing_move_to_targets.cpp
  160.     ai/testing/ca_testing_recruitment.cpp
  161. diff --git a/src/ai/contexts.cpp b/src/ai/contexts.cpp
  162. index 13291ba..10d289c 100644
  163. --- a/src/ai/contexts.cpp
  164. +++ b/src/ai/contexts.cpp
  165. @@ -198,6 +198,7 @@ readonly_context_impl::readonly_context_impl(side_context &context, const config
  166.         add_known_aspect("aggression",aggression_);
  167.         add_known_aspect("attack_depth",attack_depth_);
  168.         add_known_aspect("attacks",attacks_);
  169. +       add_known_aspect("attacks_test",attacks_test_);
  170.         add_known_aspect("avoid",avoid_);
  171.         add_known_aspect("caution",caution_);
  172.         add_known_aspect("grouping",grouping_);
  173. @@ -523,6 +524,8 @@ aspect_map& readonly_context_impl::get_aspects()
  174.  
  175.  const attacks_vector& readonly_context_impl::get_attacks() const
  176.  {
  177. +   if(attacks_test_)
  178. +       return attacks_test_->get();
  179.     if (attacks_) {
  180.         return attacks_->get();
  181.     }
  182. diff --git a/src/ai/contexts.hpp b/src/ai/contexts.hpp
  183. index 70f33da..23738f5 100644
  184. --- a/src/ai/contexts.hpp
  185. +++ b/src/ai/contexts.hpp
  186. @@ -1453,6 +1453,7 @@ private:
  187.     aspect_type<int>::typesafe_ptr attack_depth_;
  188.     aspect_map aspects_;
  189.     aspect_type< attacks_vector >::typesafe_ptr attacks_;
  190. +   aspect_type< attacks_vector >::typesafe_ptr attacks_test_;
  191.     mutable aspect_type<terrain_filter>::typesafe_ptr avoid_;
  192.     aspect_type<double>::typesafe_ptr caution_;
  193.     mutable std::map<map_location,defensive_position> defensive_position_cache_;
  194. diff --git a/src/ai/default/attack.cpp b/src/ai/default/attack.cpp
  195. index 8a11ce7..7225914 100644
  196. --- a/src/ai/default/attack.cpp
  197. +++ b/src/ai/default/attack.cpp
  198. @@ -246,6 +246,189 @@ void attack_analysis::analyze(const gamemap& map, unit_map& units,
  199.     }
  200.  }
  201.  
  202. +/** Used for next turn losses prediction */
  203. +void attack_analysis::analyze_offensive(const gamemap& map, unit_map& units,
  204. +                 const readonly_context& ai_obj)
  205. +{
  206. +   const unit_map::const_iterator defend_it = units.find(target);
  207. +   assert(defend_it != units.end());
  208. +
  209. +   leader_threat = false;
  210. +   uses_leader = false;
  211. +
  212. +   target_value = defend_it->cost();
  213. +   target_value += (double(defend_it->experience())/
  214. +                    double(defend_it->max_experience()))*target_value;
  215. +   target_starting_damage = defend_it->max_hitpoints() -
  216. +                            defend_it->hitpoints();
  217. +
  218. +   alternative_terrain_quality = 0.0;
  219. +
  220. +   avg_damage_inflicted = 0.0;
  221. +   avg_damage_taken = 0.0;
  222. +   resources_used = 0.0;
  223. +   terrain_quality = 0.0;
  224. +   avg_losses = 0.0;
  225. +   chance_to_kill = 0.0;
  226. +
  227. +   double def_avg_experience = 0.0;
  228. +   double first_chance_kill = 0.0;
  229. +
  230. +   double prob_dead_already = 0.0;
  231. +   assert(!movements.empty());
  232. +   std::vector<std::pair<map_location,map_location> >::const_iterator m;
  233. +
  234. +   battle_context *prev_bc = NULL;
  235. +   const combatant *prev_def = NULL;
  236. +
  237. +   for (m = movements.begin(); m != movements.end(); ++m) {
  238. +       // We fix up units map to reflect what this would look like.
  239. +       unit *up = units.extract(m->first);
  240. +       up->set_location(m->second);
  241. +       units.insert(up);
  242. +       double m_aggression = 1;
  243. +
  244. +       bool from_cache = false;
  245. +       battle_context *bc;
  246. +
  247. +       // This cache is only about 99% correct, but speeds up evaluation by about 1000 times.
  248. +       // We recalculate when we actually attack.
  249. +       const readonly_context::unit_stats_cache_t::key_type cache_key = std::make_pair(target, &up->type());
  250. +       const readonly_context::unit_stats_cache_t::iterator usc = ai_obj.unit_stats_cache().find(cache_key);
  251. +       // Just check this attack is valid for this attacking unit (may be modified)
  252. +       if (usc != ai_obj.unit_stats_cache().end() &&
  253. +               usc->second.first.attack_num <
  254. +               static_cast<int>(up->attacks().size())) {
  255. +
  256. +           from_cache = true;
  257. +           bc = new battle_context(usc->second.first, usc->second.second);
  258. +       } else {
  259. +           bc = new battle_context(units, m->second, target, -1, -1, m_aggression, prev_def);
  260. +       }
  261. +       const combatant &att = bc->get_attacker_combatant(prev_def);
  262. +       const combatant &def = bc->get_defender_combatant(prev_def);
  263. +
  264. +       delete prev_bc;
  265. +       prev_bc = bc;
  266. +       prev_def = &bc->get_defender_combatant(prev_def);
  267. +
  268. +       if ( !from_cache ) {
  269. +           ai_obj.unit_stats_cache().insert(
  270. +               std::make_pair(cache_key, std::make_pair(bc->get_attacker_stats(),
  271. +                                                        bc->get_defender_stats())));
  272. +       }
  273. +
  274. +       // Note we didn't fight at all if defender is already dead.
  275. +       double prob_fought = (1.0 - prob_dead_already);
  276. +
  277. +       /** @todo 1.9 add combatant.prob_killed */
  278. +       double prob_killed = def.hp_dist[0] - prob_dead_already;
  279. +       prob_dead_already = def.hp_dist[0];
  280. +
  281. +       double prob_died = att.hp_dist[0];
  282. +       double prob_survived = (1.0 - prob_died) * prob_fought;
  283. +
  284. +       double cost = up->cost();
  285. +       const bool on_village = map.is_village(m->second);
  286. +       // Up to double the value of a unit based on experience
  287. +       cost += (double(up->experience()) / up->max_experience())*cost;
  288. +       resources_used += cost;
  289. +       avg_losses += cost * prob_died;
  290. +
  291. +       // add half of cost for poisoned unit so it might get chance to heal
  292. +       avg_losses += cost * up->get_state(unit::STATE_POISONED) /2;
  293. +
  294. +       if (!bc->get_defender_stats().is_poisoned) {
  295. +           avg_damage_inflicted += game_config::poison_amount * 2 * bc->get_defender_combatant().poisoned * (1 - prob_killed);
  296. +       }
  297. +
  298. +       // Double reward to emphasize getting onto villages if they survive.
  299. +       if (on_village) {
  300. +           avg_damage_taken -= game_config::poison_amount*2 * prob_survived;
  301. +       }
  302. +
  303. +       terrain_quality += (double(bc->get_defender_stats().chance_to_hit)/100.0)*cost * (on_village ? 0.5 : 1.0);
  304. +
  305. +       double advance_prob = 0.0;
  306. +       // The reward for advancing a unit is to get a 'negative' loss of that unit
  307. +       if (!up->advances_to().empty()) {
  308. +           int xp_for_advance = up->max_experience() - up->experience();
  309. +
  310. +           // See bug #6272... in some cases, unit already has got enough xp to advance,
  311. +           // but hasn't (bug elsewhere?).  Can cause divide by zero.
  312. +           if (xp_for_advance <= 0)
  313. +               xp_for_advance = 1;
  314. +
  315. +           int fight_xp = defend_it->level();
  316. +           int kill_xp = game_config::kill_xp(fight_xp);
  317. +
  318. +           if (fight_xp >= xp_for_advance) {
  319. +               advance_prob = prob_fought;
  320. +               avg_losses -= up->cost() * prob_fought;
  321. +           } else if (kill_xp >= xp_for_advance) {
  322. +               advance_prob = prob_killed;
  323. +               avg_losses -= up->cost() * prob_killed;
  324. +               // The reward for getting a unit closer to advancement
  325. +               // (if it didn't advance) is to get the proportion of
  326. +               // remaining experience needed, and multiply it by
  327. +               // a quarter of the unit cost.
  328. +               // This will cause the AI to heavily favor
  329. +               // getting xp for close-to-advance units.
  330. +               avg_losses -= up->cost() * 0.25 *
  331. +                   fight_xp * (prob_fought - prob_killed)
  332. +                   / xp_for_advance;
  333. +           } else {
  334. +               avg_losses -= up->cost() * 0.25 *
  335. +                   (kill_xp * prob_killed + fight_xp * (prob_fought - prob_killed))
  336. +                   / xp_for_advance;
  337. +           }
  338. +
  339. +           // The reward for killing with a unit that plagues
  340. +           // is to get a 'negative' loss of that unit.
  341. +           if (bc->get_attacker_stats().plagues) {
  342. +               avg_losses -= prob_killed * up->cost();
  343. +           }
  344. +       }
  345. +
  346. +       // If we didn't advance, we took this damage.
  347. +       avg_damage_taken += (up->hitpoints() - att.average_hp()) * (1.0 - advance_prob);
  348. +
  349. +       /**
  350. +        * @todo 1.9: attack_prediction.cpp should understand advancement
  351. +        * directly.  For each level of attacker def gets 1 xp or
  352. +        * kill_experience.
  353. +        */
  354. +       int fight_xp = up->level();
  355. +       int kill_xp = game_config::kill_xp(fight_xp);
  356. +       def_avg_experience += fight_xp * (1.0 - att.hp_dist[0]) + kill_xp * att.hp_dist[0];
  357. +       if (m == movements.begin()) {
  358. +           first_chance_kill = def.hp_dist[0];
  359. +       }
  360. +   }
  361. +
  362. +   if (!defend_it->advances_to().empty() &&
  363. +       def_avg_experience >= defend_it->max_experience() - defend_it->experience()) {
  364. +       // It's likely to advance: only if we can kill with first blow.
  365. +       chance_to_kill = first_chance_kill;
  366. +       // Negative average damage (it will advance).
  367. +       avg_damage_inflicted += defend_it->hitpoints() - defend_it->max_hitpoints();
  368. +   } else {
  369. +       chance_to_kill = prev_def->hp_dist[0];
  370. +       std::cerr<<"HP prev_def avg hp "<<defend_it->hitpoints()<<" "<< prev_def->average_hp()<<"\n";
  371. +       avg_damage_inflicted += defend_it->hitpoints() - prev_def->average_hp();
  372. +   }
  373. +
  374. +   delete prev_bc;
  375. +   terrain_quality /= resources_used;
  376. +
  377. +   // Restore the units to their original positions.
  378. +   for (m = movements.begin(); m != movements.end(); ++m) {
  379. +       units.move(m->second, m->first);
  380. +   }
  381. +}
  382. +
  383. +
  384. +
  385.  bool attack_analysis::attack_close(const map_location& loc) const
  386.  {
  387.     std::set<map_location> &attacks = manager::get_ai_info().recent_attacks;
  388. @@ -269,7 +452,7 @@ double attack_analysis::rating(double aggression, const readonly_context& ai_obj
  389.         aggression = ai_obj.get_leader_aggression();
  390.     }
  391.  
  392. -   double value = chance_to_kill*target_value - avg_losses*(1.0-aggression);
  393. +   double value = chance_to_kill*target_value - avg_losses*(1.0-aggression) - next_turn_losses;
  394.  
  395.     if(terrain_quality > alternative_terrain_quality) {
  396.         // This situation looks like it might be a bad move:
  397. @@ -329,5 +512,32 @@ double attack_analysis::rating(double aggression, const readonly_context& ai_obj
  398.  
  399.     return value;
  400.  }
  401. +/** Used for next turn losses prediction */
  402. +double attack_analysis::rating_offensive() const
  403. +{
  404. +   double value = chance_to_kill*target_value;
  405. +
  406. +   // Prefer to attack already damaged targets.
  407. +   value += (target_starting_damage/3 + avg_damage_inflicted);
  408. +
  409. +   if(vulnerability*terrain_quality > 0.0) {
  410. +       value *= support/(vulnerability*terrain_quality);
  411. +   }
  412. +
  413. +   value /= ((resources_used/2) + (resources_used/2)*terrain_quality);
  414. +
  415. +   LOG_AI << "attack on " << target << ": attackers: " << movements.size()
  416. +       << " value: " << value << " chance to kill: " << chance_to_kill
  417. +       << " damage inflicted: " << avg_damage_inflicted
  418. +       << " damage taken: " << avg_damage_taken
  419. +       << " vulnerability: " << vulnerability
  420. +       << " support: " << support
  421. +       << " quality: " << terrain_quality
  422. +       << " alternative quality: " << alternative_terrain_quality << "\n";
  423. +
  424. +
  425. +   //std::cerr<<"Rating: "<<value<<" "<<next_turn_losses<<"\n";
  426. +   return value;
  427. +}
  428.  
  429.  } //end of namespace ai
  430. diff --git a/src/ai/default/contexts.hpp b/src/ai/default/contexts.hpp
  431. index 633e499..72d762e 100644
  432. --- a/src/ai/default/contexts.hpp
  433. +++ b/src/ai/default/contexts.hpp
  434. @@ -66,7 +66,8 @@ public:
  435.         support(0.0),
  436.         leader_threat(false),
  437.         uses_leader(false),
  438. -       is_surrounded(false)
  439. +       is_surrounded(false),
  440. +       next_turn_losses(0)
  441.     {
  442.     }
  443.  
  444. @@ -76,6 +77,11 @@ public:
  445.                  const move_map& enemy_dstsrc, double aggression);
  446.  
  447.     double rating(double aggression, const readonly_context& ai_obj) const;
  448. +
  449. +   void analyze_offensive(const gamemap& map, unit_map& units,
  450. +                const readonly_context& ai_obj);
  451. +   double rating_offensive() const;
  452. +
  453.     variant get_value(const std::string& key) const;
  454.     void get_inputs(std::vector<game_logic::formula_input>* inputs) const;
  455.  
  456. @@ -129,6 +135,9 @@ public:
  457.     /** Is true if the units involved in this attack sequence are surrounded. */
  458.     bool is_surrounded;
  459.  
  460. +   /** Average enemy's response stats in current situation*/
  461. +   double next_turn_losses;
  462. +
  463.  };
  464.  
  465.  
  466. diff --git a/src/ai/registry.cpp b/src/ai/registry.cpp
  467. index 1c6a7b8..9e5eba6 100644
  468. --- a/src/ai/registry.cpp
  469. +++ b/src/ai/registry.cpp
  470. @@ -27,7 +27,9 @@
  471.  #include "formula/ai.hpp"
  472.  #include "registry.hpp"
  473.  #include "testing/aspect_attacks.hpp"
  474. +#include "testing/aspect_attacks_test.hpp"
  475.  #include "testing/ca.hpp"
  476. +#include "testing/ca_combat_test.hpp"
  477.  #include "testing/ca_testing_move_to_targets.hpp"
  478.  #include "testing/ca_testing_recruitment.hpp"
  479.  #include "testing/ca_global_fallback.hpp"
  480. @@ -95,6 +97,9 @@ static register_candidate_action_factory<testing_ai_default::recruitment_phase>
  481.  static register_candidate_action_factory<testing_ai_default::combat_phase>
  482.     combat_phase_factory("ai_default_rca::combat_phase");
  483.  
  484. +static register_candidate_action_factory<testing_ai_default::combat_phase_test>
  485. +   combat_phase_factory_test("ai_default_rca::combat_phase_test");
  486. +
  487.  static register_candidate_action_factory<testing_ai_default::move_leader_to_goals_phase>
  488.     move_leader_to_goals_phase_factory("ai_default_rca::move_leader_to_goals_phase");
  489.  
  490. @@ -233,6 +238,9 @@ static register_aspect_factory< composite_aspect<int> >
  491.  static register_aspect_factory< composite_aspect< attacks_vector > >
  492.     attacks__composite_aspect_factory("attacks*composite_aspect");
  493.  
  494. +static register_aspect_factory< composite_aspect< attacks_vector > >
  495. +   attacks__composite_aspect_factory_test("attacks_test*composite_aspect");
  496. +
  497.  static register_aspect_factory< composite_aspect< terrain_filter > >
  498.     avoid__composite_aspect_factory("avoid*composite_aspect");
  499.  
  500. @@ -301,6 +309,9 @@ static register_aspect_factory< standard_aspect<int> >
  501.  static register_aspect_factory< testing_ai_default::aspect_attacks >
  502.     attacks__testing_ai_default_aspect_attacks_factory("attacks*ai_default_rca::aspect_attacks");
  503.  
  504. +static register_aspect_factory< testing_ai_default::aspect_attacks_test >
  505. +   attacks__testing_ai_default_aspect_attacks_test_factory("attacks_test*ai_default_rca::aspect_attacks_test");
  506. +
  507.  static register_aspect_factory< standard_aspect< terrain_filter > >
  508.     avoid__standard_aspect_factory("avoid*standard_aspect");
  509.  
  510. @@ -372,6 +383,9 @@ static register_aspect_factory< standard_aspect<int> >
  511.  static register_aspect_factory< testing_ai_default::aspect_attacks >
  512.     attacks__testing_ai_default_aspect_attacks_factory2("attacks*");
  513.  
  514. +static register_aspect_factory< testing_ai_default::aspect_attacks_test >
  515. +   attacks__testing_ai_default_aspect_attacks_test_factory2("attacks_test*");
  516. +
  517.  static register_aspect_factory< standard_aspect< terrain_filter > >
  518.     avoid__standard_aspect_factory2("avoid*");
  519.  
  520. --
  521. 1.8.2.3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement