At the time I thought there was some sort of modifier to the RNG that would kick in randomly and favor the AI, but your idea about an "irritant" program sounds possible, too. It would explain the periodic AI superman units which are highly irritating.
I'm now absolutely convinced that the AI tactics tie in with War Weariness rather than specifically combat. I've called it tactics but superman miracle Units can't really be called tactics, it's more accurately an AI-only exploit.
The "threat assessment" or "enemy weakness assessment" portion of the AI programming seems to be very good.
Yes indeed, and I'd go so far as to say it sometimes knows what we're doing before we even do! Lol.
How this game panned out in fine detail:
Monarch. Large Archipelago. Playing as the Dutch (for food bonuses if stuck on a desert & no river start, which I was).
My island turned out to be relatively small. Not to worry, I thought, I've won on Regent from starting on an 80% Jungle tiny island before. So I start pumping Settlers. While I'm filling up my island I make a few Curraghs to see what else is about. I immediately find two islands next to mine, one almost pure Mountains (directly to the south), one pure Grassland (directly to the right). Both could cope with either 3 or four Cities. I immediately start planning for their settlement.
A couple of turns later I discover another island is adjacent to the Grassland island, a large one with another Civ on it. It's Portugal
and I immediately realise I'm on for an early Seafaring competition. Not to worry, I have a huge tech lead and will probably have a good time advantage. Oh how wrong I was.
I had soon filled my island (which had two cows on Grassland right at the furthest point from my capital) and endeavoured to land a Settler at the southern most point of Portugal's island which, by careful application of cities, I could culturally link up with the Grassland island and my main island.
Meanwhile, my Curraghs were still exploring and I found I had the Maya to my north (relatively, but not dangerously, close) and the Zulu to the right again of the Portuguese (again, close, but not dangerously close). Needless to say, none of them had anything I wanted after the initial exchange of techs and I put them out of my mind.
When I landed my Settler on the Portuguese island, landing on the spot I wanted to settle, what should I find waiting? I find a Zulu Impi and a zulu Settler literally adjacent to my Settler/Warrior. Not Portuguese, Zulu. They moved into view in the interturn after landing. Luckily they were being harassed by Barbarians and I managed to make my city the next turn. I start building a Temple to ensure it never falls victim to a cultural conversion.
Now for those other islands. In a mere couple of turns I have a Settler on a boat and heading for the Grassland island. My boat is two squares from landing and in the interturn a Portuguese Galley comes steaming out the fog and lands a Settler on the island. Undeterred I land my Settler and make the first connection to the currently isolated city on the Portuguese island. The Portuguese settle at the northern-most tip of the Grassland island. I get the final spot which does indeed link me up culturally all the way from my island to the Portuguese-settled city.
Likewise, at the same time, I'm in the process of making Settlers to land on the southern Mountainous island. On the turn before my Settler is ready to set sail, a Portuguese Galley comes roaring out the fog and lands a Settler/Spearman on the northern most tip of this island. I end up getting the two southern-most position, the Portuguese the two Northern-most positions.
While this is going on the Zulu grab an island to the north of the Portuguese, an island with Incense. This island is so close to the Portuguese land mass and so small it would be the equivalent in context to Manhattan Island in the US or the Isle Of White in Great Britain. While all this is going on, I'm starting to spam Catapults, Swiss Pikemen, Medieval Infantry, Galleys in preparation for the invasion of Portugal and the 'neatening up' of the two smaller islands.
Irritation points so far:
Once again, three different Civs, all running at different speeds with different terrain hindrances/benefits, all manage to land Settlers AT EXACTLY THE SAME TIME.
The Portuguese appear more interested in undefendable Irritation city placement than actually, initially, settling their own damn island, even when Luxury Resources are at stake.
Back to the unfolding events:
A few turns after buying my Temple and expanding the borders of the city on the Portuguese island, two Zulu Impis come wandering into its borders. I ask them to leave of declare war. They declare war. They die.
The very next turn a spam load of Portuguese Units appear from out the fog. I am about to lose my foothold on the Portuguese island. I ask the Portuguese if the want to ally against the Zulu for a tech and they accept. Then the next turn they invade my city and declare war on me.
At the same time the Maya make a demand for 'this-that-or-the-other' and I tell them where they can stick it. The Maya declare war.
The fairly large stack of Catapults, Medieval Infantry and Swiss Pikemen are now having to be separated all over the shop to cope with an almost unceasing bombardment of single Unit drops left-right-and-centre and the planned invasion, which was about 5 turns from landing in the borders of my pre-prepared foothold is now delayed by 20+ turns, my War Weariness starts stacking up to the point where, by the time I do land, I am running an economy of 10% Science, 40% Luxury, 50% Tax.
It is at this point where the 'Miracle' Swordsman lands on the fully conquered Grassland island and survives a triple assault from an Elite Medieval Infantry, Veteran Medieval Infantry and Veteran Swiss Pikeman. The Maya never showed up but the Zulu were quite happy to drop Irritants here and there at the worst possible moment.
I would have been delighted to declare peace with the Zulu, but by that point I was in the catch 22 of needing their War Happiness.
Some additional Irritation points:
The city that the Portuguese settled on the Grassland island stayed at size 1 for 'ever' whereas the cities the Portuguese founded on the Mountainous island (settled on Tundra) very quickly rose to size 2. This was deliberately done to either make me build yet more Settlers or delay my ability to capture and retain the city which the AI, obviously, knew was going to be an easy take.
I still find it an utterly infuriating aspect of the game that, even when a whole Age in technological advancement, one still can't produce any naval vessel (Unique Units aside) which can be 'guaranteed' (cough cough) to take down a Galley. Having to plan the 'sacrifice' 3 or 4 Galleys for each one attacked is utterly crazy, especially when AI Civs can make them in a couple of turns. Naval dominance should be an option for any Age, not just Industrial+