Please explain a couple of AI parameters

A secret place for modders to chat and ask questions. Requires forum registration.

Moderators: firepowerjohan, Happycat, rkr1958, Slitherine Core

Post Reply
Ryben
Staff Sergeant - StuG IIIF
Staff Sergeant - StuG IIIF
Posts: 281
Joined: Sun Dec 02, 2007 2:12 pm
Location: Spain

Please explain a couple of AI parameters

Post by Ryben »

Inthe general.txt file there are a couple of quite interesting parameters under "Tactical AI"

CAPITAL_DEFENCE 120 /*The Threshold (military advantage ratio) for when defence (of the own capital) gets more important than offence*/
DEFENCE_REACTION 3 /*Max number of switching fronts or from/to Homeland defence duty per turn*/

Could someone explain them, specially the first one?

It looks like changing that ratio the AI would start defending their capitals instead of attacking. That would be good news for all the people that thinks AI dont defend enough key cities.

Thanks!
firepowerjohan
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1878
Joined: Mon May 22, 2006 7:58 pm
Contact:

Post by firepowerjohan »

I am glad u asked, means you must have dig deep into the game now when analysing the general.txt script :)

The Capital Defence is a ratio of how much force you have compared to enemy around your Capital and if below you will try sending home units to your Capital. 120 means 120% so unless you have a 20% advantage in the near area of your capital (formula not only considering number of units but also weight in distance to capital and unit parameters so that a tank is worth much more than a garrison) you will send home units.

For quick testing, try setting this parameter to 1000 and start 1939 scenario with AI being Axis and you will see that some of the units will rail back to Berlin because they feel it being threatened.


Defence Reaction is how many units AI will transfer per turn from/to front lines and Capitals if there is a change of plans. If you set this number at 1 means the AI will be more inflexible and transfer less amounts of units. If this number is too high though, there could be a too exaggerating AI that feels wicked.
Last edited by firepowerjohan on Mon Dec 10, 2007 12:09 am, edited 1 time in total.
Johan Persson - Firepower Entertainment
Lead Developer of CEAW, CNAW and World Empires Live (http://www.worldempireslive.com)
Ryben
Staff Sergeant - StuG IIIF
Staff Sergeant - StuG IIIF
Posts: 281
Joined: Sun Dec 02, 2007 2:12 pm
Location: Spain

Post by Ryben »

Very interesting!

So, if you change that value and place it at, let´s say, 200 it´s likely that you will encounter more enemy units defending the capital when you position units near it, right? In theory you will be outnumbered by 2:1 with Capital Defence 200.

How do the AI calculate the distance of enemy units to the capital to feel threatened?
firepowerjohan
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1878
Joined: Mon May 22, 2006 7:58 pm
Contact:

Post by firepowerjohan »

Well without going into detail, a unit 1 hex away from Berlin will be worth much more than one say 5 hexes away or a unit 20 hexes away. They do not use any linear formula but instead intervalls and factors. The militaryadvantage on a certain hex is defined as your own militaryinfluence divided by enemy influence and if Homeland Defence is 120 means that the military advabtage has to be at leist 1.2 else you need more units sent there.
Johan Persson - Firepower Entertainment
Lead Developer of CEAW, CNAW and World Empires Live (http://www.worldempireslive.com)
Post Reply

Return to “Commander - Europe at War : Modders Corner”