• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Pray for patch. I'm really need this command (peace time preparations) for my mods.
Really? I'm have no idea. If you would deploy garrisons via cheat event for AI, AI will re-deploy garrisons in wrong province. So there is no stable solution for this question
Nothing then, I will use current system of activation of new divisions on the border by the event that is used for declaration of war.
Thanks anyway.
 
One question, I have a situation where two countries, divided by sea, are allied and fight common enemy.
Problem is that AI country that not border the enemy is evading combat and constantly pulling out the expeditionary forces back to their land.
How to make them fight on allied territory against the common enemy?
 
Just a simple and straight question: can two nations have the same ai file?
Well, in theory yes, just be careful when you use TAGs inside the ai file. But yes, two nations can load the same AI file AFAIK. IIRC DHFull has a generic minor.ai or something like that.
 
Hello there. I have been doing some AI work and would like to ask some questions:


1. What is the best way to make AIs ally with other nations? Is the Befriend setting enough or is there something extra necessary? Or is the neutrality setting more important? I want more AIs allying with each other spontaneously.

2. How can I use this? It seems to allow using flags on AI files. How? Where? Is there a detailed guide? Examples would be nice, too.

Code:
# Inter-Agent distribution variables

flags = {
      testflag = yes
      invade_albania = no
      assist_finland = no
    }

3. In which part of the ai code is this supposed to go?

Code:
# if the ai should use offensive supply
use_offensive_supply = yes/no

# only use offensive supply if the fuel needed for it is less than this divided by unit strength. Default: 100
max_fuel_offensive = x
 
Last edited:
Hello, ^^

I'm working on something and I wanted to ask about AI since I'm having huge issues while trying to properly learn how to create it. I have an ongoing Japanese Civil War in my scenario with the following tags: JAP, U64 (Communist Japan) and U07 (Provisional Government of Japan). All in all, U64 and U07 are brand "new" countries within the mod I'm using (NWO2). While testing the scenario I'm working on I noticed that both U64 and U07 have issues to replenish their losses despite having a good economy. I hopped into both to check up what was happening and I noticed the following things...

U64:: despite them being the weakest tag (lower count of divisions) U64 is pretty aggressive on its own, they attempt to attack JAP as much as they can though they eventually bleed themselves out and are unable to continue pushing.

U07:: this one is the weirdest of both, despite not having as generous an industry as the other tags it receives manpower and free divisions by event. However, this tag almost NEVER attacks, they can have 12 divisions in front of 3 enemy divisions and they won't ever attack. Instead, if given the chance (by not blocking the Inland Sea) they will retreat from Hiroshima to reinforce both Nagasaki and Kagoshima.

I think NWO2 uses the same mobilization sytem from Darkest Hour Full so I wanted to ask, why does JAP have some distinct mobilization options in the events? I've seen some mobilization events specify "country = { JAP } " and I was wondering the reason behind it. This is also another issue I have with U07, I threw in the tag along the others in the mobilization files and I actually believe the AI is intelligent enough to use it. HOWEVER, they dump all the manpower into creating new divisions instead of replenishing their strong force.

So, that's my AI rant haha. I hope someone manages to help me or at least point me into the right direction, thanks!!

(BTW, in the AI files the section saying "target = { } " is meant to place provinces into it so AI advances?)​
 
Hello, ^^

I'm working on something and I wanted to ask about AI since I'm having huge issues while trying to properly learn how to create it. I have an ongoing Japanese Civil War in my scenario with the following tags: JAP, U64 (Communist Japan) and U07 (Provisional Government of Japan). All in all, U64 and U07 are brand "new" countries within the mod I'm using (NWO2). While testing the scenario I'm working on I noticed that both U64 and U07 have issues to replenish their losses despite having a good economy. I hopped into both to check up what was happening and I noticed the following things...

U64:: despite them being the weakest tag (lower count of divisions) U64 is pretty aggressive on its own, they attempt to attack JAP as much as they can though they eventually bleed themselves out and are unable to continue pushing.

U07:: this one is the weirdest of both, despite not having as generous an industry as the other tags it receives manpower and free divisions by event. However, this tag almost NEVER attacks, they can have 12 divisions in front of 3 enemy divisions and they won't ever attack. Instead, if given the chance (by not blocking the Inland Sea) they will retreat from Hiroshima to reinforce both Nagasaki and Kagoshima.

I think NWO2 uses the same mobilization sytem from Darkest Hour Full so I wanted to ask, why does JAP have some distinct mobilization options in the events? I've seen some mobilization events specify "country = { JAP } " and I was wondering the reason behind it. This is also another issue I have with U07, I threw in the tag along the others in the mobilization files and I actually believe the AI is intelligent enough to use it. HOWEVER, they dump all the manpower into creating new divisions instead of replenishing their strong force.

So, that's my AI rant haha. I hope someone manages to help me or at least point me into the right direction, thanks!!

(BTW, in the AI files the section saying "target = { } " is meant to place provinces into it so AI advances?)​
IIRC JAP is an exception because of Korea (core for IC, but should not count for mobilization).

Regarding the AI, it's not my area of expertise. Did you check the file AI Files Modifiers in the Modding Documentation folder?
Code:
# Provinces with an assigned priority. These are strategic goals for the AI (it will try to take them in wars and demand them in peace treaties.)
target = {
    324 = 50 # 1 - 100
}
 
  • 1
Reactions:
IIRC JAP is an exception because of Korea (core for IC, but should not count for mobilization).
Ohh I see, I noticed the lines but I was wondering if there was something else to that, thanks! ^^

Regarding the AI, it's not my area of expertise. Did you check the file AI Files Modifiers in the Modding Documentation folder?
Thanks! I've been toying around with it, I was wondering something about some of the things about AI. For example, "reinforcement = 0.3" how much of the IC is that? Apologies if the question is dumb I just don't fully grasp it, does that mean that 30% of the available IC will be used to replenish losses? I guess so, right? I also wanted to know, would "ferocity = yes" stop the AI from offering peace deals as well? Noticed it's meant to reject peace, but what about the other way around?

Thanks for your help ^^
 
Ohh I see, I noticed the lines but I was wondering if there was something else to that, thanks! ^^


Thanks! I've been toying around with it, I was wondering something about some of the things about AI. For example, "reinforcement = 0.3" how much of the IC is that? Apologies if the question is dumb I just don't fully grasp it, does that mean that 30% of the available IC will be used to replenish losses? I guess so, right? I also wanted to know, would "ferocity = yes" stop the AI from offering peace deals as well? Noticed it's meant to reject peace, but what about the other way around?

Thanks for your help ^^
Regarding reinforcement, I guess you're right.

Regarding ferocity, I'm not sure but I'm afraid it is possible for them to offer deals, even if they reject those offered to them.
 
  • 1Like
Reactions:
Hi! Does anyone know if it's possible to have the AI consistently use Paratroopers? I know that Arsenal of Democracy fixed them somehow (By only taking static paratroopers into transports?), which I tried to emulate by giving them 0 movement speed, but it doesn't work.
 
  • 1Like
Reactions:
Regarding reinforcement, I guess you're right.

Regarding ferocity, I'm not sure but I'm afraid it is possible for them to offer deals, even if they reject those offered to them.
Any way to make an AI (the USA) avoid nuking certain countries? What about avoiding nuking certain provinces?

Currently the USA likes to nuke Saigon and Taiwan and it's a bit silly!
 
Been doing some AI work, and I'm curious how this works:

Code:
# only use offensive supply if the fuel needed for it is less than this divided by unit strength. Default: 100 max_fuel_offensive = x


Way I understood it, it only allows the AI to use offensive supply IF the fuel required is the x / unit strength. So let's say x = 1000. The unit is at 100 strength. 1000 x 100 = 10.
So the AI will only use offensive supply if the fuel cost is 10?
Is that number per unit (say, only if every unit in the division would spend less than 10 fuel to set offensive) or also per division (so it wouldn't spend if the cost for the entire division is bigger than 10)?
 
Been doing some AI work, and I'm curious how this works:

Code:
# only use offensive supply if the fuel needed for it is less than this divided by unit strength. Default: 100 max_fuel_offensive = x


Way I understood it, it only allows the AI to use offensive supply IF the fuel required is the x / unit strength. So let's say x = 1000. The unit is at 100 strength. 1000 x 100 = 10.
So the AI will only use offensive supply if the fuel cost is 10?
Is that number per unit (say, only if every unit in the division would spend less than 10 fuel to set offensive) or also per division (so it wouldn't spend if the cost for the entire division is bigger than 10)?
The modifier is used in just one file (sov_1945.ai, DH no mods, probably a Doomsday legacy):
Code:
max_fuel_offensive = 1 #Infantry units only
The description given for max_fuel_offensive modifier is incorrect and should be something like this:
Code:
only use offensive supply if the fuel needed for it is less than this multiplied by unit total strength (the sum of strengths of all divisions in the unit).

off_supply_fuel_cost_for_the_unit > max_fuel_offensive * total_unit_strength

For example an unit with one ARM division at 100% strength and 10 oil consumption would require 600 oil for offensive supply.
If max_fuel_offensive is not set in the AI file for the country, the default value of 100 will be used, so the check will be:

600 > 100 * 100 or 600 > 10_000 which is NOT true, so the unit will be considered for offensive supply by the front AI

If the max_fuel_offensive is set to 1 in the AI file for the country we will have:

600 > 1 * 100 or 600 > 100 which is true, so this unit will not be considered for offensive supply by the front AI
 
Last edited:
Hello. My question is in regard to AI front behavior, specifically the values for Handicap and Passivity.

Say I wanted to change the values for France against Germany. Right now, we have:

enemy_handicap = {
GER = 120
}
passivity = {
GER = 10
}

According to the AI Files Modifiers text, this means:
# Countries we do not counter-attack for a certain number of days
enemy_handicap = {
# NOTE: These values are ignored for human-controlled enemies.
# CAUTION: Values apply for _every_new_ war with a set nation.
ENG = 100
FRA = 120
...
...
}

In other words, France will wait 120 days to "counter-attack" Germany, if she wishes to do so. How is the term counter-attack used here? Does that refer to the initial 120 days after the start of the war? Or after the most recent combat, France waits 120 days before waking up? If I change these values after the war has already started, will the AI behavior reflect that, or is it frozen, as the instructions say until "every new war" against Germany?

Lastly, does anyone here know what "passivity" does concretely?

Thanks!
 
Hey, I cant tell for sure, because I have not more knowledge then you can find in the modding documentation/wiki.

But I've used both line many time and can tell from observation:

It's not an 100% thing, you can influence how the AI fight its wars, but there will still be some exceptions. Handicap let the AI not attacking the enemy territory. SO you can let a stalement happen. Like France after the Invasion of Poland: They are at war with Germany, but do not attack into Baden-Wurtemberg even if they have superior numbers in Alsace.

But, as I told, this is not 100% for sure. I had many times they conquered like one province/just advanced suuuuper slowly. And they seem to still take back lost owned territory.

I guess it influences somehow the battleodds (various situation adds another value for the AI to checks if it should attack or not). So e.g. the AI need much more "value" to attack as long handicap is active. But please, remeber, this is an assumptions with no proof.

Passitivity seems (again, assumption based on observation, no real proof) to do more or less the same. With GER and CZE at war and the CZE ai with "passitivity = { GER = 100 }", they will more or less just ignore germany. They will still send troops according to it's province priorities/border priorities, but they will not Attack (mostly, always exceptions like at handicap).
Since passitivity has to be between 0 and 100, I guess its percentage. So, passitivity 100 = 100% passivity, 50 = 50% and so on.

Still tbh, I mostly use both of these values together. So maybe what I've observed is only handicap or just passitivity. Maybe one of these do not work at all. I can't tell. I just can tell for sure, that the AI always have a chance to attack, no matter what passitivity and handicap it has.
 
  • 1Like
Reactions: