Merge pull request #3723 from mattsc/rca_ai_changes

Default AI changes
This commit is contained in:
mattsc 2018-12-02 08:42:42 -08:00 committed by GitHub
commit afb394c4b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
98 changed files with 116 additions and 381 deletions

View file

@ -38,6 +38,7 @@
{campaigns/}
[ais]
default_ai_algorithm=ai_default_rca
[default_config]
{ai/utils/default_config.cfg}
[/default_config]

View file

@ -7,6 +7,7 @@
[ai]
id=ai_default_rca
description=_"Multiplayer_AI^Default AI (RCA)" # wmllint: no spellcheck
mp_rank=1010
# RCA := Register Candidate Action; more info at http://forums.wesnoth.org/viewtopic.php?p=419625#p419625
[stage]
id=main_loop

View file

@ -7,6 +7,7 @@
[ai]
id=experimental_ai
description=_"Multiplayer_AI^Experimental AI" # wmllint: no spellcheck
mp_rank=1000
[stage]
id=main_loop

View file

@ -8,6 +8,7 @@
[ai]
id=ai_default_rca_alternate_recruiting
description=_"Multiplayer_AI^Dev AI: Default AI (RCA) with Alternate Recruiting" # wmllint: no spellcheck
mp_rank=100
# RCA := Register Candidate Action; more info at http://forums.wesnoth.org/viewtopic.php?p=419625#p419625
[stage]
id=main_loop

View file

@ -8,6 +8,7 @@
[ai]
id=formula_ai # id is needed to uniquely identify a MP AI, it is not needed in the scenario AI
description=_"Multiplayer_AI^Dev AI: Default + Experimental Recruitment (Formula AI)" # wmllint: no spellcheck
mp_rank=100
# this description is, again, needed for MP AI (it shows in AI list under this description
[stage]

View file

@ -7,6 +7,7 @@
[ai]
id=formula_ai_poisoning
description=_"Multiplayer_AI^Dev AI: Default + Poisoning (Formula AI)" # wmllint: no spellcheck
mp_rank=100
[stage]
id=main_loop
name=ai_default_rca::candidate_action_evaluation_loop

View file

@ -42,7 +42,6 @@
{DEFAULT_ASPECT_EMPTY advancements}
{DEFAULT_ASPECT_VALUE aggression 0.4}
{DEFAULT_ASPECT_VALUE attack_depth 5}
[aspect]
id=attacks
engine=cpp

View file

@ -78,7 +78,6 @@
facing=ne
[ai]
{ATTACK_DEPTH 1 3 5}
{AI_SIMPLE_DAY_ASPECT aggression -0.1}
{AI_SIMPLE_DAY_ASPECT simple_targeting yes}
{AI_SIMPLE_DAY_ASPECT grouping no}

View file

@ -70,10 +70,6 @@
canrecruit=yes
facing=se
[ai]
{ATTACK_DEPTH 4 5 6}
[/ai]
[/side]
# wmllint: validate-off

View file

@ -170,7 +170,6 @@
gold=400
[ai]
recruitment_pattern=scout,fighter,mixed fighter,archer
{ATTACK_DEPTH 1 3 5}
{AVOID_CHANTAL}
#ifdef HARD
{HIGH_PRIORITY_TARGETS}
@ -194,7 +193,6 @@
user_team_name=_"Orcs"
{GOLD 200 300 500}
[ai]
{ATTACK_DEPTH 1 3 5}
{AVOID_CHANTAL}
#ifdef HARD
{HIGH_PRIORITY_TARGETS}
@ -215,7 +213,6 @@
user_team_name=_"Orcs"
{GOLD 200 300 500}
[ai]
{ATTACK_DEPTH 1 3 5}
{AVOID_CHANTAL}
#ifdef HARD
{HIGH_PRIORITY_TARGETS}

View file

@ -112,9 +112,6 @@
recruit=Orcish Grunt,Wolf Rider,Orcish Archer,Troll Whelp
{GOLD 100 160 220}
{INCOME 8 16 20}
[ai]
{ATTACK_DEPTH 1 3 5}
[/ai]
{FLAG_VARIANT6 ragged}
[/side]

View file

@ -73,7 +73,6 @@
{GOLD 30 60 100}
[ai]
recruitment_pattern=scout,scout,fighter,fighter,archer
{ATTACK_DEPTH 1 3 5}
[/ai]
#make the AI a lot more aggressive at night

View file

@ -67,7 +67,6 @@
recruit=Vampire Bat,Naga Fighter
[ai]
recruitment_pattern=scout,fighter
{ATTACK_DEPTH 1 3 5}
[/ai]
team_name=orcs
user_team_name=_"Orcs"
@ -83,9 +82,6 @@
side=3
canrecruit=yes
{GOLD 90 150 210}
[ai]
{ATTACK_DEPTH 1 3 5}
[/ai]
team_name=orcs
user_team_name=_"Orcs"
{FLAG_VARIANT6 ragged}

View file

@ -71,7 +71,6 @@
aggression=1.0
caution=-1.0
simple_targeting=yes
{ATTACK_DEPTH 1 4 5}
[/ai]
{GOLD 20 50 100}
{INCOME 20 25 40}

View file

@ -132,7 +132,6 @@
recruit=Skeleton,Vampire Bat,Ghost,Dark Adept,Chocobone
[ai]
recruitment_pattern=scout,fighter,fighter,archer
{ATTACK_DEPTH 1 3 5}
[/ai]
{GOLD 80 100 110}
{FLAG_VARIANT undead}
@ -149,7 +148,6 @@
recruit=Skeleton,Skeleton Archer,Walking Corpse,Vampire Bat,Ghost,Dark Adept
[ai]
recruitment_pattern=scout,fighter,archer,fighter,archer,fighter
{ATTACK_DEPTH 1 3 5}
[/ai]
{GOLD 80 100 110}
{FLAG_VARIANT undead}

View file

@ -79,7 +79,6 @@
aggression=0.0
caution=1.0
grouping=defensive
{ATTACK_DEPTH 1 3 5}
[/ai]
[ai]
@ -118,7 +117,6 @@
[ai]
recruitment_pattern=fighter,fighter,archer
leader_value=10.0
{ATTACK_DEPTH 1 3 5}
[/ai]
[ai]

View file

@ -160,7 +160,6 @@
x="20-40"
y="16-24"
[/avoid]
{ATTACK_DEPTH 5 5 5}
[/ai]
[village]
@ -174,7 +173,6 @@
caution=1.0
aggression=0.3
passive_leader=yes
{ATTACK_DEPTH 1 3 5}
[/ai]
[ai]
time_of_day=dusk

View file

@ -98,7 +98,6 @@
[ai]
passive_leader=yes
#shes a smart leader and thinks deeply
{ATTACK_DEPTH 4 5 5}
[goal]
name=target
# While assassins target Konrad, all other units target Delfador

View file

@ -65,7 +65,6 @@
simple_targeting=yes
aggression=1.0
caution=-5.0
{ATTACK_DEPTH 1 3 5}
[/ai]
#enddef

View file

@ -91,7 +91,6 @@
canrecruit=yes
recruit=Cavalryman,Swordsman,Mage,Ogre,Duelist,Longbowman
[ai]
{ATTACK_DEPTH 1 3 5}
recruitment_pattern=scout,fighter,fighter,fighter,archer,mixed fighter
[/ai]
{GOLD 160 270 350}
@ -114,7 +113,6 @@
gold=0
{NO_INCOME}
[ai]
{ATTACK_DEPTH 1 3 5}
passive_leader=yes
[/ai]
[/side]

View file

@ -71,7 +71,6 @@
canrecruit=yes
recruit=Cavalryman,Swordsman,Spearman,Red Mage,Ogre,Duelist
[ai]
{ATTACK_DEPTH 4 5 5}
recruitment_pattern=scout,fighter,fighter,fighter,mixed fighter
aggression=1.0
caution=-5.0
@ -109,7 +108,6 @@
{GOLD 140 200 260}
[ai]
{ATTACK_DEPTH 4 5 5}
aggression=1.0
caution=-4.0
grouping=no

View file

@ -96,7 +96,6 @@
canrecruit=yes
recruit=Orcish Grunt,Wolf Rider,Orcish Archer,Troll Whelp,Ogre
[ai]
{ATTACK_DEPTH 4 5 5}
recruitment_pattern=scout,scout,fighter,fighter,archer
[/ai]
[ai]
@ -122,7 +121,6 @@
canrecruit=yes
recruit=Orcish Grunt,Wolf Rider,Orcish Archer,Troll
[ai]
{ATTACK_DEPTH 4 5 5}
recruitment_pattern=scout,scout,fighter,fighter,archer
[/ai]
[ai]

View file

@ -78,7 +78,6 @@
{GOLD 100 120 140}
{INCOME 14 18 22}
[ai]
{ATTACK_DEPTH 4 5 5}
aggression=1.0
grouping=no
caution=-5.0
@ -98,7 +97,6 @@
{GOLD 75 95 115}
{INCOME 12 14 18}
[ai]
{ATTACK_DEPTH 4 5 5}
aggression=1.0
grouping=no
caution=-5.0
@ -120,7 +118,6 @@
team_name=orcs
user_team_name=_"Orcs"
[ai]
{ATTACK_DEPTH 4 5 5}
aggression=1.0
grouping=no
caution=-5.0

View file

@ -67,7 +67,6 @@
no_leader=yes
hidden=yes
[ai]
{ATTACK_DEPTH 4 5 5}
aggression=1.0
[/ai]

View file

@ -84,9 +84,6 @@
canrecruit=yes
recruit=Orcish Warrior,Wolf Rider,Troll,Troll Whelp,Troll Rocklobber,Goblin Pillager,Orcish Assassin,Orcish Crossbowman
{GOLD 290 350 410}
[ai]
{ATTACK_DEPTH 4 5 5}
[/ai]
team_name=evil
user_team_name=_"Evil"
[/side]
@ -99,9 +96,6 @@
canrecruit=yes
recruit=Skeleton,Ghost,Revenant,Skeleton Archer,Bone Shooter
{GOLD 240 300 360}
[ai]
{ATTACK_DEPTH 4 5 5}
[/ai]
team_name=evil
user_team_name=_"Evil"
{FLAG_VARIANT undead}

View file

@ -127,9 +127,6 @@
#endif
{GOLD 100 160 220}
{INCOME 4 8 12}
[ai]
{ATTACK_DEPTH 4 5 5}
[/ai]
team_name=evil
user_team_name=_"Evil"
[/side]

View file

@ -302,7 +302,6 @@
controller=ai
[ai]
leader_value=10
{ATTACK_DEPTH 5 5 6}
[/ai]
recruit=Wolf Rider,Orcish Grunt,Orcish Archer
team_name=orcs
@ -318,7 +317,6 @@
canrecruit=yes
controller=ai
[ai]
{ATTACK_DEPTH 5 5 6}
leader_value=10
recruitment_pattern=fighter
[/ai]
@ -338,7 +336,6 @@
canrecruit=yes
controller=ai
[ai]
{ATTACK_DEPTH 5 5 6}
leader_value=10
recruitment_pattern=fighter,fighter,scout
[/ai]
@ -359,7 +356,6 @@
canrecruit=yes
controller=ai
[ai]
{ATTACK_DEPTH 5 5 6}
leader_value=10
recruitment_pattern=fighter,fighter,scout
[/ai]

View file

@ -91,9 +91,6 @@
side=2
canrecruit=yes
{GOLD 180 240 300}
[ai]
{ATTACK_DEPTH 5 5 6}
[/ai]
#ifdef HARD
recruit=Orcish Warrior,Orcish Assassin,Orcish Crossbowman,Goblin Knight
#else
@ -126,7 +123,6 @@
#endif
[ai]
{ATTACK_DEPTH 5 5 6}
#ifdef EASY
recruitment_pattern=fighter,fighter,archer,scout
#endif

View file

@ -76,9 +76,6 @@
canrecruit=yes
{GOLD 100 160 220}
{INCOME 16 24 32}
[ai]
{ATTACK_DEPTH 5 5 6}
[/ai]
team_name=orcs
user_team_name=_"Orcs"
#ifdef EASY

View file

@ -73,9 +73,6 @@
[/side]
#define SWAMP_DREAD_AI_PARAMS
[ai]
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=dusk
turns=8-100

View file

@ -144,7 +144,6 @@
no_leader=yes
controller=ai
[ai]
{ATTACK_DEPTH 5 5 6}
[avoid]
x=1-40,14-19,44-55,41-43
y=15-22,13-14,11-22,14-22
@ -161,7 +160,6 @@
controller=ai
hidden=yes
[ai]
{ATTACK_DEPTH 5 5 6}
[avoid]
x=1-55,1-44,1-41
y=1-11,12-13,14-22

View file

@ -88,7 +88,6 @@
recruit=Orcish Warrior,Goblin Knight,Wolf Rider,Orcish Grunt,Orcish Archer,Troll Whelp,Troll,Orcish Assassin
#endif
[ai]
{ATTACK_DEPTH 4 5 6}
passive_leader=yes
simple_targeting=yes
#ifndef HARD
@ -160,7 +159,6 @@
recruit=Cavalryman,Swordsman,Pikeman,Ogre,Dragoon,Red Mage,White Mage,Shock Trooper
#endif
[ai]
{ATTACK_DEPTH 4 5 6}
passive_leader=yes
simple_targeting=yes
#ifdef EASY

View file

@ -99,7 +99,6 @@
{GOLD 125 175 225}
{INCOME 5 10 15}
[ai]
{ATTACK_DEPTH 4 5 6}
passive_leader=yes
[/ai]
[/side]
@ -117,7 +116,6 @@
{GOLD 200 300 400}
{INCOME 10 15 20}
[ai]
{ATTACK_DEPTH 4 5 6}
passive_leader=yes
[/ai]
{FLAG_VARIANT undead}
@ -135,12 +133,11 @@
recruit=Wose,Elder Wose
{GOLD 150 100 70}
{INCOME 10 6 2}
[ai]
{ATTACK_DEPTH 6 5 4}
#ifdef EASY
[ai]
passive_leader=yes
#endif
[/ai]
#endif
[/side]
[side]
@ -155,7 +152,6 @@
recruit=Elvish Fighter,Elvish Archer,Elvish Shaman,Elvish Scout,Elvish Hero,Elvish Captain,Elvish Ranger,Elvish Marksman,Elvish Druid,Elvish Sorceress,Elvish Rider
gold=50
[ai]
{ATTACK_DEPTH 6 5 4}
[avoid]
[not]
x=41,42,43-44,45-46,47-48,49-50

View file

@ -183,7 +183,6 @@
recruit=Royal Guard
[ai]
recruitment_pattern=fighter
{ATTACK_DEPTH 5 5 6}
[/ai]
{GOLD 100 140 180}
team_name=evil
@ -202,9 +201,6 @@
controller=ai
recruit=Goblin Pillager,Goblin Knight,Orcish Warrior,Orcish Crossbowman
{GOLD 110 150 190}
[ai]
{ATTACK_DEPTH 5 5 6}
[/ai]
team_name=evil
user_team_name=_"Asheviere"
{FLAG_VARIANT6 ragged}
@ -221,9 +217,6 @@
controller=ai
recruit=Royal Guard,Pikeman,Master Bowman,Shock Trooper,Duelist
{GOLD 100 160 200}
[ai]
{ATTACK_DEPTH 5 5 6}
[/ai]
team_name=evil
user_team_name=_"Asheviere"
{FLAG_VARIANT loyalist}

View file

@ -124,7 +124,6 @@
recruit=Horseman,Knight,Bowman,Lancer
[ai]
recruitment_pattern=fighter,fighter,archer
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=morning,afternoon
@ -153,7 +152,6 @@
recruit=Horseman,Knight,Bowman,Lancer
[ai]
recruitment_pattern=fighter,fighter,archer
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=morning,afternoon
@ -182,7 +180,6 @@
recruit=Horseman,Knight,Bowman,Lancer
[ai]
recruitment_pattern=fighter,fighter,archer
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=morning,afternoon
@ -211,7 +208,6 @@
recruit=Knight,Longbowman
[ai]
recruitment_pattern=fighter,fighter,archer
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=morning,afternoon

View file

@ -115,7 +115,6 @@
recruit=Orcish Warrior,Goblin Knight,Goblin Pillager,Orcish Crossbowman,Orcish Assassin,Troll
gold=300
[ai]
{ATTACK_DEPTH 5 5 6}
recruitment_pattern=scout,fighter,mixed fighter,archer
[/ai]
team_name=evil
@ -130,9 +129,6 @@
side=3
canrecruit=yes
recruit=Horseman,Dragoon,Royal Guard,Longbowman,Heavy Infantryman
[ai]
{ATTACK_DEPTH 5 5 6}
[/ai]
team_name=evil
user_team_name=_"Asheviere"
{GOLD 175 300 400}
@ -148,7 +144,6 @@
recruit=Horseman,Dragoon,Cavalier,Cavalryman
[ai]
recruitment_pattern=scout,fighter
{ATTACK_DEPTH 5 5 6}
[/ai]
team_name=evil
user_team_name=_"Asheviere"
@ -164,9 +159,6 @@
canrecruit=yes
recruit=Royal Guard,Heavy Infantryman,Dragoon,Longbowman,Duelist,Halberdier
{GOLD 300 400 500}
[ai]
{ATTACK_DEPTH 5 6 6}
[/ai]
team_name=evil
user_team_name=_"Asheviere"
{FLAG_VARIANT loyalist}

View file

@ -216,7 +216,6 @@ This is the story of Kalenz, Landar, and of the Elves in the first days of the h
{INCOME 10 20 30}
[ai]
{AI_NO_SCOUTS}
{AI_SCALE_ATTACK_DEPTH_BY_DIFFICULTY}
{AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter,fighter,archer,fighter,fighter,mixed fighter,scout"}
{AI_SIMPLE_ALWAYS_ASPECT aggression 0.75}
{AI_SIMPLE_ALWAYS_ASPECT caution 0}
@ -246,7 +245,6 @@ This is the story of Kalenz, Landar, and of the Elves in the first days of the h
{AI_NO_SCOUTS}
{AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter,mixed fighter,archer,mixed fighter"}
{AI_SIMPLE_ALWAYS_ASPECT grouping no}
{AI_SCALE_ATTACK_DEPTH_BY_DIFFICULTY}
{AI_SIMPLE_ALWAYS_ASPECT aggression 0.75}
#ifdef EASY
@ -289,7 +287,6 @@ This is the story of Kalenz, Landar, and of the Elves in the first days of the h
{INCOME 10 30 50}
[ai]
{AI_NO_SCOUTS}
{AI_SCALE_ATTACK_DEPTH_BY_DIFFICULTY}
{AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "scout"}
{AI_SIMPLE_ALWAYS_ASPECT aggression 0.75}
{AI_SIMPLE_ALWAYS_ASPECT village_value 0}
@ -325,7 +322,6 @@ This is the story of Kalenz, Landar, and of the Elves in the first days of the h
{INCOME 10 30 50}
[ai]
{AI_NO_SCOUTS}
{AI_SCALE_ATTACK_DEPTH_BY_DIFFICULTY}
{AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter,scout,fighter,fighter,archer,scout,mixed fighter"}
{AI_SIMPLE_ALWAYS_ASPECT aggression 0.75}
{AI_SIMPLE_ALWAYS_ASPECT caution 0}

View file

@ -135,7 +135,6 @@ Chapter Four"
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,archer,mixed fighter
{ATTACK_DEPTH 4 5 6}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch

View file

@ -129,7 +129,6 @@
aggression=0.75
caution=0.0
grouping=no
attack_depth=5
[/ai]
{INCOME 4 8 12}
[/side]

View file

@ -175,7 +175,6 @@
simple_targeting=yes
aggression=1.0
caution=-5.0
attack_depth=5
leader_value=50.0
villages_per_scout=0
recruitment_pattern=scout

View file

@ -173,7 +173,6 @@
simple_targeting=yes
aggression=1.0
caution=-5.0
attack_depth=5
village_value=0.0
leader_value=50.0
villages_per_scout=0

View file

@ -80,7 +80,6 @@
[ai]
grouping=offensive
attack_depth=5
[/ai]
[/side]

View file

@ -77,7 +77,6 @@
leader_value=3.0
caution=0.3
grouping=offensive
{ATTACK_DEPTH 3 4 5}
[/ai]
[/side]
@ -117,7 +116,6 @@
#else
recruitment_pattern=scout,fighter,fighter,archer,mixed fighter
#endif
{ATTACK_DEPTH 3 4 5}
#ifdef HARD
[goal]
name=target

View file

@ -77,7 +77,6 @@
#endif
grouping=defensive
{QUANTITY aggression 0.3 0.4 0.5}
{ATTACK_DEPTH 3 4 5}
[/ai]
[/side]

View file

@ -64,7 +64,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,archer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -110,7 +109,6 @@
#ifdef HARD
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
#endif
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -139,7 +137,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,archer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch

View file

@ -57,7 +57,6 @@
facing=s
[ai]
{ATTACK_DEPTH 1 3 5}
passive_leader=yes
[avoid]
x,y=$magehut.x,$magehut.y

View file

@ -77,7 +77,6 @@
[/unit]
[ai]
{ATTACK_DEPTH 1 3 5}
passive_leader=yes
recruitment_pattern=mixed fighter
[/ai]
@ -100,7 +99,6 @@
facing=nw
[ai]
{ATTACK_DEPTH 3 4 5}
passive_leader=no
[/ai]
[/side]

View file

@ -58,7 +58,6 @@
grouping=defensive
caution=2.0
recruitment_pattern=fighter,fighter,mixed fighter
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]
# wmllint: validate-on
@ -97,8 +96,6 @@
#else
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
#endif
{ATTACK_DEPTH 4 5 5}
[leader_goal]
x,y=44,15 # wants to take the Kal Karthans' keep.
[/leader_goal]
@ -139,7 +136,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,archer
{ATTACK_DEPTH 4 5 5}
[leader_goal]
x,y=44,15 # wants to take the Kal Karthans' keep.
@ -181,7 +177,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,archer
{ATTACK_DEPTH 4 5 5}
[leader_goal]
x,y=44,15 # wants to take the Kal Karthans' keep.

View file

@ -94,7 +94,6 @@
passive_leader=yes
grouping=defensive
recruitment_pattern=fighter,fighter,mixed fighter
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]
# wmllint: validate-on

View file

@ -116,7 +116,6 @@
[ai]
passive_leader=yes
grouping=defensive
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]
# wmllint: validate-on

View file

@ -104,7 +104,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=fighter,fighter,archer,scout
{ATTACK_DEPTH 2 3 4}
[/ai]
{FLAG_VARIANT6 ragged}
[/side]

View file

@ -53,7 +53,6 @@
caution=0.5
passive_leader=yes
grouping=defensive
{ATTACK_DEPTH 3 4 5}
[/ai]
{GOLD 90 130 170}
team_name=wesfolk

View file

@ -44,7 +44,6 @@
#{NO_SCOUTS}
recruitment_pattern=scout,scout,fighter,fighter,mixed fighter,archer
passive_leader=yes
{ATTACK_DEPTH 3 4 5}
[/ai]
[ai]
time_of_day=first_watch,second_watch
@ -69,7 +68,6 @@
#{NO_SCOUTS}
recruitment_pattern=scout,scout,fighter,fighter,mixed fighter,archer
passive_leader=yes
{ATTACK_DEPTH 3 4 5}
[/ai]
[ai]
time_of_day=first_watch,second_watch

View file

@ -55,7 +55,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,fighter,archer
{ATTACK_DEPTH 3 4 5}
[/ai]
{GOLD 80 120 160}
team_name=cult
@ -74,7 +73,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,fighter,archer
{ATTACK_DEPTH 3 4 5}
[/ai]
#ifdef EASY
recruit=Dark Adept, Ghoul, Ghost, Skeleton, Skeleton Archer, Vampire Bat, Walking Corpse, Mudcrawler
@ -101,7 +99,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,fighter,archer
{ATTACK_DEPTH 3 4 5}
[/ai]
#ifdef EASY

View file

@ -53,7 +53,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 3 4 5}
[/ai]
{GOLD 70 110 160}
user_team_name=_"Orcs"
@ -71,7 +70,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 3 4 5}
[/ai]
[ai]
time_of_day=first_watch,second_watch
@ -105,7 +103,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 3 4 5}
[/ai]
[ai]
time_of_day=first_watch,second_watch

View file

@ -45,7 +45,6 @@
#else
recruitment_pattern=scout,mixed fighter,archer
#endif
{ATTACK_DEPTH 4 5 5}
[/ai]
#ifdef EASY
recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Goblin Pillager
@ -76,7 +75,6 @@
#else
recruitment_pattern=scout,mixed fighter,archer
#endif
{ATTACK_DEPTH 4 5 5}
[/ai]
#ifdef EASY
recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Goblin Pillager

View file

@ -52,7 +52,6 @@
aggression=1.0
recruitment_pattern=fighter,archer
{NO_SCOUTS}
{ATTACK_DEPTH 4 5 5}
[/ai]
{FLAG_VARIANT undead}
[/side]

View file

@ -86,7 +86,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -121,7 +120,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -158,7 +156,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch

View file

@ -54,7 +54,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=first_watch,second_watch
@ -91,7 +90,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=first_watch,second_watch
@ -123,7 +121,6 @@
[ai]
aggression=1.0
recruitment_pattern=scout,fighter,fighter,archer
{ATTACK_DEPTH 4 5 5}
{NO_SCOUTS}
[/ai]
{PETRIFIED}

View file

@ -49,7 +49,6 @@
{NO_SCOUTS}
recruitment_pattern=mixed fighter,fighter,scout,fighter
aggression=0.75
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]
@ -69,7 +68,6 @@
{NO_SCOUTS}
recruitment_pattern=mixed fighter,fighter,scout,fighter
aggression=0.75
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]

View file

@ -78,7 +78,6 @@
[ai]
#{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -112,7 +111,6 @@
[ai]
#{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -136,7 +134,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=fighter,fighter,scout
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch

View file

@ -59,7 +59,6 @@
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,archer,fighter
aggression=0.75
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]
@ -88,7 +87,6 @@
recruitment_pattern=scout,fighter,fighter,archer,fighter,mixed fighter
#endif
aggression=0.75
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]
@ -113,7 +111,6 @@
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,archer,fighter
aggression=0.75
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]

View file

@ -58,7 +58,6 @@
#else
recruitment_pattern=scout,fighter,fighter,fighter
#endif
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]
@ -85,7 +84,6 @@
#else
recruitment_pattern=scout,fighter,fighter,fighter
#endif
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]
@ -112,7 +110,6 @@
#else
recruitment_pattern=scout,fighter,fighter,fighter
#endif
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]

View file

@ -50,7 +50,6 @@
[ai]
#{NO_SCOUTS}
recruitment_pattern=scout,archer,scout,scout,healer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
[goal]
@ -84,7 +83,6 @@
[ai]
#{NO_SCOUTS}
recruitment_pattern=scout,archer,scout,scout,healer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
[goal]
@ -119,7 +117,6 @@
[ai]
#{NO_SCOUTS}
recruitment_pattern=scout,archer,scout,scout,healer
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
[goal]
@ -154,7 +151,6 @@
[ai]
#{NO_SCOUTS}
recruitment_pattern=scout,archer,scout,scout,healer
{ATTACK_DEPTH 4 5 5}
[goal]
name=target
[criteria]

View file

@ -49,7 +49,6 @@
#{NO_SCOUTS}
recruitment_pattern=scout,archer,fighter,archer,fighter,scout,healer
passive_leader=yes
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]
@ -74,7 +73,6 @@
#{NO_SCOUTS}
recruitment_pattern=scout,archer,fighter,archer,fighter,scout,healer
passive_leader=yes
{ATTACK_DEPTH 4 5 5}
[/ai]
[/side]

View file

@ -46,7 +46,6 @@
{NO_SCOUTS}
recruitment_pattern=fighter,fighter,mixed fighter
aggression=0.75
{ATTACK_DEPTH 3 5 5}
[/ai]
[/side]
@ -67,7 +66,6 @@
{NO_SCOUTS}
recruitment_pattern=fighter,fighter,mixed fighter
aggression=0.75
{ATTACK_DEPTH 3 5 5}
[/ai]
[/side]
@ -88,7 +86,6 @@
{NO_SCOUTS}
recruitment_pattern=fighter,fighter,mixed fighter
aggression=0.75
{ATTACK_DEPTH 3 5 5}
[/ai]
[/side]
@ -109,7 +106,6 @@
{NO_SCOUTS}
recruitment_pattern=fighter,fighter,mixed fighter
aggression=0.75
{ATTACK_DEPTH 3 5 5}
[/ai]
[/side]

View file

@ -51,7 +51,6 @@
{NO_SCOUTS}
aggression=0.40
recruitment_pattern=scout,scout,fighter
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -91,7 +90,6 @@
{NO_SCOUTS}
aggression=0.40
recruitment_pattern=scout,scout,fighter
{ATTACK_DEPTH 4 5 5}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch

View file

@ -56,7 +56,6 @@
[ai]
#{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -93,7 +92,6 @@
[ai]
#{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -135,7 +133,6 @@
recruitment_pattern=fighter,fighter,mixed fighter
#endif
grouping=no
{ATTACK_DEPTH 5 5 6}
[/ai]
{INCOME 2 4 8}

View file

@ -60,7 +60,6 @@
passive_leader=yes
recruitment_pattern=scout,fighter,archer
aggression=0.4
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -94,7 +93,6 @@
[ai]
#{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -131,7 +129,6 @@
[ai]
#{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch

View file

@ -54,7 +54,6 @@
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,archer,scout,fighter,fighter,archer
passive_leader=yes
{ATTACK_DEPTH 5 6 6}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -89,7 +88,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=fighter,fighter,scout
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -127,7 +125,6 @@
#{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,archer,scout,fighter,fighter,archer,mixed fighter
grouping=defensive
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -164,7 +161,6 @@
#{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,archer,scout,fighter,fighter,archer,mixed fighter
grouping=defensive
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch
@ -201,7 +197,6 @@
[ai]
{NO_SCOUTS}
recruitment_pattern=scout,fighter,fighter,archer,scout,fighter,fighter,archer,mixed fighter
{ATTACK_DEPTH 5 5 6}
[/ai]
[ai]
time_of_day=dusk,first_watch,second_watch

View file

@ -75,7 +75,6 @@
recruit=Footpad,Thief,Poacher,Thug
#endif
[ai]
{ATTACK_DEPTH 1 2 3}
#ifdef EASY
recruitment_pattern=fighter
#endif

View file

@ -68,7 +68,6 @@
canrecruit=yes
[ai]
{QUANTITY aggression 0.55 0.75 0.85}
{ATTACK_DEPTH 3 4 5}
village_value=0.1
villages_per_scout=10
[goal]

View file

@ -86,7 +86,6 @@
recruitment_pattern=fighter,archer
#endif
{QUANTITY aggression 0.5 0.6 0.7}
{ATTACK_DEPTH 3 4 5}
[goal]
name=target
[criteria]

View file

@ -71,7 +71,6 @@
[ai]
recruitment_pattern=fighter,scout,scout
{QUANTITY aggression 0.3 0.4 0.5}
{ATTACK_DEPTH 3 4 5}
# In case a unit is there when they sitch to side 1 it would trigger
# the lich sighted event. Quick Footpads can see up to 9 hexes ahead.
[avoid]
@ -114,7 +113,6 @@
[ai]
recruitment_pattern=fighter
{NO_SCOUTS}
{ATTACK_DEPTH 1 2 3}
[/ai]
#ifdef EASY
@ -162,7 +160,6 @@
recruitment_pattern=fighter,archer
{QUANTITY aggression 0.2 0.4 0.6}
{NO_SCOUTS}
{ATTACK_DEPTH 3 4 5}
[/ai]
# On hard, the fake M'Brin is a normal lich, on other difficulties he's

View file

@ -77,7 +77,6 @@
[ai]
aggression=1.0
grouping=no
attack_depth=1
village_value=0
[goal]
name=target

View file

@ -110,7 +110,6 @@
recruitment_pattern=scout,fighter,fighter,mixed fighter
#endif
{QUANTITY aggression 0.3 0.4 0.5}
{ATTACK_DEPTH 3 4 5}
[/ai]
#ifdef EASY
recruit=Thug

View file

@ -375,19 +375,7 @@
#enddef
#define AI_SCALE_ATTACK_DEPTH_BY_DIFFICULTY
# change attack depth depending on difficulty
#ifdef EASY
{AI_SIMPLE_ALWAYS_ASPECT attack_depth 3}
#endif
#ifdef NORMAL
{AI_SIMPLE_ALWAYS_ASPECT attack_depth 4}
#endif
#ifdef HARD
{AI_SIMPLE_ALWAYS_ASPECT attack_depth 5}
#endif
#deprecated 3 1.17 The attack_depth aspect has no effect on the AI any more.
#enddef
############################################################

View file

@ -122,14 +122,11 @@
#enddef
#define ATTACK_DEPTH EASY_VALUE NORMAL_VALUE HARD_VALUE
# Macro to define AI attack depth for different difficulty levels
# (set it to 1-6)
{QUANTITY attack_depth {EASY_VALUE} {NORMAL_VALUE} {HARD_VALUE}}
#deprecated 3 1.17 The attack_depth aspect has no effect on the AI any more.
#enddef
#define ATTACK_DEPTH4 EASY_VALUE NORMAL_VALUE HARD_VALUE NIGHTMARE_VALUE
# Four-difficulty version of ATTACK_DEPTH
{QUANTITY4 attack_depth {EASY_VALUE} {NORMAL_VALUE} {HARD_VALUE} {NIGHTMARE_VALUE}}
#deprecated 3 1.17 The attack_depth aspect has no effect on the AI any more.
#enddef
#define NO_SCOUTS

View file

@ -40,7 +40,6 @@ Note: You need to use the default map settings for the scenario to work right."
caution=0.99
grouping=defensive
village_value=12
attack_depth=1
[/ai]
[/side]

View file

@ -68,7 +68,7 @@
super="{BASE}~bool"
[/case]
[case]
value=villages_per_scout,attack_depth,recruitment_randomness
value=villages_per_scout,recruitment_randomness
super="{BASE}~int"
[/case]
[case]

View file

@ -53,7 +53,6 @@
{AI_ASPECT_KEY support_villages s_bool}
{AI_ASPECT_KEY village_value s_real}
{AI_ASPECT_KEY villages_per_scout s_int}
{AI_ASPECT_KEY attack_depth s_int}
{AI_ASPECT_KEY advancements string_list}
{AI_ASPECT_KEY recruitment_more string_list}
{AI_ASPECT_KEY recruitment_pattern string_list}

View file

@ -162,7 +162,6 @@
{AI_MODIFY_MATCH_ASPECT simple_targeting bool}
{AI_MODIFY_MATCH_ASPECT support_villages bool}
{AI_MODIFY_MATCH_ASPECT villages_per_scout int}
{AI_MODIFY_MATCH_ASPECT attack_depth int}
{AI_MODIFY_MATCH_ASPECT recruitment_randomness int}
{AI_MODIFY_MATCH_ASPECT grouping grouping}
{AI_MODIFY_MATCH_ASPECT advancements string}

View file

@ -1,48 +1,48 @@
{AI_ASPECT_UNIT_TEST test_basic_simplified_aspect attack_depth
{SPLIT 3,5,5,3,7,7,5,3,5,5,7,7 ,}
{AI_ASPECT_UNIT_TEST test_basic_simplified_aspect leader_value
{SPLIT 9,3,3,9,7,7,3,9,3,3,7,7 ,}
(
[ai]
time_of_day=first_watch,second_watch
attack_depth=7
leader_value=7
[/ai]
[ai]
turns=1,4,8
attack_depth=3
leader_value=9
[/ai]
) ()}
{AI_ASPECT_UNIT_TEST test_basic_abbreviated_aspect attack_depth
{SPLIT 7,7,7,7,7,7,5,5,5,5,9,9 ,}
{AI_ASPECT_UNIT_TEST test_basic_abbreviated_aspect leader_value
{SPLIT 7,7,7,7,7,7,3,3,3,3,9,9 ,}
(
[ai]
time_of_day=first_watch,second_watch
attack_depth=9
[attack_depth]
leader_value=9
[leader_value]
turns=1-6
value=7
[/attack_depth]
[/leader_value]
[/ai]
) ()}
{AI_ASPECT_UNIT_TEST test_basic_standard_aspect attack_depth
{AI_ASPECT_UNIT_TEST test_basic_standard_aspect leader_value
{SPLIT 7,7,7,7,7,7,7,7,7,7,7,7 ,
} (
[ai]
[aspect]
id=attack_depth
id=leader_value
name=standard_aspect
value=7
[/aspect]
[/ai]
) ()}
{AI_ASPECT_UNIT_TEST test_basic_composite_aspect attack_depth
{SPLIT 5,5,14,14,14,14,5,5,5,5,12,12 ,}
{AI_ASPECT_UNIT_TEST test_basic_composite_aspect leader_value
{SPLIT 3,3,14,14,14,14,3,3,3,3,12,12 ,}
(
[ai]
[aspect]
id=attack_depth
id=leader_value
[facet]
time_of_day=first_watch,second_watch
value=12
@ -55,24 +55,24 @@
[/ai]
) ()}
{AI_ASPECT_UNIT_TEST test_basic_lua_aspect attack_depth
{AI_ASPECT_UNIT_TEST test_basic_lua_aspect leader_value
{SPLIT 2,4,6,8,10,12,14,16,18,20,22,24 ,}
(
[ai]
[aspect]
id=attack_depth
id=leader_value
engine=lua
code=<<return wesnoth.current.turn * 2>>
[/aspect]
[/ai]
) ()}
{AI_ASPECT_UNIT_TEST test_basic_composite_facet attack_depth
{SPLIT 5,5,5,5,5,5,7,7,7,14,14,14 ,}
{AI_ASPECT_UNIT_TEST test_basic_composite_facet leader_value
{SPLIT 3,3,3,3,3,3,7,7,7,14,14,14 ,}
(
[ai]
[aspect]
id=attack_depth
id=leader_value
[facet]
name=composite_aspect
turns=7-12
@ -88,12 +88,12 @@
[/ai]
) ()}
{AI_ASPECT_UNIT_TEST test_basic_lua_facet attack_depth
{AI_ASPECT_UNIT_TEST test_basic_lua_facet leader_value
{SPLIT 2,7,7,2,7,7,14,7,7,5,7,7 ,}
(
[ai]
[aspect]
id=attack_depth
id=leader_value
[facet]
engine=lua
time_of_day=dusk
@ -111,33 +111,33 @@
[/ai]
) ()}
{AI_ASPECT_UNIT_TEST test_basic_composite_default_facet attack_depth
{SPLIT 10,5,5,5,5,5,10,5,5,5,5,5 ,}
{AI_ASPECT_UNIT_TEST test_basic_composite_default_facet leader_value
{SPLIT 10,3,3,3,3,3,10,3,3,3,3,3 ,}
(
[ai]
[aspect]
id=attack_depth
id=leader_value
[default]
name=composite_aspect
[facet]
id=my_composite_default_attack_depth
id=my_composite_default_leader_value
time_of_day=dawn
value=10
[/facet]
[default]
value=5
value=3
[/default]
[/default]
[/aspect]
[/ai]
) ()}
{AI_ASPECT_UNIT_TEST test_basic_lua_default_facet attack_depth
{AI_ASPECT_UNIT_TEST test_basic_lua_default_facet leader_value
{SPLIT 1,2,3,4,5,6,7,8,9,10,11,12 ,}
(
[ai]
[aspect]
id=attack_depth
id=leader_value
[default]
engine=lua
code=<<return wesnoth.current.turn>>

View file

@ -1,38 +1,38 @@
{AI_ASPECT_UNIT_TEST test_modify_ai_delete_facet attack_depth
{SPLIT 7,7,7,7,7,7,5,5,5,5,5,5 ,}
{AI_ASPECT_UNIT_TEST test_modify_ai_delete_facet leader_value
{SPLIT 7,7,7,7,7,7,3,3,3,3,3,3 ,}
(
[ai]
[attack_depth]
id=custom_depth
[leader_value]
id=custom_value
value=7
[/attack_depth]
[/leader_value]
[/ai]
) (
[event]
name=turn 6 end
[modify_ai]
action=delete
path=aspect[attack_depth].facet[custom_depth]
path=aspect[leader_value].facet[custom_value]
[/modify_ai]
[/event]
)}
{AI_ASPECT_UNIT_TEST test_modify_ai_change_facet attack_depth
{AI_ASPECT_UNIT_TEST test_modify_ai_change_facet leader_value
{SPLIT 7,7,7,7,7,7,8,8,8,8,8,8 ,}
(
[ai]
[attack_depth]
id=custom_depth
[leader_value]
id=custom_value
value=7
[/attack_depth]
[/leader_value]
[/ai]
) (
[event]
name=turn 6 end
[modify_ai]
action=change
path=aspect[attack_depth].facet[custom_depth]
path=aspect[leader_value].facet[custom_value]
[facet]
value=8
[/facet]
@ -40,23 +40,23 @@
[/event]
)}
{AI_ASPECT_UNIT_TEST test_modify_ai_replace_facet attack_depth
{SPLIT 7,7,7,7,8,8,8,8,5,5,5,5 ,}
{AI_ASPECT_UNIT_TEST test_modify_ai_replace_facet leader_value
{SPLIT 7,7,7,7,8,8,8,8,3,3,3,3 ,}
(
[ai]
[attack_depth]
id=custom_depth
[leader_value]
id=custom_value
value=7
[/attack_depth]
[/leader_value]
[/ai]
) (
[event]
name=turn 4 end
[modify_ai]
action=add
path=aspect[attack_depth].facet[]
path=aspect[leader_value].facet[]
[facet]
id=custom_depth
id=custom_value
value=8
[/facet]
[/modify_ai]
@ -65,28 +65,28 @@
name=turn 8 end
[modify_ai]
action=delete
path=aspect[attack_depth].facet[custom_depth]
path=aspect[leader_value].facet[custom_value]
[/modify_ai]
[/event]
)}
{AI_ASPECT_UNIT_TEST test_modify_ai_add_facet attack_depth
{AI_ASPECT_UNIT_TEST test_modify_ai_add_facet leader_value
{SPLIT 7,7,7,7,8,8,8,8,7,7,7,7 ,}
(
[ai]
[attack_depth]
id=custom_depth
[leader_value]
id=custom_value
value=7
[/attack_depth]
[/leader_value]
[/ai]
) (
[event]
name=turn 4 end
[modify_ai]
action=add
path=aspect[attack_depth].facet[]
path=aspect[leader_value].facet[]
[facet]
id=custom_depth2
id=custom_value2
value=8
[/facet]
[/modify_ai]
@ -95,27 +95,27 @@
name=turn 8 end
[modify_ai]
action=delete
path=aspect[attack_depth].facet[custom_depth2]
path=aspect[leader_value].facet[custom_value2]
[/modify_ai]
[/event]
)}
{AI_ASPECT_UNIT_TEST test_modify_ai_change_default_facet attack_depth
{SPLIT 5,5,5,5,7,7,7,7,8,8,8,8 ,}
{AI_ASPECT_UNIT_TEST test_modify_ai_change_default_facet leader_value
{SPLIT 3,3,3,3,7,7,7,7,8,8,8,8 ,}
(
[ai]
[attack_depth]
[leader_value]
turns=5-8
id=custom_depth
id=custom_value
value=7
[/attack_depth]
[/leader_value]
[/ai]
) (
[event]
name=turn 6 end
[modify_ai]
action=change
path=aspect[attack_depth].facet[default_facet]
path=aspect[leader_value].facet[default_facet]
[facet]
value=8
[/facet]
@ -123,23 +123,23 @@
[/event]
)}
{AI_ASPECT_UNIT_TEST test_modify_ai_nested_facets attack_depth
{SPLIT 5,7,7,14,14,14,12,7,7,14,14,5 ,}
{AI_ASPECT_UNIT_TEST test_modify_ai_nested_facets leader_value
{SPLIT 3,7,7,14,14,14,12,7,7,14,14,3 ,}
(
[ai]
[aspect]
id=attack_depth
id=leader_value
[facet]
id=composite_depth
id=composite_value
name=composite_aspect
turns=2-11
[facet]
id=night_depth
id=night_value
time_of_day=dusk,first_watch,second_watch
value=14
[/facet]
[default]
id=my_default_attack_depth
id=my_default_leader_value
value=7
[/default]
[/facet]
@ -150,9 +150,9 @@
name=turn 4 end
[modify_ai]
action=add
path=aspect[attack_depth].facet[composite_depth].facet[]
path=aspect[leader_value].facet[composite_value].facet[]
[facet]
id=twilight_depth
id=twilight_value
time_of_day=dawn,dusk
value=12
[/facet]
@ -162,17 +162,17 @@
name=turn 8 end
[modify_ai]
action=delete
path=aspect[attack_depth].facet[composite_depth].facet[twilight_depth]
path=aspect[leader_value].facet[composite_value].facet[twilight_value]
[/modify_ai]
[/event]
)}
{AI_ASPECT_UNIT_TEST test_modify_ai_composite_default_facets attack_depth
{SPLIT 10,5,5,5,5,5,5,5,12,12,12,12 ,}
{AI_ASPECT_UNIT_TEST test_modify_ai_composite_default_facets leader_value
{SPLIT 10,3,3,3,3,3,3,3,12,12,12,12 ,}
(
[ai]
[aspect]
id=attack_depth
id=leader_value
[default]
name=composite_aspect
[facet]
@ -181,7 +181,7 @@
value=10
[/facet]
[default]
value=5
value=3
[/default]
[/default]
[/aspect]
@ -191,14 +191,14 @@
name=turn 4 end
[modify_ai]
action=delete
path=aspect[attack_depth].facet[default_facet].facet[dawn_default]
path=aspect[leader_value].facet[default_facet].facet[dawn_default]
[/modify_ai]
[/event]
[event]
name=turn 8 end
[modify_ai]
action=add
path=aspect[attack_depth].facet[default_facet].facet[]
path=aspect[leader_value].facet[default_facet].facet[]
[facet]
value=12
[/facet]
@ -206,14 +206,14 @@
[/event]
)}
{AI_ASPECT_UNIT_TEST test_modify_ai_change_aspect attack_depth
{SPLIT 5,5,5,5,5,5,3,4,4,5,5,6 ,}
{AI_ASPECT_UNIT_TEST test_modify_ai_change_aspect leader_value
{SPLIT 3,3,3,3,3,3,3,4,4,5,5,6 ,}
() (
[event]
name=turn 6 end
[modify_ai]
action=change
path=aspect[attack_depth]
path=aspect[leader_value]
[aspect]
engine=lua
code=<<return math.floor(wesnoth.current.turn / 2)>>

View file

@ -49,6 +49,10 @@ void configuration::init(const config &game_config)
ERR_AI_CONFIGURATION << "Missing AI [default_config]. Therefore, default_config_ set to empty." << std::endl;
default_config_.clear();
}
default_ai_algorithm_ = ais["default_ai_algorithm"].str();
if (default_ai_algorithm_.empty()) {
ERR_AI_CONFIGURATION << "Missing default_ai_algorithm. This will result in no AI being loaded by default." << std::endl;
}
for (const config &ai_configuration : ais.child_range("ai")) {
@ -65,6 +69,7 @@ void configuration::init(const config &game_config)
description desc;
desc.id=id;
desc.mp_rank=ai_configuration["mp_rank"].to_int(0);
desc.text = ai_configuration["description"].t_str();
desc.cfg=ai_configuration;
@ -91,6 +96,7 @@ void extract_ai_configurations(std::map<std::string, description> &storage, cons
description desc;
desc.id=id;
desc.text = ai_configuration["description"].t_str();
desc.mp_rank = ai_configuration["mp_rank"].to_int(0);
desc.cfg=ai_configuration;
storage.emplace(id, desc);
@ -139,6 +145,13 @@ std::vector<description*> configuration::get_available_ais()
add_if_not_hidden(&m_config.second);
}
// Sort by mp_rank. For same mp_rank, keep alphabetical order.
std::stable_sort(ais_list.begin(), ais_list.end(),
[](const description* a, const description* b) {
return a->mp_rank > b->mp_rank;
}
);
return ais_list;
}
@ -166,6 +179,7 @@ configuration::description_map configuration::ai_configurations_ = configuration
configuration::description_map configuration::era_ai_configurations_ = configuration::description_map();
configuration::description_map configuration::mod_ai_configurations_ = configuration::description_map();
config configuration::default_config_ = config();
std::string configuration::default_ai_algorithm_;
bool configuration::get_side_config_from_file(const std::string& file, config& cfg ){
try {
@ -359,7 +373,7 @@ void configuration::expand_simplified_aspects(side_number side, config &cfg) {
}
}
if (algorithm.empty() && !parsed_config.has_child("stage")) {
base_config = get_ai_config_for("ai_default_rca");
base_config = get_ai_config_for(default_ai_algorithm_);
}
for (const config::any_child &child : parsed_config.all_children_range()) {
base_config.add_child(child.key, child.cfg);

View file

@ -46,12 +46,14 @@ public:
description()
: text()
, id()
, mp_rank()
, cfg()
{
}
t_string text;
std::string id;
int mp_rank;
config cfg;
};
@ -120,6 +122,7 @@ private:
static description_map era_ai_configurations_;
static description_map mod_ai_configurations_;
static config default_config_;
static std::string default_ai_algorithm_;
};

View file

@ -40,7 +40,6 @@
#include "log.hpp" // for LOG_STREAM, logger, etc
#include "map/map.hpp" // for gamemap
#include "pathfind/pathfind.hpp" // for paths::dest_vect, paths, etc
#include "recall_list_manager.hpp" // for recall_list_manager
#include "resources.hpp" // for units, gameboard, etc
#include "serialization/string_utils.hpp" // for split, etc
#include "team.hpp" // for team
@ -184,7 +183,6 @@ readonly_context_impl::readonly_context_impl(side_context &context, const config
known_aspects_(),
advancements_(),
aggression_(),
attack_depth_(),
aspects_(),
attacks_(),
avoid_(),
@ -229,7 +227,6 @@ readonly_context_impl::readonly_context_impl(side_context &context, const config
add_known_aspect("advancements", advancements_);
add_known_aspect("aggression",aggression_);
add_known_aspect("attack_depth",attack_depth_);
add_known_aspect("attacks",attacks_);
add_known_aspect("avoid",avoid_);
add_known_aspect("caution",caution_);
@ -542,15 +539,6 @@ double readonly_context_impl::get_aggression() const
}
int readonly_context_impl::get_attack_depth() const
{
if (attack_depth_) {
return std::max<int>(1,attack_depth_->get()); ///@todo 1.9: add validators, such as minmax filters to aspects
}
return 1;
}
const aspect_map& readonly_context_impl::get_aspects() const
{
return aspects_;
@ -772,13 +760,6 @@ const moves_map& readonly_context_impl::get_possible_moves() const
}
const std::vector<unit_ptr>& readonly_context_impl::get_recall_list() const
{
///@todo 1.9: check for (level_["disallow_recall"]))
return current_team().recall_list().recall_list_; //TODO: Refactor ai so that friend of ai context is not required of recall_list_manager at this line
}
double readonly_context_impl::get_recruitment_diversity() const
{
if (recruitment_diversity_) {

View file

@ -214,9 +214,6 @@ public:
virtual double get_aggression() const = 0;
virtual int get_attack_depth() const = 0;
virtual const aspect_map& get_aspects() const = 0;
@ -294,9 +291,6 @@ public:
virtual const moves_map& get_possible_moves() const = 0;
virtual const std::vector<unit_ptr>& get_recall_list() const = 0;
virtual double get_recruitment_diversity() const = 0;
@ -635,12 +629,6 @@ public:
}
virtual int get_attack_depth() const override
{
return target_->get_attack_depth();
}
virtual const aspect_map& get_aspects() const override
{
return target_->get_aspects();
@ -800,12 +788,6 @@ public:
}
virtual const std::vector<unit_ptr>& get_recall_list() const override
{
return target_->get_recall_list();
}
virtual double get_recruitment_diversity() const override
{
return target_->get_recruitment_diversity();
@ -1315,9 +1297,6 @@ public:
virtual double get_aggression() const override;
virtual int get_attack_depth() const override;
virtual const aspect_map& get_aspects() const override;
@ -1387,9 +1366,6 @@ public:
virtual const moves_map& get_possible_moves() const override;
virtual const std::vector<unit_ptr>& get_recall_list() const override;
virtual double get_recruitment_diversity() const override;
@ -1502,7 +1478,6 @@ private:
typesafe_aspect_ptr<unit_advancements_aspect> advancements_;
typesafe_aspect_ptr<double> aggression_;
typesafe_aspect_ptr<int> attack_depth_;
aspect_map aspects_;
typesafe_aspect_ptr<attacks_vector> attacks_;
mutable typesafe_aspect_ptr<terrain_filter> avoid_;

View file

@ -140,9 +140,8 @@ void aspect_attacks_base::do_attack_analysis(
// This function is called fairly frequently, so interact with the user here.
ai::manager::get_singleton().raise_user_interact();
const int default_attack_depth = 5;
if(cur_analysis.movements.size() >= std::size_t(default_attack_depth)) {
//std::cerr << "ANALYSIS " << cur_analysis.movements.size() << " >= " << get_attack_depth() << "\n";
const int max_attack_depth = 5;
if(cur_analysis.movements.size() >= std::size_t(max_attack_depth)) {
return;
}
const gamemap &map_ = resources::gameboard->map();

View file

@ -292,10 +292,6 @@ variant formula_ai::get_value(const std::string& key) const
{
return variant(get_aggression()*1000,variant::DECIMAL_VARIANT);
} else if(key == "attack_depth")
{
return variant(get_attack_depth());
} else if(key == "avoid")
{
std::set<map_location> av_locs;

View file

@ -377,14 +377,6 @@ static int cfun_ai_get_aggression(lua_State *L)
return 1;
}
static int cfun_ai_get_attack_depth(lua_State *L)
{
DEPRECATED_ASPECT_MESSAGE("attack_depth");
int attack_depth = get_readonly_context(L).get_attack_depth();
lua_pushnumber(L, attack_depth);
return 1;
}
static int cfun_ai_get_attacks(lua_State *L)
{
// Unlike the other aspect fetchers, this one is not deprecated!
@ -897,7 +889,6 @@ static int impl_ai_get(lua_State* L)
// Aspects
{ "get_aggression", &cfun_ai_get_aggression },
{ "get_avoid", &cfun_ai_get_avoid },
{ "get_attack_depth", &cfun_ai_get_attack_depth },
{ "get_attacks", &cfun_ai_get_attacks },
{ "get_caution", &cfun_ai_get_caution },
{ "get_grouping", &cfun_ai_get_grouping },

View file

@ -237,7 +237,6 @@ const std::string holder::get_ai_overview()
std::stringstream s;
s << "advancements: " << this->ai_->get_advancements().get_value() << std::endl;
s << "aggression: " << this->ai_->get_aggression() << std::endl;
s << "attack_depth: " << this->ai_->get_attack_depth() << std::endl;
s << "caution: " << this->ai_->get_caution() << std::endl;
s << "grouping: " << this->ai_->get_grouping() << std::endl;
s << "leader_aggression: " << this->ai_->get_leader_aggression() << std::endl;
@ -631,20 +630,6 @@ bool manager::add_ai_for_side_from_config( side_number side, const config& cfg,
}
///@todo 1.9 add error reporting
bool manager::add_ai_for_side( side_number side, const std::string& ai_algorithm_type, bool replace )
{
if (replace) {
remove_ai_for_side (side);
}
config cfg;
cfg["ai_algorithm"] = ai_algorithm_type;
std::stack<holder>& ai_stack_for_specific_side = get_or_create_ai_stack_for_side(side);
ai_stack_for_specific_side.emplace(side, cfg);
return true;
}
// =======================================================================
// REMOVE
// =======================================================================

View file

@ -331,18 +331,6 @@ public:
bool add_ai_for_side_from_config(side_number side, const config &cfg, bool replace = true);
/**
* Adds active AI for specified @a side from parameters.
* @note Running this command may invalidate references previously returned
* by manager. AI is not initialized at this point.
* @param side side number (1-based, as in game_info).
* @param ai_algorithm_type type of AI algorithm to create.
* @param replace should new ai replace the current ai or 'be placed on top of it'.
* @return true if successful.
*/
bool add_ai_for_side( side_number side, const std::string& ai_algorithm_type, bool replace = true);
// =======================================================================
// REMOVE
// =======================================================================

View file

@ -188,9 +188,6 @@ static register_aspect_factory< composite_aspect< unit_advancements_aspect >>
static register_aspect_factory< composite_aspect<double>>
aggression__composite_aspect_factory("aggression*composite_aspect");
static register_aspect_factory< composite_aspect<int>>
attack_depth__composite_aspect_factory("attack_depth*composite_aspect");
static register_aspect_factory< composite_aspect< attacks_vector >>
attacks__composite_aspect_factory("attacks*composite_aspect");
@ -262,9 +259,6 @@ static register_aspect_factory< standard_aspect< unit_advancements_aspect >>
static register_aspect_factory< standard_aspect<double>>
aggression__standard_aspect_factory("aggression*standard_aspect");
static register_aspect_factory< standard_aspect<int>>
attack_depth__standard_aspect_factory("attack_depth*standard_aspect");
static register_aspect_factory< ai_default_rca::aspect_attacks >
attacks__testing_ai_default_aspect_attacks_factory("attacks*ai_default_rca::aspect_attacks");
@ -340,9 +334,6 @@ static register_aspect_factory< standard_aspect< unit_advancements_aspect >>
static register_aspect_factory< standard_aspect<double>>
aggression__standard_aspect_factory2("aggression*");
static register_aspect_factory< standard_aspect<int>>
attack_depth__standard_aspect_factory2("attack_depth*");
static register_aspect_factory< ai_default_rca::aspect_attacks >
attacks__testing_ai_default_aspect_attacks_factory2("attacks*");
@ -414,9 +405,6 @@ static register_lua_aspect_factory< lua_aspect< unit_advancements_aspect >>
static register_lua_aspect_factory< lua_aspect<double>>
aggression__lua_aspect_factory("aggression*lua_aspect");
static register_lua_aspect_factory< lua_aspect<int>>
attack_depth__lua_aspect_factory("attack_depth*lua_aspect");
static register_lua_aspect_factory< aspect_attacks_lua >
attacks__lua_aspect_factory("attacks*lua_aspect");

View file

@ -490,7 +490,7 @@ void connect_engine::start_game()
send_to_server(config("start_game"));
}
void connect_engine::start_game_commandline(const commandline_options& cmdline_opts)
void connect_engine::start_game_commandline(const commandline_options& cmdline_opts, const config& game_config)
{
DBG_MP << "starting a new game in commandline mode" << std::endl;
@ -532,9 +532,10 @@ void connect_engine::start_game_commandline(const commandline_options& cmdline_o
}
}
// Set AI algorithm to RCA AI for all sides,
// Set AI algorithm to default for all sides,
// then override if commandline option was given.
side->set_ai_algorithm("ai_default_rca");
std::string ai_algorithm = game_config.child("ais")["default_ai_algorithm"].str();
side->set_ai_algorithm(ai_algorithm);
if(cmdline_opts.multiplayer_algorithm) {
for(const mp_option& option : *cmdline_opts.multiplayer_algorithm) {

View file

@ -63,7 +63,7 @@ public:
bool can_start_game() const;
void start_game();
void start_game_commandline(const commandline_options& cmdline_opts);
void start_game_commandline(const commandline_options& cmdline_opts, const config& game_config);
void leave_game();

View file

@ -763,7 +763,7 @@ void start_local_game_commandline(const config& game_config, saved_game& state,
ng::connect_engine_ptr connect_engine(new ng::connect_engine(state, true, nullptr));
// Update the parameters to reflect game start conditions
connect_engine->start_game_commandline(cmdline_opts);
connect_engine->start_game_commandline(cmdline_opts, game_config);
}
if(resources::recorder && cmdline_opts.multiplayer_label) {

View file

@ -64,6 +64,4 @@ public:
private:
std::vector<unit_ptr > recall_list_; //!< The underlying data struture. TODO: Should this be a map based on underlying id instead?
friend class ai::readonly_context_impl; //!< Friend AI module for ease of implementation there.
};