@xyx: Thanks for your thoughts.One fundamental source of instability is that the AI war evaluation is based on a single predicted outcome of the war. That means, any tiny change in the power ratio can tip the scales on whether the AI believes that a war is a stalemate or will lead to the conquest of a city. Considering multiple trajectories, as simulation-based algorithms normally do, would take too long. However, I could actually implement two trajectories (one slightly optimistic, one slightly pessimistic) for situations when performance isn't an issue, e.g. so long as an AI civ knows fewer than 100 cities. I think, in the late game, outcomes tend to be clearer (greater disparities in military power) anyway.
Another fundamental change I've been considering is to move all AI decisions about trades offered to humans and deal cancellation to the start of the human turn. Currently, AI offers are locked in during the AI turn, and several other civs may take their turns before the offer is put to the human. So the AI may cancel a deal and lose access to another resource before the cancellation popup gets shown. Ideally, any AI-to-human offers should immediately result in a diplo popup. That'll require some trickery as the EXE is responsible for showing diplo popups. I'm not sure if the turn order is the only cause of erratic deal cancellation. How often do you reckon it happens per game?It's intentional that the overall power ratio hardly matters when the AI doesn't believe that the war enemy can reach its cities within 25 turns, or when it believes that the cities will be of too little value to the enemy to bother. The AI can't be certain of this, but erring on the side of not paying for peace when there is no imminent danger seems reasonable to me because a powerful enemy may well attack again 10 turns later or at any convenient moment. Also, a civ that has lost its core cities doesn't have much to lose. It should still try to survive of course, but, in general, the more an AI civs falls behind, the more willing it should be to take risks.
Asking for payment after losing cities seems a bit too audacious but is perhaps not really an issue if the demanded payment is a negligible expenditure for the winner.It may well be that the AI fails to recognize this sometimes. A screenshot (or savegame) might be helpful here and also for the refusal to capitulate and anger in conquered cities. I rarely win games through Domination, so it's possible that wars of conquest in the late game are more frustrating than I realize. In any case, I already have an AI function for evaluating (simply based on the power ratio) the abstract possibility of an enemy invasion past the 25-turn time horizon of the military analysis. It's currently only used for deciding whether to start a war, but it would be easy enough to (optionally) also take it into account when computing the peace terms.So far so good. Having a sufficient number of units within the AI's borders is a prerequisite for capitulation. The idea is that the AI only capitulates at gunpoint. After you've just taken a city, even if you're very powerful, who knows if you'll bother (war weariness, maintenace, supply, other potential wars) to conquer another. Perhaps you were already aware of this behavior; anyway, I should probably add a loading-screen hint about it. Also, an XML option for disabling the boots-on-the-ground check would be easy for me to implement.Well, that's not good.

I think of it as emigration -- of course, they never arrive anywhere because the game lacks a migration mechanism, and when there isn't even any nearby city to take the immigrants in, then this fiction really doesn't work.

I think the way it works currently is – for a worst-case example:
A size-20 city with 100% culture of the former owner receives
40%*100%*20=8 anger

from "being ruled by a foreign culture" (formerly "yearn to join our motherland") when the borders are open – as in BtS (well, I guess BtS would round down to 7). When the borders are closed (doesn't matter in BtS), it's 150%*40%*100%*20=12 and, when at war, 200%*40%*100%*20=16 (12 or 11 in BtS). 12 anger after making peace should lead to a loss of more than half of the population only in rare circumstances. 16 is indeed a lot.

Setting
CLOSED_BORDERS_CULTURE_ANGER_MODIFIER to 25 would reduce that to 14 and hopefully wouldn't affect smaller cities much because the current anger seems about right for those.That's an unintended side-effect, but I thought it's kind of flavorful that Barbarians can take advantage of wars between civs. The units could also be marauders. The fogbusting change can be reverted by setting
MIN_BARBARIAN_STARTING_DISTANCE in
GlobalDefines_advc.xml back to 2.
As for "more barbarians in the early game": High on my to-do list is to decrease Barbarian spawning near tiles where they have recently been spawned or killed. I do think that too many Barbarians spawn in the late Classical era and beyond when the civs don't get all the land under control.