stabilize RCA AI configuration for 1.8,
...extract candidate actions to separate macroses
This commit is contained in:
parent
ff510b6e47
commit
fb9fa4bd91
3 changed files with 142 additions and 79 deletions
|
@ -4,86 +4,17 @@
|
|||
id=testing_ai_default
|
||||
description=RCA AI
|
||||
version=10703
|
||||
[aspect] #that is an aspect
|
||||
id=aggression #it's id is aggression. Id of an aspect must be one of well-known ids (see AI_Module page in the wiki)
|
||||
#we can override aspect config here, but it is better to leave default composite_aspect in here, and add [facet]'s instead
|
||||
[facet]#we add a facet to this aspect
|
||||
id=base_value #this is an arbitrary facet id.
|
||||
engine=cpp #this facet
|
||||
name=standard_aspect #this is the default
|
||||
value="0.4" #this is the value of this aspect.
|
||||
# we can put time_of_day or turns restriction there, as well. The rule is 'first facet that is active is used'
|
||||
[/facet]
|
||||
#we can put other [facet]'s in there
|
||||
[/aspect]
|
||||
|
||||
[stage]
|
||||
id=main_loop
|
||||
engine=cpp
|
||||
name=testing_ai_default::candidate_action_evaluation_loop
|
||||
[candidate_action]
|
||||
id=goto
|
||||
engine=cpp
|
||||
name=testing_ai_default::goto_phase
|
||||
max_score=20000
|
||||
score=20000
|
||||
[/candidate_action]
|
||||
[candidate_action]
|
||||
id=recruitment
|
||||
engine=cpp
|
||||
name=testing_ai_default::aspect_recruitment_phase
|
||||
max_score=10000
|
||||
score=10000
|
||||
[/candidate_action]
|
||||
[candidate_action]
|
||||
id=move_leader_to_goals
|
||||
engine=cpp
|
||||
name=testing_ai_default::move_leader_to_goals_phase
|
||||
max_score=8000
|
||||
score=8000
|
||||
[/candidate_action]
|
||||
[candidate_action]
|
||||
id=move_leader_to_keep
|
||||
engine=cpp
|
||||
name=testing_ai_default::move_leader_to_keep_phase
|
||||
max_score=7000
|
||||
score=7000
|
||||
[/candidate_action]
|
||||
[candidate_action]
|
||||
id=combat
|
||||
engine=cpp
|
||||
name=testing_ai_default::combat_phase
|
||||
max_score=4000
|
||||
score=4000
|
||||
[/candidate_action]
|
||||
[candidate_action]
|
||||
id=healing
|
||||
engine=cpp
|
||||
name=testing_ai_default::get_healing_phase
|
||||
max_score=3000
|
||||
score=3000
|
||||
[/candidate_action]
|
||||
[candidate_action]
|
||||
id=villages
|
||||
engine=cpp
|
||||
name=testing_ai_default::get_villages_phase
|
||||
max_score=2500
|
||||
score=2500
|
||||
[/candidate_action]
|
||||
[candidate_action]
|
||||
id=retreat
|
||||
engine=cpp
|
||||
name=testing_ai_default::retreat_phase
|
||||
max_score=2000
|
||||
score=2000
|
||||
[/candidate_action]
|
||||
[candidate_action]
|
||||
id=move_to_targets
|
||||
engine=cpp
|
||||
name=testing_ai_default::default_move_to_targets_phase
|
||||
max_score=1500
|
||||
score=1500
|
||||
[/candidate_action]
|
||||
{AI_CA_GOTO}
|
||||
{AI_CA_RECRUITMENT}
|
||||
{AI_CA_MOVE_LEADER_TO_GOALS}
|
||||
{AI_CA_MOVE_LEADER_TO_KEEP}
|
||||
{AI_CA_COMBAT}
|
||||
{AI_CA_HEALING}
|
||||
{AI_CA_VILLAGES}
|
||||
{AI_CA_RETREAT}
|
||||
{AI_CA_MOVE_TO_TARGETS}
|
||||
[/stage]
|
||||
#note that there's no fallback stage there - this is a complete ai implemented as an RCA
|
||||
[/ai]
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
[/aspect]
|
||||
#enddef
|
||||
|
||||
{DEFAULT_ASPECT_VALUE aggression 0.5}
|
||||
{DEFAULT_ASPECT_VALUE aggression 0.4}
|
||||
{DEFAULT_ASPECT_VALUE attack_depth 5}
|
||||
[aspect]
|
||||
id=attacks
|
||||
|
|
132
data/core/macros/ai_candidate_actions.cfg
Normal file
132
data/core/macros/ai_candidate_actions.cfg
Normal file
|
@ -0,0 +1,132 @@
|
|||
|
||||
# scores of well-known candidate actions
|
||||
|
||||
#define AI_CA_GOTO_SCORE
|
||||
20000
|
||||
#enddef
|
||||
|
||||
#define AI_CA_RECRUITMENT_SCORE
|
||||
18000
|
||||
#enddef
|
||||
|
||||
#define AI_CA_MOVE_LEADER_TO_GOALS_SCORE
|
||||
14000
|
||||
#enddef
|
||||
|
||||
#define AI_CA_MOVE_LEADER_TO_KEEP_SCORE
|
||||
12000
|
||||
#enddef
|
||||
|
||||
#define AI_CA_COMBAT_SCORE
|
||||
10000
|
||||
#enddef
|
||||
|
||||
#define AI_CA_HEALING_SCORE
|
||||
8000
|
||||
#enddef
|
||||
|
||||
#define AI_CA_VILLAGES_SCORE
|
||||
6000
|
||||
#enddef
|
||||
|
||||
#define AI_CA_RETREAT_SCORE
|
||||
4000
|
||||
#enddef
|
||||
|
||||
#define AI_CA_MOVE_TO_TARGETS_SCORE
|
||||
2000
|
||||
#enddef
|
||||
|
||||
# well-known candidate actions
|
||||
|
||||
#define AI_CA_GOTO
|
||||
[candidate_action]
|
||||
id=goto
|
||||
engine=cpp
|
||||
name=testing_ai_default::goto_phase
|
||||
max_score={AI_CA_GOTO_SCORE}
|
||||
score={AI_CA_GOTO_SCORE}
|
||||
[/candidate_action]
|
||||
#enddef
|
||||
|
||||
#define AI_CA_RECRUITMENT
|
||||
[candidate_action]
|
||||
id=recruitment
|
||||
engine=cpp
|
||||
name=testing_ai_default::aspect_recruitment_phase
|
||||
max_score={AI_CA_RECRUITMENT_SCORE}
|
||||
score={AI_CA_RECRUITMENT_SCORE}
|
||||
[/candidate_action]
|
||||
#enddef
|
||||
|
||||
#define AI_CA_MOVE_LEADER_TO_GOALS
|
||||
[candidate_action]
|
||||
id=move_leader_to_goals
|
||||
engine=cpp
|
||||
name=testing_ai_default::move_leader_to_goals_phase
|
||||
max_score={AI_CA_MOVE_LEADER_TO_GOALS_SCORE}
|
||||
score={AI_CA_MOVE_LEADER_TO_GOALS_SCORE}
|
||||
[/candidate_action]
|
||||
#enddef
|
||||
|
||||
#define AI_CA_MOVE_LEADER_TO_KEEP
|
||||
[candidate_action]
|
||||
id=move_leader_to_keep
|
||||
engine=cpp
|
||||
name=testing_ai_default::move_leader_to_keep_phase
|
||||
max_score={AI_CA_MOVE_LEADER_TO_KEEP_SCORE}
|
||||
score={AI_CA_MOVE_LEADER_TO_KEEP_SCORE}
|
||||
[/candidate_action]
|
||||
#enddef
|
||||
|
||||
#define AI_CA_COMBAT
|
||||
[candidate_action]
|
||||
id=combat
|
||||
engine=cpp
|
||||
name=testing_ai_default::combat_phase
|
||||
max_score={AI_CA_COMBAT_SCORE}
|
||||
score={AI_CA_COMBAT_SCORE}
|
||||
[/candidate_action]
|
||||
#enddef
|
||||
|
||||
#define AI_CA_HEALING
|
||||
[candidate_action]
|
||||
id=healing
|
||||
engine=cpp
|
||||
name=testing_ai_default::get_healing_phase
|
||||
max_score={AI_CA_HEALING_SCORE}
|
||||
score={AI_CA_HEALING_SCORE}
|
||||
[/candidate_action]
|
||||
#enddef
|
||||
|
||||
#define AI_CA_VILLAGES
|
||||
[candidate_action]
|
||||
id=villages
|
||||
engine=cpp
|
||||
name=testing_ai_default::get_villages_phase
|
||||
max_score={AI_CA_VILLAGES_SCORE}
|
||||
score={AI_CA_VILLAGES_SCORE}
|
||||
[/candidate_action]
|
||||
#enddef
|
||||
|
||||
#define AI_CA_RETREAT
|
||||
[candidate_action]
|
||||
id=retreat
|
||||
engine=cpp
|
||||
name=testing_ai_default::retreat_phase
|
||||
max_score={AI_CA_RETREAT_SCORE}
|
||||
score={AI_CA_RETREAT_SCORE}
|
||||
[/candidate_action]
|
||||
#enddef
|
||||
|
||||
#define AI_CA_MOVE_TO_TARGETS
|
||||
[candidate_action]
|
||||
id=move_to_targets
|
||||
engine=cpp
|
||||
name=testing_ai_default::testing_move_to_targets_phase
|
||||
max_score={AI_CA_MOVE_TO_TARGETS_SCORE}
|
||||
score={AI_CA_MOVE_TO_TARGETS_SCORE}
|
||||
[/candidate_action]
|
||||
#enddef
|
||||
|
||||
|
Loading…
Add table
Reference in a new issue