Spoiler: Scary code... Code: light_armor_default = { target_width = 19.9 width_weight = 0.1 column_swap_factor = 0.1 stat_weights = { <snip> } target_template = { weight = 0.9 support = { engineer = 1 recon = 1 artillery = 1 } regiments = { light_armor = 4 motorized = 5 infantry = 1 } } allowed_types = { <snip> } replace_at_match = 0.9 replace_with = medium_armor_default }

replace_at_match = 0.9

replace_with = medium_armor_default



This is an example from the light armor template, which will change to the medium armor template once it has a match of 90%.



Do note that the "entry point" of a template must follow the naming convention given (for example 'light_armor_default'), but after that it should work with any name at all, meaning those templates would not be picked by AI in any other way than through the scripted progression. The important bit here beingThis is an example from the light armor template, which will change to the medium armor template once it has a match of 90%.Do note that the "entry point" of a template must follow the naming convention given (for example 'light_armor_default'), but after that it should work with any name at all, meaning those templates would not be picked by AI in any other way than through the scripted progression.

Hi everyone! It's been a very empty office this week between gamescom and sickness (I'm starting to wonder if the CK2 team is testing their new plague expansion stuff on us!) but we've still managed to get some stuff done on the Sunflower(1.2) patch.As many of you have noted port strikes are very hard to defend against and feel unbalanced. You can now only perform port strikes if enemy air superiority isn't above a certain level (30% is what we are testing atm), basically it means there needs to be no defenders or you need to have air superiority for the mission to perform at all. We are also adding stacking penalty in the same way land combats work, to simulate that there just isn't enough room for 1000 bombers to strike the same small fleet. We have also been looking at some other naval issues, but more about that in the future.The main focuses this week for AI has been making sure ai upgrades its templates better and naval missions.The naval mission AI should now use the ships at its disposal much better and prioritize defending invasions. The issues with Ai creating long invasion plans it could not cover and never managing to invade japanese home island shouldn't happen anymore now for example. It also had a tendency to be overly protective of areas with convoy raiding leading to very nonoptimal fleets being organized for hunting.When it comes to division templates SteelVolt managed to squash some bugs related to switching them out and we now have a scriptable progression system for the AI to use. It was for example not able to realise that it could progress its light armor templates to medium armor templates before. I imagine this will be very welcome among modders as well to be able to custom tweak nations. For those who dare to look at code, here is an example:If you don't spend all day looking at code, the above basically translates into more interesting AI opponentsOther AI improvements we have been working on this week is improving its avoidance of small encirclements and making sure it can handle building of nuclear reactors for late game, so beware nukes flying. Next week for ai we plan to focus on many minor issues to improve AI performance, like making sure it doesn't tie up too much equipment in training when it needs it in the field to help with casualties.The plan for the patch is to be able to release it (as a open beta first) in 2-3 weeks barring any outbreaks of plague. Next Friday we'll have some more updates for you as well as talk about some new additions that will be in the patch: