Removed tons of useless code and five unused memory variables (there was leftover code for "trade agreements" and other untradeable items, plus unused vanilla code, that was taking up around 2,500 lines of code)
AI should no longer agree to start additional wars if they are already doing badly in an existing war or in general (very unhappy, bankrupt, lost their capital)
AI now has an aggressor flag in memory that sets whether or not they WANTED to start the wars they're currently involved in. So if they declare war, it is set to true. If they were planning on it and you declare war on them first, it is also set to true.
- Aggressor flag decreases reluctance to conquer cities and makes the AI less likely to make peace
AI now has a function to identify "phony wars" that they have no interest in waging, especially if they were declared on rather than the other way around. If it considers itself to be in a phony war it will agree to make peace at the earliest opportunity.
Completely rewrote coop war logic for saner, cleaner code
- Removed exploits where you could chain coop wars to avoid war weariness: you are now capped at 15 turns where you cannot make peace, and when the lock is set your war duration is subtracted from those 15 turns.
- When a coop war agreement is made, you will automatically declare war after 10 turns has passed (no prompt to back out). If one of you goes to war before then, both of you will (regardless of whether you or your target declared). While this slightly sacrifices player choice, it's more consistent, much less exploitable and more strategic of a choice. The AI will benefit from this a lot.
- You can still back out of a coop war agreement by ending your DoF, denouncing or declaring war on your ally - or by making a DoF or DP with the target. All of these will be treated as breaking your promise and apply a minimum -50 penalty to diplomacy and a reluctance to agree to future coop wars. The person who broke the agreement gets the penalty, of course. If something makes the coop war invalid (like the target becomes a vassal) then it is cancelled automatically with no penalty.
- AIs now start a sneak attack operation against the target when they are preparing a coop war, and are more likely to request that others join their planned war, so you may see alliances of more than 2 civs declaring war at the same time
- Warmonger penalty for coop wars is fixed. No penalty for declaring, and penalty for conquering cities is reduced by 90%.
- You are no longer able to request that AIs declare war on their friends, DPs, or on vassals and other invalid players. The button is disabled (previously it was still enabled but asking would do nothing except potentially get you a penalty with the target AI). AIs also can't request this from you.
- Rewrote coop war desire evaluation. AIs should utilize coop wars more often, be more likely to start coop wars with players that have a track record of agreeing to their requests, and choose targets more wisely. Penalty for refusing to agree also scales based on the AI's Forgiveness flavor now (ranges from -10 to -30 to recent assistance)
Improvements to approach selection
- AI should be AFRAID less often
- AI will be far more reluctant to wage distant wars before they're able to cross the ocean, and more aggressive towards neighbors in the early game
- AIs that have agreed to a coop war or are planning an attack will now always have the WAR approach
- AIs that are NOT *currently* planning an attack will no longer have the WAR approach. This should result in saner, more strategic diplomacy.