WarPlanTypes...

There are several, here are the enums and a brief description in my own words for what they do :)

NO_WARPLAN
This happens with unexpected wars, most commonly this would be a vassal or ally getting pulled into a war. Typically however this means the AI isn't at war as once they get pulled into an unexpected war they should define a war plan very quickly.

WARPLAN_ATTACKED_RECENT
This is used for new defensive wars and quickly replaced with the next one.

WARPLAN_ATTACKED
Defensive war plan, obviously.

WARPLAN_PREPARING_LIMITED
Building up for a limited war against an enemy. This mainly involves changing production and relocating units.

WARPLAN_PREPARING_TOTAL
Same as above for total (large scale offensive) war.

WARPLAN_LIMITED
Engaged in a limited war.

WARPLAN_TOTAL
Engage in a total war.

WARPLAN_DOGPILE
Dogpiles are acts of opprtunity by the AI so there is no preparation plan.

In each case the exact effects mainly involve research & production emphasis and moving units. When at war or preparing for war the AI can switch priority over for techs based on the advisor setting. Production will shift to units and/or military/defensive buildings. I know this is a bit vague because there isn't a straight answer that applies to every leader. The warplan in effect will not always mean the same units/buildings will be produced by different leaders, it's only an influence. For instance most leaders will be encouraged to build units with UNITAI_PILLAGE when in or preparing for a limit war but it doesn't mean they will always build more of them.

Hope that helps even if it is a bit vague :)

Edit: I should also add that the AI doesn't only evaluate their own war plan, they also evaluate the other AI war plans. This is another use of NO_WARPLAN where one civ will count the number of war plans, excluding NO_WARPLAN, that other civs have active.
 
Thanks ! Very interesting to know that !

Now another question. In a mod where new civs created and enter at war immediatly (in a case of revolution, not using the splitEmpire function):
  • I can't use the prepare war plans. I suppose it won't have any effect.
  • I want everybody to be at Total war
Is it more complicated (more long to plan) for the AI to put everybody to total war than to limited war ?

Here is what I want :
I work on Spanish civil war 1936. At a turn, a first revolution occurs, so a civ is divided in 2 parts (nationalists and republicans) entering at total war immediatly. The 2 civs are playable : the player chooses which one he wants to play (I can know which one is choosed). At another turn, the Republican civ splits in 4 parts and is killed. Immediatly, the 4 new civs enter at total war against the nationalists (the 4 civs are playable by human, if the human is still republican : if he didn't choose to play nationalists at the first revolution).

In BtS 3.03, the declareWar function didn't include war plans. So I defined the war plans before declaring war (but at the same turn, because my civs are created at this turn). I had choosed to set AI to be at total war against the human player, but at limited war againts the others AI players. The creation of the new civs was taking about 2 minutes (flip some units and cities, add war plans, declare war, add gold and techs...)

In BtS 3.13, the declareWar function includes war plans. And I changed the AI to be more engaged in war, so I set everybody to total war. The creation of the new civs takes now 26 minutes. I didn't remove the war plans preparation.

As you imagine, I want to reduce the time spent by this second revolution. What could I do ?
  • Not everybody at total war ?
  • Suppress the war plans before declaring war ?
  • That's not the subject, there is something else somewhere else ? :confused:
  • There is no solution : 26 minutes is not so long, your player will drink about 10 beers waiting it's done and will be in ready for a furious war !! :)
 
26 minutes? Wow. Maybe you can move some of that code from python into the DLL? Alternatively you may be able to cheat and not actually declare war, instead just set their relations to a high negative value and let them declare war on their own. I've played around quite a bit with the AI but never anything like what you're doing so I'm not sure what's making it take so long.
 
Back
Top Bottom