Also, with regards to AI expansion strategy, I find that the AI on Archipelago at times will be somewhat "blind" in terms of expanding - say they spawn on an island with enough room for ~2 to 3ish cities squeezed on the corners along the coast - often times instead the AI will either go OCC or try (sometimes they are blocked however) to settle on another island/landmass.
Hmm, I haven't looked at island map expansion functions yet, I'll see if I can get around to it sometime.
- Science should be a higher priority as it is important for all victories. If we can get them to plant scientists before the renaissance and bulb them afterwards it would make a difference.
I've already implemented this in the current version in the form of situational science flavor boosts: under certain situations, the Science Flavor value of buildings, wonders, and techs gets multiplied by up to 8. The situation and the exact multiplier depend on the AI's Grand Strategy ratio (or selected grand strategy if it's turned off): for example, if the AI has a high culture GS ratio and does not have Archaeology, or if the AI has a high diplomacy GS ratio and the UN isn't active, the multiplier gets applied in full force. Other situations will only return half of the full multiplier: high culture GS with Archaeology but without Internet, high diplomacy GS with UN but without Globalization, high conquest GS and not high enough in tech compared to other players, etc. To stop the AI from crippling itself by instantly going for libraries and science wonders early on, the boost is inactive in Ancient Era and only applies at half strength in Classical Era.
Great Scientists and Great People in general are a separate matter entirely; I've already done so preliminary tweaks, but I'll definitely go back for a more thorough run later down the line.
- The AI should probably avoid piety, and more so the more civs that choose piety. If you alone have the dominant religion then it might be a decent choice but when 5 civs take piety they themselves immensely.
Policies aren't something I've addressed a lot in the current public version, but I'm definitely working on things on my end. So far, examples include: multiplying the Spaceship flavor of policies (since only Rationalism policies have Spaceship flavor) and the Science flavor of tenets by the same amount as the building/wonder/tech science flavor boost, dividing the Offense, Defense, and Military Training flavor of policies by 2 if the civ does not have any unlocked policies (to stop Honor openers), and multiplying the Happiness flavor of policies by 2 if the civ is unhappy (4 if they're very unhappy). I've also been messing around with a function that triggers for civs with Great Person UU's and multiplies all flavors for policies associated with that GP (with a second multiplication pass for policies in a branch that unlocks faith purchasing of that GP). Inserting a Religion flavor divider that triggers if the civ does not follow a religion took maybe 3 minutes after I read your post.
- Prioritize growth (see above).
- Get the early warriors to slavishly follow early workers/settlers to avoid them being snatched as this can completely destroy an AI.
- Prioritize building ranged units.
The logic for building units is still untouched, since I haven't really gotten around to upturning the super-basic (leader's flavor)*(unit/building flavor) logic that governs all aspects of production.
- Prioritize eliminating units, especially ranged units.
I found that the problem is less to do with the AI not prioritizing ranged units highly, but rather that its logic to decide when to fortify and when to attack is extremely flawed.
-Increase cost of bribing them into war.
- Make them charge significantly more or less likely to trade lump sums of gold than gold per turn
- Stop them from purchasing unnecessary luxuries/strategics.
These are diplomacy-related functions, which I am not planning on touching until I've got everything else improved significantly enough. The reason is threefold:
1) Debugging diplomacy is a nightmare compared to debugging other game systems. I can use the in-game UI to check what policies the AI has unlocked at any time or to see how well it handles attacking a city, but diplomacy stuff related-stuff requires me to keep track of 20 or so number values for each civ via .csv logging. The .csv logging part is what annoys me, as I constantly have to re-import the log into my spreadsheet viewer on every log update if I want to view things in real-time.
2) Unlike all the other AI systems that are heavily intertwined with each other, the AI's diplomacy system is almost completely isolated. It's almost like there are actually two people controlling the AI: one handling diplomacy and deals, while the second handles everything else. As a result, improving the diplomacy system does not have as visible effects, especially in AI-only games where no player is actively abusing the stuff (see: debugging is a nightmare)
3) As a result of (2) and the fact that the diplomacy system is quite game-y in nature, a lot of past AI-improving efforts have concentrated on the diplomacy AI to varying degrees of success. There are also a metric ton of mods out there that expand the diplomacy system as well, some quite popular. It would therefore be more efficient of me to leave the diplomacy system relatively untouched, allowing people to merge my DLL with the diplomacy mod of their choosing without worrying about conflicts.
A function could be implemented for the AI to call off war-plans if target is unreachable/blocked by units (if there is not one already.... the DLL code is so frickin huge -.-, only reading through a couple hundred lines per day) for a certain amount of time (but the counter would have to be kept and not reset to prevent toggle abuse).
If the "distraction" factor is too big, could always remove the "1 operation at a time" limitation for the AI (may fuzz up some of the AI assignments on the per-unit basis, since it's simply coded as "if there is no operation already; proceed", may cause units to be re-assigned back-and-forth between 2 operations).
To my knowledge, pathfinder calls can only be called for units, so you'd essentially have to run at least one pathfinder call for every potential target. While this can be done, it would not be a good idea: since any unit, city, or improvement can be a tactical target, the AI would need to run an excessive amount of pathfinder calls each turn, even more if any possible target were inaccessible to at least one unit (since the target needs to be inaccessible for attack to all the AI's units, it would then need to run a call to the target for every one of its military units). Pathfinder calls are quite expensive computationally, so AI turns would take forever if you implemented anything like this.
You don't need to "remove" the "1 operation at a time" thing: all you'd need to do is lower the "distracted" operation's recruit priority and let other operations recruit from "distracted" operations. However, the recruitment logic of operations needs to be improved anyway, so if you're already working on something like this, might as well go all the way and revamp the entire operation recruitment logic.