Lua AIs: remove unused debug output
(cherry-picked from commit 83c4ef2418
)
This commit is contained in:
parent
5bc44fcc0d
commit
98e5f0892e
6 changed files with 0 additions and 17 deletions
|
@ -1013,13 +1013,11 @@ function battle_calcs.attack_combo_stats(tmp_attackers, tmp_dsts, defender, cach
|
|||
-- if (p > 0) then
|
||||
-- local dhp_norm = (hp - av) / defender.max_hitpoints * wesnoth.unit_types[defender.type].cost
|
||||
-- local dvar = p * dhp_norm^2
|
||||
--print(hp,p,av, dvar)
|
||||
-- outcome_variance = outcome_variance + dvar
|
||||
-- n_outcomes = n_outcomes + 1
|
||||
-- end
|
||||
--end
|
||||
--outcome_variance = outcome_variance / n_outcomes
|
||||
--print('outcome_variance', outcome_variance)
|
||||
|
||||
-- Note that this is a variance, not a standard deviations (as in, it's squared),
|
||||
-- so it does not matter much for low-variance attacks, but takes on large values for
|
||||
|
|
|
@ -283,13 +283,11 @@ return {
|
|||
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
|
||||
return 0
|
||||
end
|
||||
--print('#units, #enemies', #units, #enemies)
|
||||
|
||||
-- First check if attacks are possible for any unit
|
||||
local return_value = 200000
|
||||
-- If one with > 50% chance of kill is possible, set return_value to lower than combat CA
|
||||
local attacks = ai.get_attacks()
|
||||
--print(#attacks)
|
||||
for i,a in ipairs(attacks) do
|
||||
if (#a.movements == 1) and (a.chance_to_kill > 0.5) then
|
||||
return_value = 90000
|
||||
|
@ -311,7 +309,6 @@ return {
|
|||
|
||||
-- If an enemy can get within one move of the village, we want to hold it
|
||||
if enemy_attack_map:get(v[1], v[2]) then
|
||||
--print(' within enemy reach', v[1], v[2])
|
||||
village_rating = village_rating + 100
|
||||
end
|
||||
|
||||
|
@ -345,7 +342,6 @@ return {
|
|||
if (cost <= u.moves) then
|
||||
village_rating = village_rating - 1
|
||||
reachable = true
|
||||
--print('Can reach:', u.id, v[1], v[2], cost)
|
||||
local rating = 0
|
||||
|
||||
-- Prefer strong units if enemies can reach the village, injured units otherwise
|
||||
|
@ -362,7 +358,6 @@ return {
|
|||
if (rating > best_unit_rating) then
|
||||
best_unit_rating, best_unit = rating, u
|
||||
end
|
||||
--print(' rating:', rating)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -375,7 +370,6 @@ return {
|
|||
max_rating, best_village, best_unit = rating, v, village_ratings[v][2]
|
||||
end
|
||||
end
|
||||
--print('max_rating', max_rating)
|
||||
|
||||
if (max_rating > -9e99) then
|
||||
self.data.unit, self.data.village = best_unit, best_village
|
||||
|
@ -418,14 +412,12 @@ return {
|
|||
} },
|
||||
canrecruit = 'no'
|
||||
}
|
||||
--print('#poisoners', #poisoners)
|
||||
if (not poisoners[1]) then
|
||||
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
|
||||
return 0
|
||||
end
|
||||
|
||||
local attacks = AH.get_attacks(poisoners)
|
||||
--print('#attacks', #attacks)
|
||||
if (not attacks[1]) then
|
||||
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
|
||||
return 0
|
||||
|
@ -463,7 +455,6 @@ return {
|
|||
-- For the same attacker/defender pair, go to strongest terrain
|
||||
local attack_defense = 100 - attacker:defense(wesnoth.get_terrain(a.dst.x, a.dst.y))
|
||||
rating = rating + attack_defense / 2.
|
||||
--print('rating', rating)
|
||||
|
||||
-- And from village everything else being equal
|
||||
local is_village = wesnoth.get_terrain_info(wesnoth.get_terrain(a.dst.x, a.dst.y)).village
|
||||
|
|
|
@ -86,7 +86,6 @@ function ca_ogres_flee:execution()
|
|||
|
||||
--AH.put_labels(rating_map)
|
||||
end
|
||||
--print(best_unit.id, best_unit.x, best_unit.y, best_hex[1], best_hex[2], max_rating)
|
||||
|
||||
if best_hex then
|
||||
AH.movefull_outofway_stopunit(ai, best_unit, best_hex[1], best_hex[2])
|
||||
|
|
|
@ -40,7 +40,6 @@ function ca_transport:execution()
|
|||
then
|
||||
transport_map:insert(u.x, u.y)
|
||||
table.insert(transports, u)
|
||||
--print("----> Inserting " .. u.id, u.x, u.y, u.variables.destination_x, u.variables.destination_y)
|
||||
else
|
||||
blocked_hex_map:insert(u.x, u.y)
|
||||
end
|
||||
|
|
|
@ -8,12 +8,10 @@ function ca_aggressive_attack_no_suicide:evaluation(cfg, data)
|
|||
side = wesnoth.current.side,
|
||||
formula = 'attacks_left > 0'
|
||||
}
|
||||
--print('#units', #units)
|
||||
if (not units[1]) then return 0 end
|
||||
|
||||
-- Get all possible attacks
|
||||
local attacks = AH.get_attacks(units, { include_occupied = true })
|
||||
--print('#attacks', #attacks)
|
||||
if (not attacks[1]) then return 0 end
|
||||
|
||||
-- Now find the best of the possible attacks
|
||||
|
@ -38,7 +36,6 @@ function ca_aggressive_attack_no_suicide:evaluation(cfg, data)
|
|||
|
||||
-- Also, take strongest unit first
|
||||
rating = rating + attacker.hitpoints / 10.
|
||||
--print('rating:', rating, attacker.id, defender.id)
|
||||
|
||||
if (rating > max_rating) then
|
||||
max_rating = rating
|
||||
|
|
|
@ -9,7 +9,6 @@ function retreat:evaluation(cfg, data)
|
|||
side = wesnoth.current.side,
|
||||
formula = 'movement_left > 0'
|
||||
}
|
||||
--print('#units', #units)
|
||||
if (not units[1]) then return 0 end
|
||||
|
||||
local unit, dst, enemy_threat = R.retreat_injured_units(units)
|
||||
|
|
Loading…
Add table
Reference in a new issue