Simple is the key, because even the best ideas are worthless if it's a pain to make them work in the game! I'm no programmer (literally, I haven't a clue), but a starting point would be something like:
Turn=[Arab start]
VAR=MECCA
(Coordinates of Mecca)
VAR=CITY
(Any city, not Arab, obviously)
IF: CITY within # tiles of MECCA
THEN: Delete CITY
SpawnCiv=Arabia
SpawnUnit=[Arab starting units]
(So any city too close to where the Arabs' settlers and starting units spawn get deleted before Arabia's units spawn. Now to see if any cities flip.)
Turn=[Arab start]+1
(Negative integer values)
VAR=UNHAPPY.CITY
(total discontent of a given city)
VAR=CAP_DIST.CITY
(distance from capitol of a given city)
VAR=TOTAL_MAINTENANCE.CIV
(total maintenance costs of ALL cities)
VAR=PAST_BARB_ATTKS.CITY
(#
of barbarian attacks on the city)
VAR=FOREIGN_WARS=[{units in enemy territory} - {units in home territory}] / [total # of units]
(Positive integer values)
VAR=GARRISON.CITY
(#
of units in the city)
VAR=CULTURE.CITY
(culture in city)
VAR=CULTURE_RATE
(culture rate of civ)
VAR=DIPLOMACY
(some measure of diplomatic relations of civ with others, maybe total attitude of other civs, so either positive or negative)
VAR=TECH
(difference in technologies between civ and spawning civ)
VAR=CITY.OWNER
(Determines who owns city)
VAR=CIV
(Civ that controlled city originally)
IF: CITY within # tiles of MECCA
AND: CITY is > 1 tiles from MECCA
AND: UNHAPPY.CITY + CAP_DIST.CITY + TOTAL_MAINTENANCE.CIV + PAST_BARB_ATTKS.CITY + FOREIGN_WARS + GARRISON.CITY + CULTURE.CITY + CULTURE_RATE + DIPLOMACY > [some flip value, to be determined through testing]
THEN: CITY.OWNER=Arabia
ELSE: CITY.OWNER=CIV
THEN: SpawnUnit=[additional war-time and/or missionary units for Arabia]
So by turning all these concepts into integer numbers and adding them together, we have a measure of whether or not the city will flip! Also, because of the range of flipping, even cities like Thebes will be in danger of flipping, technically, but probably wont (of course you could add another two lines that say "IF: CITY=CAPITOL.CIV, THEN: CITY.OWNER=CIV").
So there is a choice, but it's latent. You have the choice of expanding aggressively early on, and risk losing some of your far-flung cities to spawning neighbors, or slowly building up your empire to safe-guard against it.
And to guard against people taking last-minute action to save their city, like upping the culture rate and garrisoning it with units the turn before, you can even add modifiers before each value, and make the "flip" line look like this:
UNHAPPY.CITY + CAP_DIST.CITY + TOTAL_MAINTENANCE.CIV + PAST_BARB_ATTKS.CITY + FOREIGN_WARS + 0.5 * GARRISON.CITY + CULTURE.CITY + 0.5 * CULTURE_RATE + DIPLOMACY > [flip value]
These modifiers themselves can be tweaked and adjusted forever, even to suit different players or Civs!
The only reason I would advocate something this complex, that requires SO much testing, is because it feels like a critical point of the game. If the city-flip-on-spawn is made fair and balanced, it could be one of the defining features of the mod! It basically judges overall gameplay of a player, and rewards/hinders them accordingly. And with the additional units, the non-Arab player will have to be VERY careful around Saladin, with his larger army. Arabia will meanwhile be set to start conquering her unprepared foes.
Also note that this is UNIVERSAL. While I used Arabia as an example, one could easily replace MECCA with WASHINGTON or even CAPITOL.SPAWN_CIV, and Arabia with SPAWN_CIV. So these same variables could apply to multiple civs/cities.
Thoughts, questions, comments?
As for my short foray into 049b, I played Persia and got CREAMED by barbs later on. Expanded into the Middle East quickly and fended off a few barb attacks from Turkey and the Caucasus Mountains, also noticed that Egypt was COMPLETELY destroyed! Two barb cities with HIGH culture instead, they had founded Hinduism and Buddhism respectively. Made some brief attacks on them for a bit, then 3 barb horse archers appeared VERY close to my capitol, in an unguarded hole in my territory. They destroyed my two defending horse archers, razed a city, and killed an archer in my capitol. Luckily I had rushed another one and was producing a third when reinforcements from the home front showed up, but by that time I had already lost a worker and most of my improvements, plunging me into debt.
I'll be more careful next time, but I think I'll try India instead.
SilverKnight