There haven't been a lot of updates lately but I have been working on the mod a lot, and the results of that have just been made available. This includes two features which are both rather big, and deserve some elaboration both on why they took so long and why the came out the way they did, and what to do with them in the future.
New religion spread mechanics
You might remember that the recent stretch of "dark ages" in terms of new features started when I went off into a separate branch to implement a new way to divide Christianity into denominations, how they are founded and what their shrines would be.
Unfortunately, this plan just revealed that Christianity in general is just rather bad at spreading where it is supposed to exist for those plans to make sense (i.e. the Mediterranean and the Roman Empire). Therefore I came to the conclusion that I had to change the way religion spread works before getting to the Christianity changes. This was about more than just helping Christianity spread in Rome; in terms of religion spread the mod has relied on crutches (i.e. spawning missionaries on semi-random dates) that were inelegant temporary solutions at best, and I wanted to get rid of them instead of including another. I had some extensive plans on how to change religion spread that were vague in some respects and would take some time to implement, so I had initially decided to push them back behind the Christianity changes and maybe even after the 1.14 release.
Those goals included:
1) more gradual spread from the holy city as a contiguous "blob" for a religion, instead of random spreads to faraway cities
2) less randomness overall
3) more region specific spread that allows to control the spread of religion in those regions, for example encourage Christianity spread in Europe while at the same time discourage the spread of religions like Zoroastrianism or Buddhism there
4) different behavior for ethnic religions such as Hinduism and proselytizing religions such as Buddhism or Christianity
5) some measure of the relative presence of religions in a city so other features (such as stability) can take stuff like majority religions into account
6) a mechanism that can lead to the disappearance of a religion from a city
That's quite a lot of requirements and I tried to cover them all with one system. Basically, cities would have a religious influence value for every religion they have, and depending on that value spread it to the surrounding tiles (similar to how culture is spread). This spread accumulates a religion's presence in other cities, if the presence crosses a threshold the religion takes hold in a city. The religion with the highest presence was the majority religion of the city. If the presence falls below the threshold the religion disappears again. This model was obviously completely deterministic.
I tried to make this work with two different approaches but neither produced desirable results. Religions either spread too quickly or too slowly, and religions that were supposed to spread well didn't. The non-randomness of the system was also problematic because things always played out in the same way.
So I scaled things back to a simpler system that works quite well. Cities still have religious influence, but it only affects how far they can spread their religion. In other words, every city that is in reach of at least one city with a religion has a chance to receive that religion. This is still different from the original mechanism where the holy city was the only city doing the spreading, but it could reach every other city, even though chances dropped off quite a bit with distance. I also removed the trade connection requirement which should help spread to independent cities.
The chances to spread are affected by a number of factors, but now the region also plays a role. Every tile now has a spread factor for every religion, which can have the following values:
Fast spread: high chance of spreading, even with other religions already present
Normal spread: unmodified
Minority religion: low chance of spreading, cannot be the first religion to spread to the city, even lower chance of spreading if no related religion is present (e.g. Buddhism as minority religion can spread more easily if the present religion is Hinduism rather than say Catholicism)
No spread: the religion cannot spread on its own
Spread restrictions are always ignored if it is the owner's state religion.
This solution of course means that there is still no concept of a majority religion, and no mechanism for religions disappearing on their own exists. I plan to address the latter in the future though.
As for the immediate future, I hope you share your observations about the system, especially:
- are religions not spreading to places they should spread to (e.g. Christianity in the Americas and Congo since their UHV depends on it, Islam in Indonesia etc.)
- are religions spreading to places they should not spread to
- are religions spreading too quickly or too slowly
- are religions "maxed out" (e.g. Confucianism, Taoism and Buddhism in all Chinese cities) too easily
Initial observations suggest this isn't looking too bad but I'm sure some variables can still be tweaked.
Unique GP Names in Python
While I was working on religions I had some ideas how to handle unique GP names better. As you may know, they were previously implemented as unique units for all civilizations for all GP types, leading to lots of useless units and bloated XML files that were hard to handle.
Now everything is located in the GreatPeople.py file instead! This allowed me to throw out around 20000 lines of dead weight XML code.
At the same time, I wanted to deal with an annoying problem with unique GP names. Previously, those lists had no awareness of game era, they would simply be used in a linear order with some randomness thrown in. This constrained the number of names that could be in the game because they had to be chosen in such a way that they would be used in the game in roughly the same rate it progresses through the eras. Also, if you started a game as say China in a later scenario, you still had to use up the names that were already anachronistic.
On the other hand, making names also era specific would make it hard for some civs to fill all eras. Therefore I have implemented a system that would preferably use the correct names for the right era, but if not enough are available instead also use those of "neighboring eras". This would look something like that in the code:
Those era borders have not been added yet because this was only a side project while working on religion, but I will get to that soon when the system has been tested a bit more.
Religion changes in the future
Two things are coming next for religion:
- the new way to handle the Christian denominations as previously discussed
- with around 70% probability (depending on how things play out) the reinclusion of Judaism into the mod. That would make pre-Reformation religions in Europe more interesting and provide for a better mechanism to found Christianity.
The future of 1.14
With these things off the table, I will have cleared all major features for 1.14 from my to do list, so expect a release when I get closer to their finalized implementations.
New religion spread mechanics
You might remember that the recent stretch of "dark ages" in terms of new features started when I went off into a separate branch to implement a new way to divide Christianity into denominations, how they are founded and what their shrines would be.
Unfortunately, this plan just revealed that Christianity in general is just rather bad at spreading where it is supposed to exist for those plans to make sense (i.e. the Mediterranean and the Roman Empire). Therefore I came to the conclusion that I had to change the way religion spread works before getting to the Christianity changes. This was about more than just helping Christianity spread in Rome; in terms of religion spread the mod has relied on crutches (i.e. spawning missionaries on semi-random dates) that were inelegant temporary solutions at best, and I wanted to get rid of them instead of including another. I had some extensive plans on how to change religion spread that were vague in some respects and would take some time to implement, so I had initially decided to push them back behind the Christianity changes and maybe even after the 1.14 release.
Those goals included:
1) more gradual spread from the holy city as a contiguous "blob" for a religion, instead of random spreads to faraway cities
2) less randomness overall
3) more region specific spread that allows to control the spread of religion in those regions, for example encourage Christianity spread in Europe while at the same time discourage the spread of religions like Zoroastrianism or Buddhism there
4) different behavior for ethnic religions such as Hinduism and proselytizing religions such as Buddhism or Christianity
5) some measure of the relative presence of religions in a city so other features (such as stability) can take stuff like majority religions into account
6) a mechanism that can lead to the disappearance of a religion from a city
That's quite a lot of requirements and I tried to cover them all with one system. Basically, cities would have a religious influence value for every religion they have, and depending on that value spread it to the surrounding tiles (similar to how culture is spread). This spread accumulates a religion's presence in other cities, if the presence crosses a threshold the religion takes hold in a city. The religion with the highest presence was the majority religion of the city. If the presence falls below the threshold the religion disappears again. This model was obviously completely deterministic.
I tried to make this work with two different approaches but neither produced desirable results. Religions either spread too quickly or too slowly, and religions that were supposed to spread well didn't. The non-randomness of the system was also problematic because things always played out in the same way.
So I scaled things back to a simpler system that works quite well. Cities still have religious influence, but it only affects how far they can spread their religion. In other words, every city that is in reach of at least one city with a religion has a chance to receive that religion. This is still different from the original mechanism where the holy city was the only city doing the spreading, but it could reach every other city, even though chances dropped off quite a bit with distance. I also removed the trade connection requirement which should help spread to independent cities.
The chances to spread are affected by a number of factors, but now the region also plays a role. Every tile now has a spread factor for every religion, which can have the following values:
Fast spread: high chance of spreading, even with other religions already present
Normal spread: unmodified
Minority religion: low chance of spreading, cannot be the first religion to spread to the city, even lower chance of spreading if no related religion is present (e.g. Buddhism as minority religion can spread more easily if the present religion is Hinduism rather than say Catholicism)
No spread: the religion cannot spread on its own
Spread restrictions are always ignored if it is the owner's state religion.
This solution of course means that there is still no concept of a majority religion, and no mechanism for religions disappearing on their own exists. I plan to address the latter in the future though.
As for the immediate future, I hope you share your observations about the system, especially:
- are religions not spreading to places they should spread to (e.g. Christianity in the Americas and Congo since their UHV depends on it, Islam in Indonesia etc.)
- are religions spreading to places they should not spread to
- are religions spreading too quickly or too slowly
- are religions "maxed out" (e.g. Confucianism, Taoism and Buddhism in all Chinese cities) too easily
Initial observations suggest this isn't looking too bad but I'm sure some variables can still be tweaked.
Unique GP Names in Python
While I was working on religions I had some ideas how to handle unique GP names better. As you may know, they were previously implemented as unique units for all civilizations for all GP types, leading to lots of useless units and bloated XML files that were hard to handle.
Now everything is located in the GreatPeople.py file instead! This allowed me to throw out around 20000 lines of dead weight XML code.
At the same time, I wanted to deal with an annoying problem with unique GP names. Previously, those lists had no awareness of game era, they would simply be used in a linear order with some randomness thrown in. This constrained the number of names that could be in the game because they had to be chosen in such a way that they would be used in the game in roughly the same rate it progresses through the eras. Also, if you started a game as say China in a later scenario, you still had to use up the names that were already anachronistic.
On the other hand, making names also era specific would make it hard for some civs to fill all eras. Therefore I have implemented a system that would preferably use the correct names for the right era, but if not enough are available instead also use those of "neighboring eras". This would look something like that in the code:
Code:
iCivPersia : {
iGreatProphet : [
iAncient,
"Zoroaster", # 18-10th BC
iClassical,
"Mani", # 3rd
"Mazdak", # 4th
iMedieval,
"Al-Ghazali", # 11th
"Mevlana", # 13th
iRenaissance,
"Mulla Sadra", # 17th
],
Those era borders have not been added yet because this was only a side project while working on religion, but I will get to that soon when the system has been tested a bit more.
Religion changes in the future
Two things are coming next for religion:
- the new way to handle the Christian denominations as previously discussed
- with around 70% probability (depending on how things play out) the reinclusion of Judaism into the mod. That would make pre-Reformation religions in Europe more interesting and provide for a better mechanism to found Christianity.
The future of 1.14
With these things off the table, I will have cleared all major features for 1.14 from my to do list, so expect a release when I get closer to their finalized implementations.