ченджлог до 1.2.5
Summary of changelog since revision 196:
Trade
Fix: Countries will cancel exports if their balance is that negative they would run below minimum stockpile in one month.
Fix: Countries will import if stockpile reaches zero.
Fix: MinTradeSize will also depend on MaxIC not only TotalIC, because TotalIC will drop if stockpile drops to zero.
Seller score for a trade deal will be at least 50% if trade amount is ok for seller. Fixes issue minor countries unable to find stable trade partner for energy or metal. Diplomacy
No more new alliances between faction and non-faction members.
No more counter influencing of countries with IC < ai_configuration.MINIMUM_IC_TO_INFLUENCE.
No more influencing of puppet nations.
Puppets are not allowed to invite or influence as long as trading for puppets is disabled.
Included territorial claims to influence score. Stops for example Italy or Hungary from influencing Yugoslavia.
No alliances across different continents.
If factions are at war with each other and yet neutral country is in between they'll only join one of those factions if they think they can deal with it (not getting crushed immediately by one of them).
Self aligning is based on same calculation than faction joining. So countries will only start to self align if they really really want to join that faction. This of course could change if war breaks out since borders are probably (or better hopefully?) redrawn.
Neighbors are only neighbors if their capital location is on the same continent.
Only create alliance if not looking to join a faction.
Influence AI has been completely rewritten. The decision if a country should be influenced is based on five factors:
Alignment distance: like in vanilla, only countries which are close to a faction will be influenced.
Neutrality: The lower a country's effective neutrality (= own neutrality minus highest threat) the higher the chance that country will be influenced by faction members.
Economic factor: The higher a country's IC compared to the IC of the faction leader the better. Lower IC will result in a higher weighting of its natural resources like energy, metal or oil it could provide to the influencing country. Only resources the influencing country is short on will be considered, so oil rich countries like Persia or Venezuela will be become very juicy targets when war breaks out.
Diplomatic factor: How good are the relations between the country influencing and the country being influenced. Territorial claims will have very bad effects (this was a good trick to get it into the head of countries like italy that yugoslavia isn't their best friend...). These relations can be improved with trade and worsen by threat.
Strategic factor: Countries are treated as strategic important by the AI if one of their neighbours are in another faction or at war with the influencing country. Another important aspect is if they are neighbours to the influencing country and if not if one of their neighbour is a neighbour to the influencing country so it would open up a new front. Based on these decisions it will be calculated dependend on IC how much "damage" they could inflict on the potential hostile country.
Countries will align themselfs towards a faction if they want to join that faction and have low enough effective neutrality. This depends on how close they are aligned to the faction and if not close how much they like the faction's members and how victorious the faction is in terms of victory points.
If these factors are high enough it will also be considered if it's wise to join that faction in terms of survival. If a country's neighbours are of another faction and have much more IC than the country itself it'll probably be not the best idea. If all neighbours are at peace the AI will compare it's own IC together with the IC of neighbours in same faction (friendly IC) against the IC of neighbours in other factions (hostile IC).
If one of it's neighbours are at war with the prefered faction only it's own IC will be compared to that neighbour, because joining the prefered faction would drag the country into a full scale war they probably won't survive. And to the AI the survival of its controlled country should be more important than the survival of the faction.
Production
Fix: Puppets will set their supply need to distribution need instead of stockpile need. Manchuko and other puppets will build up armies again.
Province improvements will by default be built in home continent.
Balanced province priorities of UK and JAP.
FRA and POL won't build any province improvements anymore to be at least of some resistance against GER.
Reverted JAP to default settings (spend less IC to province improvements).
Tech
Fix: LS was wasted in research, because a new research slot is only available if LS >= 0.5. Put LS < 0.5 to diplo/espionage/officers depending on need.
Intelligence
Removed spy priority for countries on same continent.
Added spy priority for neighbors.
Higher priority for major neighbors.
Added highest priority for countries we're preparing a war against.
Changed spy priority in war time. Highest priority have those countries we're preparing a war against. Then come hostile majors and then hostile minors. Rest has priority zero.
Political
Fix: Vanilla mobilize code was a little weird. Countries only mobilized if they thought they are strong enough to attack, but actually the purpose of mobilizing was to defend against a possible attacking country.
GER will mobilize if it is later than June 39 and not at war yet.
Switch back to consumer orientated industrial policy laws if at peace. Don't stay with heavy industry.
Country specific AI
Fix: Typo in ProposeDeclareWar. Script crashed causing GER never declaring war on YUG or SOV.
GER will declare war on low countries if year > 39 and month > 5 even if not yet dealt with NOR/SWE/DEN. Fixes issue that GER never declares war on low countries because for some reason it doesn't attack DEN sometimes.
Performance
Increased delay for HandlePeace and HandleWar (expensive functions).
ченджлог до 1.3.0
Full changelog since 1.2.5
Trade AI
Country is rich if only importing supplies and still having positive money balance. Allows better manual selling of supplies to rich countries like USA in beginning of the game.
The smaller a country the more less likely trading functions will be called (tiny little performance improvement).
Trading between puppets and their masters is allowed again (was bugged in 1.2).
Diplomacy AI
Axis members won't influence countries with less than 10 IC anymore.
Influencing more strongly based on ideological groups (axis, allies, comintern).
Fix: Script crashed on pearl harbor.
Added 1.3 PI changes (JAP declaring war on SOV if SOV at war with GER and not enough troops on SOV/JAP border).
Don't influence nations >= 90 neutrality.
Only faction leaders are allowed to influence nations on another continent.
Balanced influence system.
Production AI
Reduced default probability of building province improvements by 5%.
Production AI didn't build mountain divisions due to wrong naming (bergsjaeger instead of mountain).
Reduced convoy/escort buffer size, because number of convoys needed for trades were much reduced in 1.3
Fix: Production AI crashed under some circumstances.
Removed artillery brigades from marine division templates. Has -80% amphibious attack. Thanks to quetzilla.
Intelligence AI
Fix: Typo in intelligence minister caused random crash.
Fix: Intelligence AI crashed when dealing with exiled countries.
Home spy mission can change once per month (previous was actually once per two months)
If neutrality is below 60%, and unity is below 70%, the country will try to raise national unity to enable higher draft laws.
Countries with less than 10 base IC won't bother lowering neutrality for economy laws. There's really no point for Liberia, for example, to move to War Economy, and most micro powers don't have the resources to support more IC.
There's a 33% chance that minors (< 20 IC) will Support Ruling Party as their home mission, because minors don't need to be as concerned with espionage and international affairs
Priority at home is also based on < 20 IC get 1, 20 to 100 IC get 2, and > 100 IC get 3. This gets +1 if at war, and then has a 50/50 chance of getting -1 just to add some variation, but won't go below 1.
Approximately one month out of every year each country will set priority to max and do counterespionage for a month, just to keep enemies on their toes.
Countries won't do any mission in allied countries (as China, Guangxi clique was always disrupting my research which was dumb). They'll still send spies though because who knows if an alliance will last?
If a country has claims on another country, they will increase the enemy's threat so that they can declare war sooner.
If there isn't anything else special to do (such as supporting resistance or trying to engineer a coup, existing code I didn't change), then spy missions are chosen based on relative IC with a random factor built in. What this means generally is that countries generally won't harass larger countries, and majors won't bother with minors because minors don't really matter to them. But minors are free to mess with other minors they don't like, same with mediums and other mediums, or mediums against minors. Depending on the relative size (by IC) either 'passive' or 'active' spying is chosen, and then a mission is chosen at random from a list of active missions or passive missions. Active missions include disrupt production/research, as well as spying on military/tech or lowering unity. Passive missions are either info (political/tech/military), or boosting their own party, with a 50% chance of not doing any mission.
I made a function to tell if countries are 'ocean neighbors' which is a hard coded lists of countries that are close to another country but don't share a land border, for example China and Japan (pre-invasion), or England and Belgium. Also included are less obvious ones like Japan being 'ocean neighbor' to USA, because really, there's no one else in the pacific :P. So it adds some connections across the atlantic/pacific. These neighbors are also considered for spy missions.
Less spy priority for countries that are puppets or allies, and no priority if a country is the country's own puppet, or the country's own overlord.
Priority is set to 0 and spy missions are canceled if the country is at more than 80% surrender level. This is to help stop the bug where spies from annexed countries are still active and unkillable, because they should tell all their spies to stop being annoying before they surrender. Unfortunately it won't work for countries that only have 1 victory point province, or some combination where they go from < 80% to annexed in one battle.
Set max priority for domestic spy missions other than counter espionage. Won't have any effect otherwise.
Don't lower neutrality if >= 90 and not a major.
Politics AI
Mobilize if a neighbour's threat to us is high enough and their neutrality low enough to declar war upon us. (Before it was our neutrality minus their threat).
Typo in ai_politics_minister.lua caused script to crash and so mobilizing did never happend.
Increased threat value threshold to mobilize to prevent USSR from mobilizing in 37 when JAP declares war on CHI.
New training law conditions based on officer ratio and manpower.
Countries won't mobilize as long as they don't have appropriate conscription laws. Manpower drain is too high.
Countries will again use three year draft laws (were bugged in 1.2).
Tech AI
Research not more than free slots are available.
As long as a country doesn't have appropriate conscription laws they won't aim for a too high officer ratio.