Skip to content

Commit

Permalink
Lua AIs: remove unused debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsc committed Oct 6, 2019
1 parent b8d8547 commit d98b7f6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
2 changes: 0 additions & 2 deletions data/ai/lua/battle_calcs.lua
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion data/ai/lua/generic_recruit_engine.lua
Expand Up @@ -693,7 +693,6 @@ return {
if recruit_data.castle.loose_gold_limit >= recruit_data.recruit.cheapest_unit_cost then
gold_limit = recruit_data.castle.loose_gold_limit
end
--print (recruit_data.castle.loose_gold_limit .. " " .. recruit_data.recruit.cheapest_unit_cost .. " " .. gold_limit)

local recruitable_units = {}

Expand Down
9 changes: 0 additions & 9 deletions data/ai/lua/generic_rush_engine.lua
Expand Up @@ -281,13 +281,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
Expand All @@ -309,7 +307,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

Expand Down Expand Up @@ -343,7 +340,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
Expand All @@ -360,7 +356,6 @@ return {
if (rating > best_unit_rating) then
best_unit_rating, best_unit = rating, u
end
--print(' rating:', rating)
end
end
end
Expand All @@ -373,7 +368,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
Expand Down Expand Up @@ -416,14 +410,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
Expand Down Expand Up @@ -464,7 +456,6 @@ return {
-- For the same attacker/defender pair, go to strongest terrain
local attack_defense = 100 - wesnoth.unit_defense(attacker, 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
Expand Down

0 comments on commit d98b7f6

Please sign in to comment.