AI behavior : religions, research, alignment

Lord Yanaek

Emperor
Joined
Aug 15, 2003
Messages
1,663
Mhh, i know AI is hard to code, so i'm not complaining, just reporting.
The AI behavior seems bad concerning religions and research for religion. There is something strange with tech trading too.

I was trying out Sureshot 21 civs map. This map is a standard sized map with 21 civs, so civs are close to each other, and this probably increased some issues.

Troubles with religions were already discussed in another thread on this forum. I noticed on this map that nearly everyone switched to Fellowship of Leaves creating the "big religious block" discussed in the previous thread. Actually, only Khazads are Runes (they founded it as should happen) and one civ (don't remember which as i'm typing) is O.O. Beery Bawl founded the Order but didn't even care to switch to his own religion. Auric founded both OO and Ashen Veil. The Big Block is well present, and civs don't seem to change to another religion after they have adopted leaves, even when they should prefer another religion. I thought every religion had a different value for every civ, but that doesn't seem to work here.

Apart from that, when a civilization has adopted a state religion, it looks like it doesn't research a new one. Well Beery did, but "the One" knows why, he is the fastest researcher of this game. Evil civs however don't seem to go for Ashen Veil. This left Auric (who can't adopt a religion) research two of the 5 religions. I think Auric shouldn't research religions as he can't adopt one. Cassiel doesn't research religions, why should Auric? Actually, as Auric can't adopt a religion, it looks like he is eager to found a new one, as he don't have a state religion.

In this game, i wanted to play the Mercurians, so i got Way of the wise, than waited for someone to found the veil ... and nobody did. I researched Knowledge of the Ether and Way of the Wicked, then contacted Os Gabella to gift her those thechs so she could summon Hybo. I was unable to gift the techs, they weren't red, they were not there at all. I saw on the diplomacy screen she could research Philosophy, but i was unable to give it to her. It appeared like i had no tech advance compared to her, but i had. Why was i unable to give a tech i had to someone who had all the prerequisites?

Now Auric has founded the Veil and since he can't adopt a state religion, it will probably not spread, or it will spread wayyyyy to late. I already noticed Hyborem often comes way too late in the game. Well if evil civs don't go for the veil, he can't be summoned.

On a related note, i noticed ALL evil civs are in the bottom half of the score, while all good civs are in the top half. All of the top civs are good and all of the last ones are evil. There seem to be some issue with the AI evil civs are using.

Well i think there is some issue here. Not sure it can be qualified as a bug, but it's concerning. I was playing on the difficulty level after monarch (i think it's emperor) so the AI should be fairly competitive on this level. What's wrong?
 
as far as i know, the Illians aren't fully completed yet, Auric IS religious, he's just waiting for the god of winter and won't listen to anyone else.

besides that, i recon some civs should prefer one religion over the other (just like they have preferred civs). They could still adopt a different one obviously, but the need to have a good reason to (could be tough to code, i don't know). At the moment, the Ljos usually go for leaves, the khazad for RoK, the sheiam for AV but that's about it.
 
On that map it is easy for one religion to dominate. I just finished Ljosalfar, and I gifted Way of the Forest tech to everyone and it ended up as Only the Khazak as RoK, but I soon destroyed them! MUWHAHAHAH!

Same here. I've played a few games lately with the Order as my state religion. Pretty much everyone else adopted the Order. Almost invariably, AI-controlled Civs adopt the leading Civ's state religion. I've seen this with Runes, with Leaves, and with the Order. I tend to play Good Civs because the Armageddon Counter and related events aren't properly designed at this point, and therefore you can get royally s...wed as an Evil Civ. Having satisfied my urge to rant for the moment, I do need to play more of the Evil civs (turning off the AC for now) to see if the religious bandwagon also happens with OO and AV... more on this later.
 
I think the issue is that in Sureshot's map, everyone only has one city. So when religion spreads to an AI, its population becomes 100% that religion, so will switch, not matter what that civ's preferences are.
 
I think the issue is that in Sureshot's map, everyone only has one city. So when religion spreads to an AI, its population becomes 100% that religion, so will switch, not matter what that civ's preferences are.

you can have more than 1 religion in a town though, and expecially with 1 city it's simply a matter of additional benefits (religion-specific) which determine which religion you'll be running.
 
ya, in that i found leaves spreading fast, i think mostly because of those elven disciple of leaves being mass produced and moving around quickly with their double moves in forests.

in order to get people to switch to my religion (AV my last try), i had to declare war, beat them up, and then only give peace if they turn to AV.. which was hilarious when i did it to arendel, since it made her evil and then hell terrain spread to her land and destroyed all her ancient forests :D
 
I do understand that one city makes things different, but i think it reveals something nonetheless.

As Kael Posted in the other thread mentioned :
Kael said:
We do have religion weighting in FfH2. Meaning that individual leaders can be weighted to prefer or dislike different religions. Set high enough a leader will never adopt a given religion.

Most of the leader prefer certain religions, and that keeps them from converting to the first religions into their empire (if it isnt one they like). Basically for every city that holds a religion the leader gets so many points towards adopting it, once that value is above 0 (and higher than any other religion) the leader converts.

For example Sabathiel is +40 towards the order and -20 towards the Veil (or somrthing like that). So when he considers religions he gives 1 point to each religion for each population point that follows each religion. So he will need more than 20 population in his empire worshipping the veil before he will consider switching to it. Likewise if he gets any influence form the order he asts as if he had 40 additional population of order worshippers in his empire when choosing a state religion.

For hard limits Basium will never adopt the Veil and Hyborem will never adopt the Order. Likewise Cassiel and Auric won't adopt any religion.

So from a technical layer we are already doing everything you mentioned. I suspect you may want us to change our design to hardcode the religious preferences further than we already do, but we actually like it the way it is.
With only one city, they should switch very fast if their favorite religion reaches them, as the population for both religion would be the same, only the weighting should affect their choice. Did someone saw a civ change their religion in this map (other than being forced?). If they never change this might reveal the weighting is not working properly.
 
i sometimes notice it, but only with civs that are "pre-programmed" for a certain religion. On sureshots map, spreading FoL to the dwarfs, they'll still switch to RoK, even when they themselves didn't found it (talking about both the gold-huggers and the golem-makers). Still, a lot of human players will actively spread a (for their situation) better religion to make it dominant, even though the player only has 1 out of x cities with that religion. As far as i can see, the only time the AI does this is when that AI player has founded the religion him/her self.
 
OK, i had a look at leaderheads.xml file, and for instance Os Gabella has -5 weighting to the Order and +10 to the veil. In my game Os Gabella has Leaves and Veil in her only city (i was finally able to give her Corruption of Spirit after i researched it myself) but still she does'nt switch :sad:

The city is size 8 or 9, something like this. i'm not sure i understand how the AI decides for a religion, but i think it looks at how many population has adopted the religion : so for a size 8 city, it's 8 points for that religion. If this is correct, leaves should have a weighting of 8, and AV 18 (8 pop + 10 from leaderhead). If population is divided between religions, then it would be 4 vs 14, and if only the number of cities is considered it would be 1 vs 11. Either way the veil should be more attractive to Os Gabella then the leaves, so she should switch. She doesn't.

Does someone in the team know how religion switching (and not only the first choice) is made by the AI. Does the current state religion have added weight, or is the 1 turn anarchy preventing AIs from changing religion? Is this a normal behavior for the AI or is something buggy with the religion weighting?

Something related. I'm considering adding Trade as a prerequisite to Open Borders agreement. This could give different civilizations some time to research their favorite religion before they are contaminated by some crazy elves running through the trees :p However, i have no experience in editing xml files. Could someone tell me where the diplomacy agreements are (in which xml file)? Also are all the available xml files accessible directly or are some of them hidden in the mod's pak file?
 
[...]
I'm considering adding Trade as a prerequisite to Open Borders agreement. This could give different civilizations some time to research their favorite religion before they are contaminated by some crazy elves running through the trees [...]

But thats a big minus for Neutral Civ, the open borders agreement is a nice early boost for relation with aligned civs.

What I dislike however, is the fact that is no way to "soften" a civ to open border agreements, while once you get it, if you want you'll make buddy-buddy with them.

Id prefer to have more steps in diplomacy
 
Bob,
Something related. I'm considering adding Trade as a prerequisite to Open Borders agreement. This could give different civilizations some time to research their favorite religion before they are contaminated by some crazy elves running through the trees However, i have no experience in editing xml files. Could someone tell me where the diplomacy agreements are (in which xml file)? Also are all the available xml files accessible directly or are some of them hidden in the mod's pak file?
I did this recently, it's easy.
Go here:
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Fall from Heaven 2 025\Assets\XML\Technologies
open CIV4TechInfos.xml with notepad,
press ctrl+F, find <Type>TECH_EXPLORATION</Type>
find
<bOpenBordersTrading>1</bOpenBordersTrading>
change the 1 to 0

repeat for the technology that you want to enable opoen borders (I tried writing before, I think it is a bit of an improvement) and change the 0 to 1.

I was even considering making open borders enabled by either honor or deception, but that may be a little late.
Consider making a back-up if you change anything, though.

OK, i had a look at leaderheads.xml file, and for instance Os Gabella has -5 weighting to the Order and +10 to the veil. In my game Os Gabella has Leaves and Veil in her only city (i was finally able to give her Corruption of Spirit after i researched it myself) but still she does'nt switch

The city is size 8 or 9, something like this. i'm not sure i understand how the AI decides for a religion, but i think it looks at how many population has adopted the religion : so for a size 8 city, it's 8 points for that religion. If this is correct, leaves should have a weighting of 8, and AV 18 (8 pop + 10 from leaderhead). If population is divided between religions, then it would be 4 vs 14, and if only the number of cities is considered it would be 1 vs 11. Either way the veil should be more attractive to Os Gabella then the leaves, so she should switch. She doesn't.

Does someone in the team know how religion switching (and not only the first choice) is made by the AI. Does the current state religion have added weight, or is the 1 turn anarchy preventing AIs from changing religion? Is this a normal behavior for the AI or is something buggy with the religion weighting?
I've noticed this exaclty, I'm not sure why. I've tinkered with these numbers, sometimes it seems effective, sometimes not. Non-spiritual leaders have to wait 10 turns before switching, of course, and it wouldn't show up until after anarchy. But I think there may be something more, such as factoring diplomacy with other leaders or effects on civics or something. We will probaby edit these numbers in the next version, at least to account for new religions and maybe alter existing ones as well.
 
would be nice if Open Borders was split into 3, 1 for trade, 1 for units to pass through borders, and 1 for units to pass through units (always hate how theres there way to block a competitor AI using your units aside from declaring war, use to be able to do it in civ1)
 
Not sure if you CAN code it, but if you DO code it, make sure to give full open borders clearance to the Barbarian trait people. Otherwise Rantine won't be able to move onto a city tile and convert it.

And remember it works both ways. Sure, you can block them now, but now if they are standing on your road when you try to move across you have to go cross country around them, typically adding 2-3 turns to any major movement if your cities are spread out.
 
The city is size 8 or 9, something like this. i'm not sure i understand how the AI decides for a religion, but i think it looks at how many population has adopted the religion : so for a size 8 city, it's 8 points for that religion. If this is correct, leaves should have a weighting of 8, and AV 18 (8 pop + 10 from leaderhead). If population is divided between religions, then it would be 4 vs 14, and if only the number of cities is considered it would be 1 vs 11. Either way the veil should be more attractive to Os Gabella then the leaves, so she should switch. She doesn't.

Does someone in the team know how religion switching (and not only the first choice) is made by the AI. Does the current state religion have added weight, or is the 1 turn anarchy preventing AIs from changing religion? Is this a normal behavior for the AI or is something buggy with the religion weighting?
IIRC, pop are not distributed equally between religions... I think it is as for culture in conquesered cities... but it is a number calculated that we never have access to. so :
FoL for 7pop, then AV and FoL for 2pop (pop risen from 7 to 9 after the city got AV)
the 2 new pop are either : 50% : 1FoL and 1AV or 2FoL (if being state religion increase chance of pop conversion -no idea-: 70% chance and random sucks in cIV )
in the end you have : 8-9FoL 11-10AV : maybe a weight of +3 or +1 in favor of AV is not enough to counter balance 1 turn of anarchy,
it may even be lessen if she has temple for FoL and not for AV, or if she has friends with FoL and don't want to have issues with them
 
Back
Top Bottom