Remove suokko AI remnants
This commit is contained in:
parent
f4ba176e1e
commit
b7455d3bd4
3 changed files with 0 additions and 28 deletions
|
@ -310,30 +310,13 @@ void aspect_attacks_base::do_attack_analysis(
|
|||
|
||||
// If this is a position with equal defense to another position,
|
||||
// but more vulnerability then we don't want to use it.
|
||||
#ifdef SUOKKO
|
||||
//FIXME: this code was in sukko's r29531 Correct?
|
||||
// scale vulnerability to 60 hp unit
|
||||
if(cur_position >= 0 && rating < best_rating
|
||||
&& (vulnerability/surround_bonus*30.0)/unit_itor->second.hitpoints() -
|
||||
(support*surround_bonus*30.0)/unit_itor->second.max_hitpoints()
|
||||
> best_vulnerability - best_support) {
|
||||
continue;
|
||||
}
|
||||
#else
|
||||
if(cur_position >= 0 && rating == best_rating && vulnerability/surround_bonus - support*surround_bonus >= best_vulnerability - best_support) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
cur_position = j;
|
||||
best_rating = rating;
|
||||
#ifdef SUOKKO
|
||||
//FIXME: this code was in sukko's r29531 Correct?
|
||||
best_vulnerability = (vulnerability/surround_bonus*30.0)/unit_itor->second.hitpoints();
|
||||
best_support = (support*surround_bonus*30.0)/unit_itor->second.max_hitpoints();
|
||||
#else
|
||||
best_vulnerability = vulnerability/surround_bonus;
|
||||
best_support = support*surround_bonus;
|
||||
#endif
|
||||
}
|
||||
|
||||
if(cur_position != -1) {
|
||||
|
|
|
@ -279,14 +279,8 @@ double attack_analysis::rating(double aggression, const readonly_context& ai_obj
|
|||
// into sub-optimal terrain.
|
||||
// Calculate the 'exposure' of our units to risk.
|
||||
|
||||
#ifdef SUOKKO
|
||||
//FIXME: this code was in sukko's r29531 Correct?
|
||||
const double exposure_mod = uses_leader ? ai_obj.current_team().caution()* 8.0 : ai_obj.current_team().caution() * 4.0;
|
||||
const double exposure = exposure_mod*resources_used*((terrain_quality - alternative_terrain_quality)/10)*vulnerability/std::max<double>(0.01,support);
|
||||
#else
|
||||
const double exposure_mod = uses_leader ? 2.0 : ai_obj.get_caution();
|
||||
const double exposure = exposure_mod*resources_used*(terrain_quality - alternative_terrain_quality)*vulnerability/std::max<double>(0.01,support);
|
||||
#endif
|
||||
LOG_AI << "attack option has base value " << value << " with exposure " << exposure << ": "
|
||||
<< vulnerability << "/" << support << " = " << (vulnerability/std::max<double>(support,0.1)) << "\n";
|
||||
value -= exposure*(1.0-aggression);
|
||||
|
|
|
@ -164,12 +164,7 @@ std::vector<target> default_ai_context_impl::find_targets(const move_map& enemy_
|
|||
|
||||
assert(threats.empty() == false);
|
||||
|
||||
#ifdef SUOKKO
|
||||
//FIXME: suokko's revision 29531 included this change. Correct?
|
||||
const double value = threat*get_protect_leader()/leader->second.hitpoints();
|
||||
#else
|
||||
const double value = threat/double(threats.size());
|
||||
#endif
|
||||
for(std::set<map_location>::const_iterator i = threats.begin(); i != threats.end(); ++i) {
|
||||
LOG_AI << "found threat target... " << *i << " with value: " << value << "\n";
|
||||
targets.push_back(target(*i,value,target::TYPE::THREAT));
|
||||
|
|
Loading…
Add table
Reference in a new issue