tu_79
Deity
Hi everyone.
Ilteroi has requested some help in designing a new logic for missionaries and inquisitors. So, let's try to help him in this thread. Remember that the AI has no crystal ball to predict the next turn, so it can only works with whatever is currently going on in the present turn.
My logic scheme:
1. Choosing the religious stance and queue purchases.
2. Managing Great Prophets.
3. Managing Inquisitors.
4. Managing Missionaries.
1.1 Reading context. Here AI just maps each religion in sight: How many cities are under that religion control, how much pressure it exert over the map, making a difference between pressure over already converted cities and pressure over contested cities or cities that follow a different religion.
1.2 Evaluate threats and opportunities. Strengths and weaknesses.
Opportunities to convert are easy. For every city, get the following facts:
A) How long it would take for a missionary purchased in the closest religious city to reach destination and how much strength it might lose in the way (passing through unfriendly territory).
B) How many citizens would turn to followers by a missionary spread action once he arrives, accounting the effect of external religious pressure.
C) How much religious pressure would the city gain (expected minus current), if it can be known.
D) Whether this religion would become major in the city or another religion would lose major status in the city.
Then order this list first by the change of majority religion status (gain majority > others lose it > nothing). This is, a city that will gain my religion as majority will take precedence over a city that just might lose the majority for other religion, and both will take precedence over a city that will not change its majority. Next, order it by the number of citizens that will turn to followers. For example, a city that would turn 4 people to followers and become majority will be converted before another city that would turn 6 people to followers but gain no majority. Next, order by the amount of religious pressure the city will gain. This usually can only be known of owned cities. So if I can convert two cities and both will turn 6 people to followers but one of the cities has a temple, the city with the temple goes first. And finally order by the expected turns until next newborn, so everything equal, cities that are about to grow get converted first.
Now we know how many cities are good targets (gain religion for us), acceptable targets (others will lose religion in one action), or bad ones (turning over requires effort). This list is to be used by our missionaries, but the amount of good targets will be useful to know the opportunities too.
For threats we must identify two risks:
+ Being attacked by foreign missionaries and prophets. It depends on whether our neighbours have their own religion, how close their cities are, but mostly it depends on the percentage of citizens in the city that are not followers since they are easier to convert.
+ Being overwhelmed by foreign religious pressure. If the foreign pressure is relatively much higher than the own.
Then build a list with our cities ordered by the highest risk (for our inquisitors) and a second list with the foreign cities that are threatening our cities the most (for our great prophets).
For strengths we must look at our civ toolkit (is there anything that makes our religion stronger?), look at what things we have that gives us an edge at the religious game (resources that yield faith, policies, beliefs, an early religion). Weaknesses is just looking the strengths of our rivals, especially the closer ones.
1.3 Choosing the strategic stance.
Now it's time to decide one of the following stances:
+ Aggressive spread. We have a big advantage and there are more opportunities than risks. Go converting those cities before anyone else does. Extra Great Prophets might gain more cities to the faith but should be used in cities with presence of other religions. Connect every city with roads if you have not done it yet.
+ Defensive. We have an advantage but risks are higher than opportunities. Enhance and place inquisitors in your cities, extra Great Prophets go to sacred places.
+ Cautious spread. We are weaker, but we still can get some profits before confrontation. Invest in Great Prophets for enhancing earlier, place inquisitors in the border cities and religious buildings to keep a decent defense.
+ Surrender. We are weaker and there are more risks than opportunities, so let's use our resources for other more useful things such as great people.
1.4 Choosing the next item in queue.
Agressive spread will produce missionaries while the opportunities are still high. Once opportunities are little and risk are still low, faith goes to great prophet, religion buildings or other purchases in this order.
Cautious spread will produce first a great prophet for enhancing, then religious buildings for extra religious strength, then missionaries while the opportunities are still high.
Defensive will produce inquisitors while there are cities at risk without inquisitors, then save for great prophets.
Surrender will avoid producing religious units, faith is to be expended in religious buildings and other purchases.
Points 2, 3 and 4 are more or less already handled, but maybe they could make use of the produced ordered lists in the steps above.
Ilteroi has requested some help in designing a new logic for missionaries and inquisitors. So, let's try to help him in this thread. Remember that the AI has no crystal ball to predict the next turn, so it can only works with whatever is currently going on in the present turn.
My logic scheme:
1. Choosing the religious stance and queue purchases.
2. Managing Great Prophets.
3. Managing Inquisitors.
4. Managing Missionaries.
1.1 Reading context. Here AI just maps each religion in sight: How many cities are under that religion control, how much pressure it exert over the map, making a difference between pressure over already converted cities and pressure over contested cities or cities that follow a different religion.
1.2 Evaluate threats and opportunities. Strengths and weaknesses.
Opportunities to convert are easy. For every city, get the following facts:
A) How long it would take for a missionary purchased in the closest religious city to reach destination and how much strength it might lose in the way (passing through unfriendly territory).
B) How many citizens would turn to followers by a missionary spread action once he arrives, accounting the effect of external religious pressure.
C) How much religious pressure would the city gain (expected minus current), if it can be known.
D) Whether this religion would become major in the city or another religion would lose major status in the city.
Then order this list first by the change of majority religion status (gain majority > others lose it > nothing). This is, a city that will gain my religion as majority will take precedence over a city that just might lose the majority for other religion, and both will take precedence over a city that will not change its majority. Next, order it by the number of citizens that will turn to followers. For example, a city that would turn 4 people to followers and become majority will be converted before another city that would turn 6 people to followers but gain no majority. Next, order by the amount of religious pressure the city will gain. This usually can only be known of owned cities. So if I can convert two cities and both will turn 6 people to followers but one of the cities has a temple, the city with the temple goes first. And finally order by the expected turns until next newborn, so everything equal, cities that are about to grow get converted first.
Now we know how many cities are good targets (gain religion for us), acceptable targets (others will lose religion in one action), or bad ones (turning over requires effort). This list is to be used by our missionaries, but the amount of good targets will be useful to know the opportunities too.
For threats we must identify two risks:
+ Being attacked by foreign missionaries and prophets. It depends on whether our neighbours have their own religion, how close their cities are, but mostly it depends on the percentage of citizens in the city that are not followers since they are easier to convert.
+ Being overwhelmed by foreign religious pressure. If the foreign pressure is relatively much higher than the own.
Then build a list with our cities ordered by the highest risk (for our inquisitors) and a second list with the foreign cities that are threatening our cities the most (for our great prophets).
For strengths we must look at our civ toolkit (is there anything that makes our religion stronger?), look at what things we have that gives us an edge at the religious game (resources that yield faith, policies, beliefs, an early religion). Weaknesses is just looking the strengths of our rivals, especially the closer ones.
1.3 Choosing the strategic stance.
Now it's time to decide one of the following stances:
+ Aggressive spread. We have a big advantage and there are more opportunities than risks. Go converting those cities before anyone else does. Extra Great Prophets might gain more cities to the faith but should be used in cities with presence of other religions. Connect every city with roads if you have not done it yet.
+ Defensive. We have an advantage but risks are higher than opportunities. Enhance and place inquisitors in your cities, extra Great Prophets go to sacred places.
+ Cautious spread. We are weaker, but we still can get some profits before confrontation. Invest in Great Prophets for enhancing earlier, place inquisitors in the border cities and religious buildings to keep a decent defense.
+ Surrender. We are weaker and there are more risks than opportunities, so let's use our resources for other more useful things such as great people.
1.4 Choosing the next item in queue.
Agressive spread will produce missionaries while the opportunities are still high. Once opportunities are little and risk are still low, faith goes to great prophet, religion buildings or other purchases in this order.
Cautious spread will produce first a great prophet for enhancing, then religious buildings for extra religious strength, then missionaries while the opportunities are still high.
Defensive will produce inquisitors while there are cities at risk without inquisitors, then save for great prophets.
Surrender will avoid producing religious units, faith is to be expended in religious buildings and other purchases.
Points 2, 3 and 4 are more or less already handled, but maybe they could make use of the produced ordered lists in the steps above.