• 📚 A new project from the admin: Check out PictureBooks.io, an AI storyteller that lets you build custom picture books for kids in seconds. Let me know what you think here!

Missionary Production

OrionVeteran

Deity
Joined
Dec 25, 2003
Messages
2,443
Location
Newport News VA
Once 3 religions are found in the early game, those AI Civs, who did not get a Holy city, usually adopt a religion founded by someone else. Even if these AI Civs found a Holy city from one of the remaining 4 techs latter on, they usually don't convert their religion to match the Holy City just founded. This is not the optimal scenario for a Limited Religions game.

Question 1: Is there a way to code a function to get AI Civs to change their religion to match their Holy City religion, after the Holy City is founded?

An Approach that might work: Have the AI start producing missionaries matching the newly acquired Holy City. When the religion has spread to enough cities, then the game will automatically convert the AI to the Holy City religion, without any other code intervention.

Question 2: Is there a function available to get an AI Civ to produce missionaries that match their newly acquired Holy City religion?

The Desired Result: In a large game, 7 Civs would all have only one Holy city. Each Civ's missionaries would spread their respective religions to all of their respective cities. In the middle game, you would have 7 Civs, each spreading their respective religion to all of their own cities. Everthing works as normal for all civs beyond these 7.

Orion Veteran :cool:
 
Question 1: Is there a way to code a function to get AI Civs to change their religion to match their Holy City religion, after the Holy City is founded?

I guess, that's AI dependend.
In normal BtS, i've seen Justitian convert to his holy city religion, after i've converted him in the early game. It just depends on how the new religion is spread, and how much missionaries the AI builds.
 
I guess, that's AI dependend.
In normal BtS, i've seen Justitian convert to his holy city religion, after i've converted him in the early game. It just depends on how the new religion is spread, and how much missionaries the AI builds.

I really don't want to leave it up to the AI, as the proposed function would help spread the faith of the Holy City by stepping up the production of Missionaries. Once the majority of Cities have the Holy City Religion, the AI will convert over to the Holy City's religious influence.

Orion Veteran :cool:
 
I can think of two ways to encourage Missionary production :

1)Edit the AIs production decision making in the SDK.
The place to start would be : void CvCityAI::AI_chooseProduction() in CvCityAI.cpp


2)Increase the iAIWeight values for missionaries. Unfortunately, this will lead to not just increased spread of a religion that the AI controlls but of any religion that they posses.

An alternative might be to just give several free missionaries when founding a religion to get a jump start on spreading.
 
I can think of two ways to encourage Missionary production :

1)Edit the AIs production decision making in the SDK.
The place to start would be : void CvCityAI::AI_chooseProduction() in CvCityAI.cpp

I definitely want to avoid any SDK changes in order to maintain compatibility with other mods.

2)Increase the iAIWeight values for missionaries. Unfortunately, this will lead to not just increased spread of a religion that the AI controlls but of any religion that they posses.

By this I assume you are refering to the value in XML for:

<iReligionSpread>40</iReligionSpread>

Nice thought, but not practical, as I only want to affect those Civs who don't own the Holy City for their state religion, but have just founded a non-state Holy City.

An alternative might be to just give several free missionaries when founding a religion to get a jump start on spreading.

This would be unfair to the Civs who found a religion early. They had to produce all of their missionaries, while these latter Civs received them free on a silver platter. Nope. ...not going to do that. I'm convinced python is the way to go, by encouraging the Civ to produce Missionaries with the matching religion of the new Holy City founded.

Orion Veteran :cool:
 
By this I assume you are refering to the value in XML for:

<iReligionSpread>40</iReligionSpread>

Nice thought, but not practical, as I only want to affect those Civs who don't own the Holy City for their state religion, but have just founded a non-state Holy City.

No, I meant iAIWeight. It is a flat modifier in the AIs production decisions. Higher number = more likely to be chosen. Of course, since it has effects beyond what you desire it doesn't matter either way.


This would be unfair to the Civs who found a religion early. They had to produce all of their missionaries, while these latter Civs received them free on a silver platter. Nope. ...not going to do that. I'm convinced python is the way to go, by encouraging the Civ to produce Missionaries with the matching religion of the new Holy City founded.

I meant give them to all foundings, not just for the later ones (who already get one as a balancing factor).

As for Python, it can't 'encourage' production. The closest you can come is force missionaries into the build queue. To do so, you have two choices :
1)Replicate all the work in the SDK function I mentioned with added modifiers for missionaries and when the Missionary result comes up add it to the queue.
2)Periodically force a missionary into the queue without regard to whether it is the right choice for that city at that time.
 
FWIW, I have done #2 to force the AI to build a certain building; using iAIWeight did not have a strong enough effect for me. You start with AI_chooseProduction in CvGameUtils.py and you end with:

pCity.pushOrder(OrderTypes.ORDER_CONSTRUCT, iBldg, -1, false, false, false, true)

If the middle part is not clear, post your questions and we can go further.
 
Back
Top Bottom