Page 1 of 1

AI tweaking

Posted: Mon Jan 12, 2009 4:34 am
by Mangudai
How easy is it to tweak the AI? I'm thinking specifically of changing the AI's perspective of the VP's of certain objective locations so that the AI would value them more.

In most of my Union Campaigns the AI does not do enough to defend the Richmond, Fredericksburg, Mannassas corridor. It frequently sends a large force to Grafton and beyond.

Posted: Mon Jan 12, 2009 5:48 am
by soloswolf
This capital defense business has always been a tricky point. I suspect it is rather complex a fix, as we still don't have a real solution to it yet.

I almost always play as the CSA, but the Federals have just as hard a time watching Washington as the Rebs do watching Richmond.

Posted: Mon Jan 12, 2009 6:11 am
by Gray_Lensman
deleted

Posted: Mon Jan 12, 2009 6:29 am
by cwhomer
What patch are you using?

The latest beta patch, 1.12a (RC5) is available in the "Help to Improve AACW!" subforum and includes some AI changes. Athena is very much improved overall and, specifically, in regards to what you are talking about.

Posted: Tue Jan 13, 2009 5:27 am
by Mangudai
I'm using 1.12a and I agree the AI is very good (compared to AI's of other strategy games).

I did a little bit of game design with SPWAW and it had a neat feature of artificial VP's. In other words you could make the AI value certain positions more or less without changing the real VP's

Posted: Tue Jan 13, 2009 7:56 am
by Rafiki
This is possible in AGE too (AFAIK) :)

Posted: Tue Jan 13, 2009 5:42 pm
by Pocus
Yes this is definitively feasible. And we would be very interested in seeing a modder in action on this topic (AI tweaking).

Posted: Tue Jan 13, 2009 10:22 pm
by squarian
As notes to future modders, maybe someone should compile a list of AI weaknesses - apart from not defending capitals well enough?

Some things I see the Union AI do over and over are:

Valley Campaign - unless the Manassas-Fredericksburg approach is wide open, I invariably see a Union campaign in the Shenandoah valley in '61 and early '62. Never the Peninsula, never an amphibious landing in force in the Carolinas or Mobile or New Orleans - always a big push in the Shenandoah valley.

Kentucky - typically the Union AI will invade Kentucky with a scattering of units, often independent brigades. I (CSA) will try to hold onto to Bowling Green, usually sucessfully, then concentrate two or three divisions under Al Johnson for a counter-offensive which usually takes Louisville and sometimes ends the game with an invasion of Ohio. This happens apparently because the AI can't concentrate fast enough to hold Louisville or defend the line of the Ohio R. I can't recall ever seeing the AI form an army to oppose my thrust to the Ohio.

River forts - Has anyone ever seen the AI make a real effort on Fort Donelson or Island 10? Perhaps (understandably) the AI doesn't do amphib ops very well, but maybe these river forts ought to be objectives for part of the game?

Posted: Wed Jan 14, 2009 3:57 am
by ghostlight
squarian wrote:As notes to future modders, maybe someone should compile a list of AI weaknesses - apart from not defending capitals well enough?

Some things I see the Union AI do over and over are:

Valley Campaign - unless the Manassas-Fredericksburg approach is wide open, I invariably see a Union campaign in the Shenandoah valley in '61 and early '62. Never the Peninsula, never an amphibious landing in force in the Carolinas or Mobile or New Orleans - always a big push in the Shenandoah valley.

Kentucky - typically the Union AI will invade Kentucky with a scattering of units, often independent brigades. I (CSA) will try to hold onto to Bowling Green, usually sucessfully, then concentrate two or three divisions under Al Johnson for a counter-offensive which usually takes Louisville and sometimes ends the game with an invasion of Ohio. This happens apparently because the AI can't concentrate fast enough to hold Louisville or defend the line of the Ohio R. I can't recall ever seeing the AI form an army to oppose my thrust to the Ohio.

River forts - Has anyone ever seen the AI make a real effort on Fort Donelson or Island 10? Perhaps (understandably) the AI doesn't do amphib ops very well, but maybe these river forts ought to be objectives for part of the game?


I play the CSA, and in the handful of games I've played I get the same results every game. What this means in larger terms is that Athena doesn't handle the western front well. (It does much better in the Trans Miss) What's frustrating about this is that the West was where the US actually won the war, imho. Id just like to see Athena do a better job in putting some serious pressure against Tennessee and up and down the Mississippi.

Posted: Wed Jan 14, 2009 4:10 am
by ghostlight
So, not to end with a gripe, I'm hoping that some of the modders that continue to work on this game come up with a fix that addresses this. I looked at modding VP's myself, but looks like I'd need an idiot's guide to do this, so hoping someone else more qualified finds this a worthy project.

Posted: Wed Jan 14, 2009 1:07 pm
by Clovis
Mangudai wrote:How easy is it to tweak the AI? I'm thinking specifically of changing the AI's perspective of the VP's of certain objective locations so that the AI would value them more.

In most of my Union Campaigns the AI does not do enough to defend the Richmond, Fredericksburg, Mannassas corridor. It frequently sends a large force to Grafton and beyond.


That's rather easy since weeks with the introduction of new scripting command. i've done that for CSA AI in my SVF mod and I plan to add the same for Union in the future.

Here's a part


SelectFaction = $CSA
SelectRegion = $Richmond, VA
StartEvent = evt_nam_CSA_AIsettings|1|0|NULL|NULL|$Richmond, VA|NULL

Conditions
MinDate = 1861/04/10
MaxDate = 1862/04/25
probability = 75

Actions
AI.ChgLocalInterest = $New York, NY|50|$Rockland, NJ|50|$Philadelphia, PA|50|$Cuyahoga, OH|50|$Hendricks, IN|50|$Chicago, IL|50|$Racine, WI|50|$Dubuque, IA|50|$Westmoreland, PA|60


EndEvent


SelectFaction = $CSA
SelectRegion = $Richmond, VA
StartEvent = evt_nam_CSA_AIsettings38|1|0|NULL|NULL|$Richmond, VA|NULL

Conditions
MinDate = 1861/04/10
MaxDate = 1862/02/25
probability = 90

Actions
AI.ChgLocalInterest = $Ardana, IL|5|$Morrison, IL|5|$Monmouth, IL|5|$Rock, IL|5|$Dixon, IL|5|$Sycamore, IL|5|$Woodstock, IL|5|$Carthage, IL|5|$Gales, IL|5|$Rochelle, IL|5|$Bureau, IL|5|$Aurora, IL|5|$Joliet, IL|5|$Quincy, IL|5|$Sterling, IL|5|$Lewis, IL|5|$Peoria, IL|5|$Bushnell, IL|5|$Pontiac, IL|5|$Kantakee, IL|5|$Gilead, IL|5|$Carroll, IL|5|$Jackson, IL|5|$Bath, IL|5|$Bloomington, IL|5|$Alton, IL|5|$Carlin, IL|5|$Rookhouse, IL|5|$Springfield, IL|5|$Decatur, IL|5|$La Salle, IL|5|$Gilman, IL|5|$Belleville, IL|5|$Fenron, IL|5|$Carlyle, IL|5|$Pana, IL|5|$French, IL|5|$Toledo, IL|5|$Herbert, IL|5|$Danville, IL|5|$Chester, IL|5|$Ward, IL|5|$Pinckney, IL|5|$Salem, IL|5|$Howard, IL|5|$Mattoon, IL|5|$Effingham, IL|5|$Greenup, IL|5|$Terre Haute, IL|5|$Palestine, IL|5|$Alexander, IL|5|$Benton, IL|5|$McLean, IL|5|$Kinsale, IL|5|$Elizabeth, IL|5|$Carnie, IL|5|$Laporte, IL|5|$Lasalle Run|5|$Joliet Landing|5
AI.ChgLocalInterest = $Lake, IN|5|$Newton, IN|5|$Starke, IN|5|$Marshall, IN|5|$La Grange, IN|5|$Benton, IN|5|$Jasper, IN|5|$Whitley, IN|5|$Allen, IN|5|$Fountain, IN|5|$Tippecanoe, IN|5|$Carroll, IN|5|$Wabash, IN|5|$Adams, IN|5|$Vigo, IN|5|$Clay, IN|5|$Hendricks, IN|5|$Owen, IN|5|$Montgomery, IN|5|$Johnson, IN|5|$Wayne, IN|5|$Knox, IN|5|$Pike, IN|5|$Lawrence, IN|5|$Brown, IN|5|$Shelby, IN|5|$Rush, IN|5|$Posey, IN|5|$Warrick, IN|5|$Dubois, IN|5|$Perry, IN|5|$Orange, IN|5|$Harrison, IN|5|$Scott, IN|5|$Jefferson, IN|5|$Dearborn, IN|5


EndEvent



SelectFaction = $CSA
SelectRegion = $Richmond, VA
StartEvent = evt_nam_CSA_AIsettings2|1|0|NULL|NULL|$Richmond, VA|NULL

Conditions
MinDate = 1861/07/01
MaxDate = 1866/04/01
EvalForeignEntry =>;85
EvalEvent = evt_nam_CSA_AIsettings;=;1


Actions
AI.ChgLocalInterest = $New York, NY|100|$Rockland, NJ|100|$Philadelphia, PA|100|$Cuyahoga, OH|100|$Hendricks, IN|100|$Chicago, IL|100|$Racine, WI|100|$Dubuque, IA|100|$Westmoreland, PA|100

EndEvent


SelectFaction = $CSA
SelectRegion = $Richmond, VA
StartEvent = evt_nam_CSA_AIsettings29|1|0|NULL|NULL|$Richmond, VA|NULL

Conditions
MinDate = 1861/07/01
MaxDate = 1866/04/01
EvalForeignEntry <=;60
EvalEvent = evt_nam_CSA_AIsettings2;=;1


Actions
AI.ChgLocalInterest = $New York, NY|-100|$Rockland, NJ|-100|$Philadelphia, PA|-100|$Cuyahoga, OH|-100|$Hendricks, IN|-100|$Chicago, IL|-100|$Racine, WI|-100|$Dubuque, IA|-100|$Westmoreland, PA|-100

EndEvent

Posted: Thu Jan 15, 2009 4:24 am
by Mangudai
Cool Beans! Thanks for posting that Clovis.

Posted: Thu Jan 15, 2009 5:30 am
by bigus
Clovis.
This is interesting.
This is a clip of the Xls file I did for the Kentucky scenario some time ago.

[ATTACH]5702[/ATTACH]


You can see that in the Xls file I do have the pipe delimiter set but......
This is a segment of the output sct file.

SelectFaction = $USA
StartEvent = USA Objective has been changed!|1|1|NULL|NULL|NULL|NULL

Conditions
MinDate = 1862/11/01
MaxDate = 1862/12/15
SelectRegion = $Hamilton, TN
Probability = 50

Actions
Objectives = $Hamilton, TN;50;$Jefferson, KY;0;$Fayette, KY;0;$Warren, KY;0;
AI.ChgLocalInterest = $Jefferson, KY;20;$Davidson, TN;20;$Warren, KY;20;$Fayette, KY;20;$Hamilton, TN;500;
GenMsg

EndEvent


It's been changed to semi colons!
I've never noticed this before.....I wonder if this matters? the objectives change with no problems. the log seems to see localinterest command.
Thanks for the post. I'm going to check this out a bit further.

Posted: Thu Jan 15, 2009 9:56 am
by Gray_Lensman
deleted

Posted: Thu Jan 15, 2009 12:58 pm
by Clovis
Comman creation/removal of VP and Objectives ds I posted are both just a part of what can be done and a part of what I want to do.

What can be done too is orienting AI by creation/removal of VP and Objectives, by fiwxing some units, by giving AI some supplementary ressources.

I've done that too but I just discovered CSA AI to be a litle fond of Indian Territory. And I'm introducing new events step by step, one because AGE AI is somewhat programmed to adopt vriable strategies, secondly because too much scripting would be leading to AI acting out of context.

Posted: Thu Jan 15, 2009 8:23 pm
by bigus
Gray_Lensman wrote:FYI, anytime you have pipe symbols contained within a parameter field, they get changed to semi-colons. Been like that as far back as I can remember. The reason for this is rather obvious: You can't use semi-colons themselves anywhere within the database files to separate data since they're the defined separator character used by the compiler.

Pipe symbols on the other hand are inserted by the scenario compiler when it actually moves to the next parameter column.


I did not know this. Thanks for the Info Gray.

Posted: Fri Jan 16, 2009 2:01 am
by gunnergoz
Does the AI have a means to analyze the human opponent's dispositions by region and respond to how they are weighed?
I'm obviously not a programmer but I was wondering how much information the AI gets about what I'm doing, how it evaluates that information and what are the limitations upon its responses.

Posted: Fri Jan 16, 2009 9:44 am
by Pocus
Yes, the AI creates "threat maps" where the strength (of your known) stacks diffuse threat in their vicinity. This allow her to see holes and peaks in threats. There are others computing done in addition to that, but this is the base idea.

Posted: Sat Jan 17, 2009 12:11 am
by gunnergoz
Pocus wrote:Yes, the AI creates "threat maps" where the strength (of your known) stacks diffuse threat in their vicinity. This allow her to see holes and peaks in threats. There are others computing done in addition to that, but this is the base idea.


Thanks for your quick reply Pocus.
A spin-off question: Does the AI then evaluate/compare the known human opponent strength versus its database of human objectives on the map? It would seem to be a way to give the AI a basic ability to read the human's player's strategy and to respond with the AI's disposable forces.

If this worked correctly, the AI playing South might surge for its own victory point objective (e.g. Ohio) but then may have to recall the force to defend Richmond or other friendly AI regions that the human player is threatening.

Posted: Sat Jan 17, 2009 9:49 am
by Pocus
Yes, the AI also evaluate the map in two others way: what the regions are worth for 'her', and what they are worth for the enemy. Then, depending of the ratio of power in the area, it will favors pursuing aggressive goals or defensive ones.

That's the theory... As you see, a few thousands more hours of development would do good :) But the AI for now is completely generic, on purpose. For a better behavior, scripting commands were introduced to guide her, but as this is also rather time consuming to do these tweaks, I have left these to the modders, while I concentrate on improving the generic behaviors (or expanding it with new ones, I'm in the process of something rather complex to overhaul amphib landings).

Posted: Sat Jan 17, 2009 8:22 pm
by gunnergoz
Thanks Pocus, that's very informative and impressive too. I appreciate your willingness to follow the forum and answer questions, as busy as you obviously are with your programming duties.
I only wish I were younger and could have gotten into the programming programs when I was in college. There were no PC's back then and computers took up entire rooms, with punch cards and reels of tape.

Posted: Sun Jan 18, 2009 7:22 pm
by Chaplain Lovejoy
gunnergoz wrote:Thanks Pocus, that's very informative and impressive too. I appreciate your willingness to follow the forum and answer questions, as busy as you obviously are with your programming duties.
I only wish I were younger and could have gotten into the programming programs when I was in college. There were no PC's back then and computers took up entire rooms, with punch cards and reels of tape.


Ah, punch cards! Back in the 70s, I was quite adept at programming in COBOL on those things. But, alas... :p apy: