Bug in Religious Persecution

Autumn Leaf

Since 1992
Joined
May 9, 2016
Messages
297
Location
Melbourne, Australia
Hi guys

Playing as Fatimids and a minor bug was messing with my purges. Although the Fatimid UP is reduced unrest and instability from foreign religion and culture, after conquering the Med coast and some of Anatolia, I needed to get rid of a few religions that were, ahem, excess to requirements - namely Judaism, Catholocism and Orthodoxy (I didn't have any cities with Zoroastrianism, Hinduism or Buddhism yet). However, every time I tried to get rid of Judaism in a city with Sunni in it, it purged Sunni instead.

I'm not quite ready yet to pick a fight with every Sunni civ on the planet, so I looked in consts.py where there is a section defining the order in which the AI will persecute religions. Fatimids are Shia and Shia is the last religion defined in the list, so we need to look at the last line. As you can see, Shia AIs will persecute Sunni first.

Code:
# RELIGIONS

iNumReligions = 8
(iJudaism, iZoroastrianism, iHinduism, iBuddhism, iCatholicism, iOrthodoxy, iSunni, iShia) = range(iNumReligions)

# The AI will persecute religions in this order, depending on its own state religion (one row per religion)
tPersecutionOrder = (
    (iZoroastrianism, iCatholicism, iOrthodoxy, iShia, iSunni, iHinduism, iBuddhism),
    (iSunni, iShia, iCatholicism, iOrthodoxy, iJudaism, iHinduism, iBuddhism),
    (iSunni, iShia, iCatholicism, iOrthodoxy, iZoroastrianism, iJudaism, iBuddhism),
    (iSunni, iShia, iZoroastrianism, iJudaism, iCatholicism, iOrthodoxy, iHinduism),
    (iJudaism, iZoroastrianism, iSunni, iShia, iHinduism, iOrthodoxy, iBuddhism),
    (iJudaism, iZoroastrianism, iSunni, iShia, iHinduism, iCatholicism, iBuddhism),
    (iShia, iHinduism, iZoroastrianism, iCatholicism, iOrthodoxy, iJudaism, iBuddhism),
    (iSunni, iHinduism, iZoroastrianism, iCatholicism, iOrthodoxy, iJudaism, iBuddhism),
)

This list order should only affect the AI, but on impulse I changed the last line to place Sunni last:

Code:
    (iHinduism, iZoroastrianism, iCatholicism, iOrthodoxy, iJudaism, iBuddhism, iSunni),

Exited the game and restarted. Bingo! Problem solved, Jews expelled from Damascus.

I haven't explored this extensively, but the Sunni may have the same issue. If you're having trouble with the game targeting the wrong religion, you can try reordering the religjons in iPersecutionOrder for your civ's state religion.

Better would be to track down the bug that is ignoring the interface choice of religion to purge, but that would require digging into the code surrounding eventApply7626(self, popupReturn) in religions.py.
 
In case you're wondering why I'm purging Catholocism and Orthodoxy, not just the minor religions, well, with Principality of Antioch and Kingdom of Jerusalem gone and Krak de Chavelier built, Catholicism is no longer useful. Meanwhile, I own three cities in Anatolia and once I get my UHV in 1160 AD, I am thinking of seeing if I can add Roman Emperor to my collection of titles (I already have Sharif of Hejaz and Commander of the Faithful) - so having the Orthdox civs breathing fire at me is inevitable. I have converted Makuria to Shia, Armenia/Cilicia is gone, Georgia is weak, and I have a lot of Orthodoxy in my cities.

Somehow I've never played Fatimids past 1160 AD before, so I don't even know if the Ayyubids and Mamluks will spawn on me. The code in riseandfall.py only seems to address whether or not to kill the AI Fatimids. My best insurance against the Ayyubids and Mamluks spawning is to keep my stability Solid. Hence the purges, even though my stability is currently positive. Once I go head to head with Basil, anything could happen. :spear:
 
Woohoo, 1172 AD and no Ayyubids in sight. UHV accomplished. My armies are assembled, camped in and around Tarabulus. My empire is stable and my cities well defended. I have plenty of time to get in, take Constantinople - and enough other cities to collapse Byzantium to free up the Roman Emperor title - and get out before the Mongols arrive (from 1241 in Lesser Armenia to 1244 in central Anatolia). Since I haven't purged Sunni from any of my cities yet, the Rum have peace-vassaled to me, so with any luck I can pawn the unstable Byzantine cities off on them before my stability wobbles enough to encourage an Ayyubid spawn. What could possibly go wrong?

Of course, since I will not be keeping Constantinople, I will be Roman Emperor in name only - no protection against collapse - but that's enough. Given the uneasy demons chained in the leaky cellars of Caiiro, collapse to core is the least of my worries. While Anatolia and Mesopotamia battle the Mongol tide, I can turn my attention to collecting the Shahanshah title.
 
Last edited:
The war was over by 1183; Byzantium collapsed in 1190. Funnily enough, Rum didn't want any of the Byzantine cities I captured (not even Constantinople, at that time); fortunately the Zengids did. They ended up with Asia and Bithynia, and Thrace except Constantinople. After the fall of Byzantium, they didn't want Constantinople; but by then Rum did. As planned, I escaped safely from the Anatolian morass, taking the title of Roman Emperor with me. I captured the Image of Edessa at Izmir. I also massacred every city I took and seeded Shia in it. A couple of them must have had Sunni, because now Abbasids have -3 against me for persecuting Sunni. So be it.

I finished the war up one stability point from the commencement (a product of the capture-swap razzle-dazzle), then I dropped 14 points the very next turn. I kept going down for a while, levelling out at 25 points down. I jumped 3 points when I ditched Constantinople, then another 7 points the next turn, and kept going up after that till I passed my original stability.

Zengids are currently Solid/Very Solid, but all those Byzantine provinces are unstable for them and their civ will reach its Fall Date in 1250, just in time for its core to be ravaged by the Mongols. (I have 76 Workers and I am using some of them to "road" eastern Asuristan and western Kurdistan, to help the Mongols out. :satan:) Byzantium will probably be resurrected as soon as Zengid stability wobbles, only to be sucker-puched by the arrival of the Ottomans.

Time to rest up and plan the Shahanshah campaign. I've encountered no issues with my persecutions since changing the AI purge order.
 
Last edited:
Top Bottom