Experimental AI: adjustments to candidate action scores
The relative ranking of the CA scores is not changed, except for one case when two CAs had the same score.
Reasons:
- All scores should be lower than the scores of the default Goto CA (200,000) and the default scores of most Micro AIs (300,000).
- Break tie, resulting in uncertain order of execution, of place_healers and retreat_injured CA. Healers should be placed first, to allow retreating injured units to adjacent hexes.
- Set default for generic_recruit_engine to slightly above default AI recruiting score. That way it takes effect even if the default CA is not removed.
- Increase move_to_any_enemy CA score from 1 to 1,000. It is still the lowest score that way, but allows for setting up custom CAs with even lower scores (even if it is just for end-of-turn statistics or the like).
(cherry-picked from commit 35ba820509
)
This commit is contained in:
parent
d40aa8406c
commit
4999b20bd1
7 changed files with 7 additions and 7 deletions
|
@ -161,7 +161,7 @@ function ca_castle_switch:evaluation(cfg, data)
|
|||
data.leader_target = next_hop
|
||||
|
||||
-- if we're on a keep, wait until there are no movable units on the castle before moving off
|
||||
CS_leader_score = 290000
|
||||
CS_leader_score = 195000
|
||||
if wesnoth.get_terrain_info(wesnoth.get_terrain(leader.x, leader.y)).keep then
|
||||
local castle = wesnoth.get_locations {
|
||||
x = "1-"..width, y = "1-"..height,
|
||||
|
|
|
@ -31,7 +31,7 @@ function ca_grab_villages:evaluation(cfg, data)
|
|||
end
|
||||
|
||||
-- First check if attacks are possible for any unit
|
||||
local return_value = 200000
|
||||
local return_value = 191000
|
||||
-- If one with > 50% chance of kill is possible, set return_value to lower than combat CA
|
||||
local attacks = ai.get_attacks()
|
||||
for i,a in ipairs(attacks) do
|
||||
|
|
|
@ -51,7 +51,7 @@ function ca_move_to_any_enemy:evaluation(cfg, data)
|
|||
MTAE_unit = unit
|
||||
|
||||
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
|
||||
return 1
|
||||
return 1000
|
||||
end
|
||||
|
||||
function ca_move_to_any_enemy:execution(cfg, data)
|
||||
|
|
|
@ -11,7 +11,7 @@ function ca_place_healers:evaluation(cfg, data)
|
|||
|
||||
if HS:evaluation(cfg, data) > 0 then
|
||||
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
|
||||
return 95000
|
||||
return 96000
|
||||
end
|
||||
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
|
||||
return 0
|
||||
|
|
|
@ -14,7 +14,7 @@ end
|
|||
|
||||
local dummy_engine = { data = {} }
|
||||
|
||||
local params = { score_function = (function() return 300000 end) }
|
||||
local params = { score_function = (function() return 196000 end) }
|
||||
if ca_castle_switch then
|
||||
params.min_turn_1_recruit = (function() return ca_castle_switch:evaluation({}, dummy_engine.data) > 0 end)
|
||||
params.leader_takes_village = (function()
|
||||
|
|
|
@ -30,7 +30,7 @@ function ca_retreat_injured:evaluation(cfg, data)
|
|||
end
|
||||
end
|
||||
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
|
||||
return 205000
|
||||
return 192000
|
||||
end
|
||||
if AH.print_eval() then AH.done_eval_messages(start_time, ca_name) end
|
||||
return 0
|
||||
|
|
|
@ -371,7 +371,7 @@ return {
|
|||
end
|
||||
data.recruit.cheapest_unit_cost = cheapest_unit_cost
|
||||
|
||||
local score = 180000 -- default score if one not provided. Same as RCA AI
|
||||
local score = 180010 -- default score if one not provided, just above RCA AI recruiting
|
||||
if params.score_function then
|
||||
score = params.score_function()
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue