AI Economy Improvements

If you liked this item, please rate it up on Steam Workshop page.

Author: Matti

Last revision: 18 Jul, 2020 at 16:57 UTC

File size: 471.04 KB

On Steam Workshop

Description:

The EU4 AI building logic has always been ‘problematic’ so I decided to try and fix that. If another mod modifies the "00_buildings.txt" file or any of the "NDefines.NAI" listed in the defines section, then this mod won’t work.

Defines:

INCOME_SAVINGS_FRACTION: Increased from 0.25 to 0.4
– 40% of the AI’s surplus reserved for long-term savings.
COLONY_BUDGET_AMOUNT: Increased from 0.4 to 0.5
– AI will spend a maximum of 50% of its monthly income on colonies.
DESIRED_SURPLUS: Increased from 0.1 to 0.4
– AI will aim to have 40% of their income as surplus when they don’t have large savings.
DEFICIT_SPENDING_MIN_MONTHS: Increased from 6 to 18
– AI must have enough savings to cover 18 months of deficit spending to be willing to deficit spend.
DEFICIT_SPENDING_MIN_MONTHS_PEACETIME: Increased from 48 to 72
– AI must have enough savings to cover 72 months of deficit spending, but only when at peace & no rebels & no war exhaustion.
EXTRA_SURPLUS_WHEN_NEEDING_BUILDINGS: Decreased from 0.15 to 0
– AI won’t need additional surplus when needing buildings.
MAX_SAVINGS: Increased from 60 to 150
– AI will keep a maximum of 150 months of their monthly income as long-term savings.
ARMY_BUDGET_FRACTION: Decreased from 0.7 to 0.4
– AI will spend a maximum of 40% of its monthly income on army maintenance (based off wartime costs).
NAVY_BUDGET_FRACTION: Decreased from 0.5 to 0.4
– AI will spend a maximum of 40% of its monthly income on navy maintenance (based off wartime costs).
FORT_BUDGET_FRACTION: Decreased from 0.4 to 0.35
– AI will spend a maximum of 35% of its monthly income on forts.
ADVISOR_BUDGET_FRACTION: Increased from 0.3 to 0.35
– AI will spend a maximum of 35% of its monthly income on advisors.
CORRUPTION_BUDGET_FRACTION: Increased from 0.25 to 0.4
– AI will spend a maximum of 40% of its monthly income on rooting out corruption.
ARTILLERY_FRACTION: Increased from 0.35 to 0.40
– Ratio of artillery to infantry that the AI will build.
FORCE_COMPOSITION_CHANGE_TECH_LEVEL: Increased from 11 to 13
– Tech level at which the AI will double its artillery fraction.
MIN_CAV_PERCENTAGE: Decreased from 5 to 0
– AI will always try to have at least 0% of their army as cavalry regardless of time in the game.
REGIMENTS_PER_GENERAL: Decreased from 15 to 10
– AI will want 1 general for every 10 regiments (will not exceed free leader pool)
MIN_SHIPS_FOR_ADMIRAL: Decreased from 10 to 7
– Minimum navy size for the AI to bother with an admiral
————————–
Building Logic:

Forts:
– AI will REALLY want a fort in it’s capital.
– Unless the AI has its capital on an island, the AI won’t build forts on islands.
– Less likely built in land it considers as overseas.
– Less likely built if a neighbouring province that it owns already has a fort.
– More likely built in provinces with terrains that provide a defensive bonus in battles.
– More likely built in provinces with the following province modifiers:
– Arid – Tropical
– Less likely built if its development/fort ratio is less than 50. (Experimental)
– More likely built if its development/fort ratio is more than 50. (Experimental)

Coastal Defence/Naval Battery:
– Not built if another owned province boarding the sea tile already has a Coastal Defence/Naval Battery. (Experimental)
– More likely built if naval force limit is above 40 and the number of ships owned is less than 20% of the force limit.

Barracks/Training Fields:
– Less likely built if the base manpower development is less than 7,
– More likely built if the base manpower development is 8 or higher.
– Not built if there is only 1 free building slot available and their isn’t a Manufactory already built.

Regimental Camp/Conscription Centre:
– Not built if their army size isn’t 90% of their army force limit or higher.
– Less likely built if the total province development is less than 20.
– More likely built if the total province development is 20 or higher.
– Not built if there is only 1 free building slot available and their isn’t a Manufactory already built.

Docks/Drydocks:
– Not built if their navy size is less than 70% of their navy force limit.
– Less likely built if there is only 1 free building slot.
– Less likely built if their total province development is less than 15.
– More likely built if their total province development is 20 or more.
– More likely built if their maximum amount of sailors is 5000 or more and they have less than 750 sailors left.

Shipyard/Grand Shipyard:
– Not built if their navy size is less than 75% of their navy force limit.
– Less likely built if there is only 1 free building slot.
– Less likely built if their total province development is less than 15.
– More likely built if their total province development is 20 or more.

Temple/Cathedral:
– Not built if base tax development is less than 3.
– Less likely built in provinces that aren’t part of a state.
– More likely built if base tax development is 5 or higher.
– More likely built if they have positive stability.
– More likely built if they have a Crown land share of 50% and above. (Experimental)
– Not built if there is only 1 free building slot available, total province development is 20 or higher, and their isn’t a Manufactory already built.

Workshops/Counting Houses:
– Not built if base production development is less than 3.
– Less likely built in provinces that aren’t part of a state.
– More likely built if base production development is 3 or higher.
– More likely built if the province has a Manufactory or Furnace.
– More likely built if an increased local goods production province modifier is active.
– Not built if there is only 1 free building slot available, total province development is 20 or higher, and their isn’t a Manufactory already built.

Marketplaces/Trade Depots/Stock Exchanges:
– Less likely built in provinces with less than 10 total development.
– Less likely built in provinces without a centre of trade.
– More likely built in provinces with a centre of trade.
– More likely built in provinces with a trade power of 15 or higher.
– More likely built in provinces with a river estuary.
– Not built if there is only 1 free building slot available and their isn’t a Manufactory already built.

Courthouse/Town Hall:
– Less likely built in provinces with less than 10 total development.
– Less likely built in provinces that aren’t part of a state.
– More likely built in provinces with 20 or more total development.

Universities:
– More likely built in provinces with a centre of trade.
– More likely built in provinces which have the latent trade good, coal.

Manufactories:
– More likely built in provinces with a base production development of 6 or higher.
– More likely built if a Workshop or Counting House is already built.

Furnace:
– More likely built if possible.

Soldier Households:
– More likely built if a Barracks or Training Fields is already built.
– More likely built if a trade good that provides a bonus is in the province.
– Not built if province trade good isn’t one that provides a bonus.
– More likely built if the base manpower development is 12 or higher.
– Not built if total province development is below 25.

Impressment Offices:
– More likely built if a trade good that provides a bonus is in the province.
– More likely built if a Docks or Drydocks is already built.
– Not built if province trade good isn’t one that provides a bonus.
– Not built if total province development is below 20.
– More likely built if total province development is 30 or above.

State House:
– More likely built if a trade good that provides a bonus is in the province.
– More likely built if a Courthouse or Town Hall is already built.
– Not built if total development in the state is below 90.
– More likely built if total development in the state is 100 or above.
– Less likely built in provinces that aren’t part of a state.