Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Tutorial: Editing the AI 101

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Advanced Tactics Series >> Mods and Scenarios >> Tutorial: Editing the AI 101 Page: [1]
Login
Message << Older Topic   Newer Topic >>
Tutorial: Editing the AI 101 - 11/14/2007 6:19:10 PM   
Vic


Posts: 8262
Joined: 5/17/2004
Status: offline
Editing the AI 101

The AI of Advanced Tactics is hardcoded, you should not consider it a scriptable AI.
However there are several ways in which can nudge the behaviour of the AI.

These ways are:
- By setting the AIrole scores of SFTypes
- By using the ExecChangeAIVP( x , y, regime , points) Exec Command in an event
- By using the ExecAIConservative ( regime, % )
- By changing the rulevars in the AI Category

What i will do in this 101 is explain these methods.

< Message edited by Vic -- 11/14/2007 6:23:31 PM >
Post #: 1
RE: Editing the AI 101 - 11/14/2007 6:19:43 PM   
Vic


Posts: 8262
Joined: 5/17/2004
Status: offline
AIROLE

For each SFType you can and must tell the AI in what role the AI should use it.
It is possible to give a SFType values in different AIRoles.

You can set any value you want... The AI always will use the best to determain what to produce or transfer, but also will take into account cost and enemy army composition.

A few roles dont work yet because the AI does not know how to use them. These are: Paradrop, AA, Transporter and Bomber strategic.

The others you can set and must set for an AI to function properly.

The higher you raise the AIRole of a certain SFType the more you'll see it being used.





Attachment (1)

(in reply to Vic)
Post #: 2
RE: Editing the AI 101 - 11/14/2007 6:20:09 PM   
Vic


Posts: 8262
Joined: 5/17/2004
Status: offline

EXECS FOR AIs

The ExecChangeAIVP ( x, y ,regime ,points) can be used to let the AI think a certain hex is worth more VP then there are actually on it. By using this exec in events you can let the AI focus more on some areas then on others.

The ExecAIConservative ( regime, %) lets you set the modifier for how good the AI thinks its chances for offensive are. If you set it higher then 100% the AI will become more defensive. If you set it very high it will if possible retreat immediatly into the hinterland. Keep in mind you should switch off rulevar 248 when you use this Exec.

(in reply to Vic)
Post #: 3
RE: Editing the AI 101 - 11/14/2007 6:20:44 PM   
Vic


Posts: 8262
Joined: 5/17/2004
Status: offline
RULEVARS FOR AI

This will be the brunt of the information of this 101. I will discuss the AI rulevars one by one. Keep in mind you can change AI behaviour dynamicly by using the the SetRulevar Exec Command in events. What i often did in scenarios is check whose turn it is, and if it is a specific AI turn then i change the rulevars specificly for that specific AI.

151) Fuzzy VP weight modifier (default=2)
The higher you set this value the more the AI will focus on moving towards VPs instead of towards hostile units.

152) AI Matrix Start Weight (default=2000)
Leave as is.

153) AI mobilize % defenders (default=20)
This % of units of the AI in a defensive situation will be mobilized

154) AI mobilize % attacker (default=50)
Same as 153 but then for the AI in an offensive situation.

155) Frontoccupation % (default=100)
If you set it to 100% the AI will try to occupy all hexes on the front with a unit. If you set it lower then it will leave more gaps in the line.

156) Infantry Vs Support Ratio (default=75)
If you set this lower the AIs infantry units will have more support equipment like MG, mortars and bazookas with them.

157) Armour Vs Infantry Ratio (default=75)
If you set this lower the AIs armour units will have more infantry support.

158) Arty Vs Infantry Ratio (default=75)
If you set this lower the AIs artillery units will have more infantry support.

161-163) Unitgoals for Defensive Plan (default = 30% arm, 60% inf, 10% art)
Here you can set what sort of unit mix the AI should try to have on a defensive front

164) Always mobilize armor (default=1)
This rulevar if active and set on 1 overrules rulevar 153 and 154 and makes the AI try to make sure all armoured units are always mobile

165) Always mobilize artillery (default=0)
same as 164, but then for artillery units.

171-173) Unitgoals for Offensive Plan (default = 50% arm, 30% inf, 20% art)
Same as rulevar 161-163, but then for fronts on which the AI is in the offensive.

181) Political Points Minimum (default=10)
If PP of AI is lower then this value the AI will try to produce some Political Points in its towns.

182) Minimum Stack Points in unit (default=10)
The AI will try to avoid to have unit with less stack points then this.

183) Enemy unit gets full danger score (default=10)
If you set this value higher i think enemy units will be ignored more and if you set it lower (but never to 0) then it will cause the AI to react more strongly to enemy power concentrations. I think (*recheck this for v1.1*)

184) Max Stack per unit (default=100)
The AI will try to not make units larger then this many stack points

191) Max distance from HQ (default=6)
This distance is used for AI decisions if it should create new tactical HQs for the frontlines. Set it higher to have less HQs

201) Each X prodpoints is 1 AIVP (default = 1000)
This determines howmany virtual extra VPs the AI sees for each location.

211) Do engineer bridge road plans (default = 1)
If 1 then the AI will try to build road and bridges. if 0 the AI will not try.

212)
Not used

213)
Not used

214) Mobilized Engineers (default=1)
If 1 then AI will try to moblized engineers, otherwise it won't.

215) ammount of EP in engineer unit before mobilize (default = 80)
If X EP generated per turn then mobilze.

216) Minimum AP improvement before engineers to landfront plan (default=50)
An AI frontsector only gets engineers assigned if they can improve the distance between source and target hex with X action points. Set this value higher if you want less AI engineer activity.

217) Minimum AP improvement before engineers to backplan (default=25)
Same as 216 but then for behind the frontline between neighbouring friendly towns/vps

221) Ai do Air (default=1)
Set to 0 if you dont want the AI to use any air.

222) Backbench multiplier (default = 2.5)
Set this value higher if you want the AI to produce more Rear Area SFTypes. Set it lower if you want it to produce less of those.

223) AI Air Hex Radius (default = 10)
The AI assumes this is the range of an airunit. (*recheck this for v1.1*)

224) Air to land ratio in powerpoints (default = 0.2)
Set higher if you want the AI to produce more AIR, set lower if you want AI to produce less AIR.

225) Focus on destroying units ( default = 0)
You can set the AI to have focus or extreme focus on destroying enemy units.

226) Research Investment ( default = 0.05 )
The higher you set this, the more PP for research the AI will produce.

227) Do Naval AI (default=1)
Set to 0 if you dont want the AI to do any naval ops.

230-242) Naval operations unit types
NavHome is the most defensive AI naval stance for an area
Raid is a bit more offensive
SeaSupriority is the phase where the AI is trying to get supremacy of the seas in an area
Amph is the phase where the AI is trying to get land units over
For each you can set the ideal composition of the fleet.

239) Ideal units in naval op (default =5 )
If you set it higher you will see more naval units, if you set it lower you will see less.

244) Behind lines continent reserve (default =25%)
if you set this higher the AI will try to prepare larger reserves for meeting enemy amphibious invasions.

245) Blow bridges (default = 1)
you can set blowing of bridges for ai off by setting this value to 0.

246) Neutral forces modifier (default = 0.2)
Set this lower if you want the AI to keep less reserves at borders with regimes it is not at war with.

247) Minimum Stack Points in unit optimally. (default = 20)
Closely related to 182. I advice to keep these two values closely related.

248) Random AI personality (default=1)
Set to 0 to switch off random AI personality. If it is on 1 the offensivemindedness, the air campaign mindedness and the researchmindedness of each seperate AI on the map will be randomized for each game.

249) Block AI of creating new units (default=0)
If you set to 1 the AI will not attempt to create new units.

250) Free autoprepair of 33% for AI (default=1)
You can switch this advantage off. I put it in because the AI does not use engineers good enough to repair towns manually.

251) Garrison modifier (default = 1)
If you set this higher the AI will defend airunits better.

252) Defense in depth (default = 1)
Set how deep the AI will garrison towns and vps behind the line. If you set this higher the AI will defend deeper.

253) Free land transfers (default = 0)
Set to 1 to switch off the free land transfers for the AI.

254) Set Defense in depth strength modifier ( default =1)
The higher you set this the larger the behind the line garrisons will become.

255) Disable use of staff (default =0)
If you set to 1 the AI will not attempt to use any staff or keep HQ close to units. Usefull if you make scenarios without staff.

256) Always defend large towns (default=10000)
AI will always defend towns with prodpoint equal or higher then set in this rulevar.




Attachment (1)

(in reply to Vic)
Post #: 4
RE: Editing the AI 101 - 11/14/2007 6:21:10 PM   
Vic


Posts: 8262
Joined: 5/17/2004
Status: offline

I hope this small walkthrough will help you improving the AI for your specific map a bit.
The next tutorial will be about how to make alternate random game masterfiles.

Kind regards,
Vic

(in reply to Vic)
Post #: 5
RE: Tutorial: Editing the AI 101 - 11/14/2007 6:41:19 PM   
elmerlee

 

Posts: 309
Joined: 7/20/2004
Status: offline
Way to go Vic. Another positive step.

(in reply to Vic)
Post #: 6
RE: Tutorial: Editing the AI 101 - 11/14/2007 11:50:13 PM   
PDiFolco

 

Posts: 1200
Joined: 10/11/2004
Status: offline
Some things puzzle me : some AI variables are called "infantry xxx", "armor xxx".. But the game is totally open, and can be played without these categories (eg Tolkien has cav, no armor..) !
So how does the AI "know" what is armor/infantry/whatever ? Shouldn't all this refer to indirected categories ? (ie behavior would be defined for category #6, which happens to be a thing called 'armor", 'arty', 'dragon', or whatever).


(in reply to elmerlee)
Post #: 7
RE: Tutorial: Editing the AI 101 - 11/24/2007 12:53:29 PM   
Vic


Posts: 8262
Joined: 5/17/2004
Status: offline
I forgot to mention this in this tutorial but you can also block a certain LandscapeType for the AI. If you block it. it means the AI will never attempt to move through it.

(in reply to PDiFolco)
Post #: 8
RE: Tutorial: Editing the AI 101 - 11/26/2007 11:42:25 PM   
Arkady


Posts: 1262
Joined: 5/31/2002
From: 27th Penal Battalion
Status: offline
And it is possible mark some landscape favorable for AI to defend in it ?

I make forts more immune to artillery but AI don't reflect it and move out from forts to open terrain to get slaughtered

and question about EXECs

ExecAIConservative ( 0, 125)  means that regime 0 will be 25%  more defensive ?




_____________________________


(in reply to Vic)
Post #: 9
RE: Tutorial: Editing the AI 101 - 11/27/2007 11:34:09 AM   
Vic


Posts: 8262
Joined: 5/17/2004
Status: offline
Letting the AI consider staying in place on a good entrenchment location is something i am hoping to improve upon in v1.1.

(in reply to Arkady)
Post #: 10
RE: Tutorial: Editing the AI 101 - 11/27/2007 12:44:49 PM   
PDiFolco

 

Posts: 1200
Joined: 10/11/2004
Status: offline
Good idea Vic !
In this game the AI is rather "backwards" compared to usual AI : it's pretty offensive and can give nasty surprises, but it badly defend !
I've seen it leaving only token units in big cities to send out armies in the open, that thus soon get cutoff when the city falls, and it doesn't seem to take much advantage of terrain, forts and entrenchments, so it's easy for the player to dig in and slaughter massive numbres of AI attackers..

(in reply to Vic)
Post #: 11
RE: Tutorial: Editing the AI 101 - 11/27/2007 3:50:37 PM   
Arkady


Posts: 1262
Joined: 5/31/2002
From: 27th Penal Battalion
Status: offline
quote:

ORIGINAL: Arkady

And it is possible mark some landscape favorable for AI to defend in it ?

I make forts more immune to artillery but AI don't reflect it and move out from forts to open terrain to get slaughtered

and question about EXECs

ExecAIConservative ( 0, 125) means that regime 0 will be 25% more defensive ?


and other question on Events and those execs...should be event with all AI execs checked each round or each turn ??





< Message edited by Arkady -- 11/27/2007 3:51:06 PM >


_____________________________


(in reply to Arkady)
Post #: 12
RE: Tutorial: Editing the AI 101 - 11/27/2007 5:40:47 PM   
elmerlee

 

Posts: 309
Joined: 7/20/2004
Status: offline
There are any number of games out there that can play well in "two-person" mode. But not many that cut the mustard against the "AI".

I have spent much time playing vs the AI and tried many adjustments in the editor. Without being critical I must say that this has been disapointing. Certainly it is difficult, if not impossible, to program an AI that can be so flexible as AT demands.

It seems to me that the editor is not far from being able to let a senario maker assign specific changes for a single senario. There are a few more abilites needed in the editor and some good examples of how things interreact and that should do it. I have not gotten to naval usage as yet but my biggest AI faults have been ......

1. NO attacks from multiple hexes. Even if
there is no attempt to surround the the
AI certainly needs this ability.
2. Air usage is bad. If air is listed as
"rear" and has a 10 hex range it never
is used at all. I changed the range to
20 and the air is used but 90% of the
time it attacks depleted units. Which
is of no value.
3. Seems to me that the AI does an
outstanding job of using rivers for
defense so I wonder that it is not
other defensive positions.

(in reply to Vic)
Post #: 13
RE: Tutorial: Editing the AI 101 - 1/4/2008 11:54:48 PM   
miral

 

Posts: 170
Joined: 12/20/2007
Status: offline
Thank you! This is exactly what is needed for old people like me who have played wargames for a couple of centuries but know little of computers. Now even I can edit the AI. Amazing!

(in reply to Vic)
Post #: 14
RE: Tutorial: Editing the AI 101 - 2/2/2008 1:35:55 AM   
miral

 

Posts: 170
Joined: 12/20/2007
Status: offline
Emerlee, thanks for the advice about increasing air range to 20. It helps greatly. I am about to put up a post about the AI editor and the Air War. You all here are very computer knowledgeable so what I have to say may sound pretty puerile, but it may be useful for beginers.

(in reply to miral)
Post #: 15
RE: Editing the AI 101 - 4/15/2008 10:25:44 PM   
Jeffrey H.


Posts: 3154
Joined: 4/13/2007
From: San Diego, Ca.
Status: offline

quote:

ORIGINAL: Vic


I hope this small walkthrough will help you improving the AI for your specific map a bit.
The next tutorial will be about how to make alternate random game masterfiles.

Kind regards,
Vic



Did this one ever materialize ?

I keep wishing that the game could be set up to have modded AI's fight each other. Then you could evolve your AI mods in trial by fires.

Let the game run in autopilot and see who wins.


(in reply to Vic)
Post #: 16
RE: Editing the AI 101 - 4/15/2008 10:42:25 PM   
Vic


Posts: 8262
Joined: 5/17/2004
Status: offline
Hi Jeffrey,

Yes that is certainly something that might be added in a future release. But this will take some time.

About the random games. check this tutorial:
http://www.matrixgames.com/forums/tm.asp?m=1618484

kind regards,
Vic

(in reply to Jeffrey H.)
Post #: 17
RE: Tutorial: Editing the AI 101 - 5/26/2008 10:38:35 PM   
Tagwyn

 

Posts: 58
Joined: 10/23/2006
Status: offline
Vic: I want to thank you for this wonderful game! I am sure you hear this quite often but IMHO not often enough. For retired military personnel such as I, it is a real boon to keep our brains working and turning into a vegatable, i.e. alzheimers disease. I saw what that can to to my beloved Grandmother. How heartbraking to not be known by the person you love most in the world. I was away in the milatary and could not be around to help. Thought brings tears to my eyes. Thanks again. L3

(in reply to Vic)
Post #: 18
RE: Tutorial: Editing the AI 101 - 9/9/2010 7:21:11 PM   
ernieschwitz

 

Posts: 3893
Joined: 9/15/2009
From: Denmark
Status: offline
About AI-role scores:

I have a sort of problem i want to fix. I have alot of different Armor units, and i want the AI to build less of one type it is currently building by the boatload. I have lowered the AI scores by a factor of 10, on the unit it keeps building. Will that have any effect at all? Or is it that the AI-role scores are defined like ratios?

Some input would be great :)

(in reply to Vic)
Post #: 19
RE: Tutorial: Editing the AI 101 - 9/10/2010 3:30:01 PM   
Vic


Posts: 8262
Joined: 5/17/2004
Status: offline
It should. Putting it on 0 should result in the AI not building any.

best,
Vic

_____________________________

Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics


(in reply to ernieschwitz)
Post #: 20
RE: Tutorial: Editing the AI 101 - 4/22/2012 9:41:30 AM   
Adam Rinkleff

 

Posts: 375
Joined: 7/24/2007
Status: offline
The AI tends to build infantry and tanks, and sometimes it shuffles around a stack of infantry guns. It would be nice if the AI were modified in order to build better units which had a variety of different unit types. The AI should really be given an example of an infantry unit, armor unit, etc, which it should then try to build copies of.

< Message edited by AdamRinkleff -- 4/22/2012 9:43:18 AM >

(in reply to Vic)
Post #: 21
RE: Tutorial: Editing the AI 101 - 12/1/2012 11:55:05 AM   
CSO_Talorgan


Posts: 768
Joined: 3/10/2007
Status: offline
Is this available as a .pdf somewhere?

(in reply to Adam Rinkleff)
Post #: 22
RE: Tutorial: Editing the AI 101 - 12/1/2012 4:57:39 PM   
Jeffrey H.


Posts: 3154
Joined: 4/13/2007
From: San Diego, Ca.
Status: offline

quote:

ORIGINAL: ernieschwitz

About AI-role scores:

I have a sort of problem i want to fix. I have alot of different Armor units, and i want the AI to build less of one type it is currently building by the boatload. I have lowered the AI scores by a factor of 10, on the unit it keeps building. Will that have any effect at all? Or is it that the AI-role scores are defined like ratios?

Some input would be great :)


Just a thought here Ernie, maybe the AI role score appears in a denominator ?


_____________________________

History began July 4th, 1776. Anything before that was a mistake.

Ron Swanson

(in reply to ernieschwitz)
Post #: 23
RE: Editing the AI 101 - 6/18/2016 9:10:16 PM   
Khanti

 

Posts: 317
Joined: 8/28/2007
From: Poland
Status: offline
quote:

ORIGINAL: Vic

AIROLE

For each SFType you can and must tell the AI in what role the AI should use it.
It is possible to give a SFType values in different AIRoles.

You can set any value you want... The AI always will use the best to determain what to produce or transfer, but also will take into account cost and enemy army composition.

A few roles dont work yet because the AI does not know how to use them. These are: Paradrop, AA, Transporter and Bomber strategic.

(...)

The higher you raise the AIRole of a certain SFType the more you'll see it being used.



A few questions here about setting AI roles:

Example 1.
I set Light Tanks AI role 10) Armor = 50 (all other roles = 0)
I set Medium Tank AI role 10) Armor = 100 (all other roles = 0)

1) Does it mean for AI to use Medium Tanks twice as much as Light Tanks in armor formations?
2) Is AI searching ALL units by value "role 10) Armor = xx" and compare which unit to use?
3) Or is AI searching only within unit and compare how to use unit? (like in Example 2)

Example 2.

I set Destroyer to AI Role 18) Naval Superiority = 50
and
I set the same Destroyer to AI Role 19) Raider = 50.

4) Will AI use Destroyers half as superiority fleets, half as raiders?
5) Should I also set AI role 21) Sea = 100 in that case?

Example 3.

I set Anti-tank Gun AI role 7) InfantrySupport=40
and
I set Machinegun AI role 7) InfantrySupport=40

6) How AI will understand this if it can produce both units?

< Message edited by Hanti -- 6/18/2016 9:14:41 PM >

(in reply to Vic)
Post #: 24
RE: Editing the AI 101 - 7/30/2018 8:08:35 PM   
Khanti

 

Posts: 317
Joined: 8/28/2007
From: Poland
Status: offline
Can AI attack sleeping regime?
What conditions should be set to make AI attack?

(in reply to Khanti)
Post #: 25
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Advanced Tactics Series >> Mods and Scenarios >> Tutorial: Editing the AI 101 Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.781