How much religious pressure per follower?

Joined
Sep 8, 2007
Messages
375
Location
Canada
OK so this is actually two questions.

1) I assume that there is an amount of pressure needed to convert a non-believer into a follower, and could be done in such a way.
City has zero pressure to start with, after a set amount of pressure is accrued, by turns*pressure per turn, a citizen will become religious and so on.
So what is the the total accumulated pressure points needed to convert a citizen?

2) If a city is already religious, say is size 10, with 10 followers, and a new religion starts influencing it at a higher rate than it's own religion influences it, example, lets say there were 10 buddhist followers in the city and it is receiving +10 buddhist pressure per turn, then up pops Hinduism and by whatever means starts exerting +20 hindu pressure per turn on the city.
now this has me thinking, theres two ways you could code this:
a) Each religion gets followers equal to it's share of accumulated pressure.
So say Buddhism has 1000 accumulated pressure to start and then after 50 turns by the above pressures, buddhism will have 1500, and hinduism 1000, so 3/5 of the people would be buddhist and 2/5 hindu. or
b) Each religion gets followers according to the discrepancy of accumulated faith, and this is related to part 1 of this question because i'd need to know how much faith it takes to convert a citizen. so lets say in our example, same numbers, but lets assume it takes 100 faith to convert a citizen. so after 50 turns, buddhism has 1500 faith and hinduism 1000, so buddhism, being up by 500 faith, gets 5 followers, then they both have 1000 faith left so they split the remaining population. in this case if the city is still size 10, there would be 7.5 buddhists and 2.5 hindus, probably rounded to 7 buddhists and 2 hindus.

Whats the scoop?
 
Pressure comes from cities in range following a religion.
Not by the number of followers.
Additional pressure from trade routes, holy city, grand temple and some religious traits.
There a few good threads explaining the mechanic .
cheers
John
 
You misunderstand my question, I know that on normal speed, each city emanates 6 pressure per turn on to all cities within 10 tiles, can be modified by wonders, Itinerant preachers, religious texts, etc. So say my city with hinduism is here. 0
and there is another city with no followers of any religions 8 tiles away, here: 0 - - - - - - - 0
That city is going to be receiving 6 pressure per turn from my city, i got that.
My question 1 is: after how many turns will a follower appear in that city?
so if i'm giving it 6 pressure per turn, does it take 10 turns? 20? 30? and is this because you have to accumulate a certain amount of pressure in that city for a follower to appear. math-wise, the total pressure that city has received is the pressure they get per turn * the number of turns they have been receiving it. so after 1 turn they have 6 hindu pressure, after 2, 12. etc.
Do you now see my question?
 
sorry about that chief. Speed reading and small phone screens makes it easy to get the wrong end the stick.
I assumed that the greater the pressure on the population the higher the chance of a convert.
So number of turns between conversion is not fixed.
That is how it appears to me, but happy to corrected by wiser council.
cheers
john
 
Bam

Code:
/// Calculate the number of followers for each religion
void CvCityReligions::RecomputeFollowers(CvReligiousFollowChangeReason eReason, ReligionTypes eOldMajorityReligion, PlayerTypes eResponsibleParty)
{
	int iOldFollowers = GetNumFollowers(eOldMajorityReligion);
	int iUnassignedFollowers = m_pCity->getPopulation();
	int iPressurePerFollower;

	// Safety check to avoid divide by zero
	if (iUnassignedFollowers < 1)
	{
		CvAssertMsg (false, "Invalid city population when recomputing followers");
		return;
	}

	// Find total pressure
	int iTotalPressure = 0;
	ReligionInCityList::iterator it;
	for(it = m_ReligionStatus.begin(); it != m_ReligionStatus.end(); it++)
	{
		iTotalPressure += it->m_iPressure;
	}

	// safety check - if pressure was wiped out somehow, just rebuild pressure of 1 atheist
	if (iTotalPressure <= 0)
	{
		m_ReligionStatus.clear();

		CvReligionInCity religion;
		religion.m_bFoundedHere = false;
		religion.m_eReligion = NO_RELIGION;
		religion.m_iFollowers = 1;
		religion.m_iPressure = GC.getRELIGION_ATHEISM_PRESSURE_PER_POP();
		m_ReligionStatus.push_back(religion);

		iTotalPressure = GC.getRELIGION_ATHEISM_PRESSURE_PER_POP();
	}

	iPressurePerFollower = iTotalPressure / iUnassignedFollowers;

	// Loop through each religion
	for(it = m_ReligionStatus.begin(); it != m_ReligionStatus.end(); it++)
	{
		it->m_iFollowers = it->m_iPressure / iPressurePerFollower;
		iUnassignedFollowers -= it->m_iFollowers;
		it->m_iTemp = it->m_iPressure - (it->m_iFollowers * iPressurePerFollower);  // Remainder
	}

	// Assign out the remainder
	for (int iI = 0; iI < iUnassignedFollowers; iI++)
	{
		ReligionInCityList::iterator itLargestRemainder = NULL;
		int iLargestRemainder = 0;

		for (it = m_ReligionStatus.begin(); it != m_ReligionStatus.end(); it++)
		{
			if (it->m_iTemp > iLargestRemainder)
			{
				iLargestRemainder = it->m_iTemp;
				itLargestRemainder = it;
			}
		}

		if (itLargestRemainder && iLargestRemainder > 0)
		{
			itLargestRemainder->m_iFollowers++;
			itLargestRemainder->m_iTemp = 0;
		}
	}

	ReligionTypes eMajority = GetReligiousMajority();
	int iFollowers = GetNumFollowers(eMajority);

	if(eMajority != eOldMajorityReligion || iFollowers != iOldFollowers)
	{
		CityConvertsReligion(eMajority, eOldMajorityReligion, eResponsibleParty);
		GC.GetEngineUserInterface()->setDirty(CityInfo_DIRTY_BIT, true);
		LogFollowersChange(eReason);
	}
}

Actually, this isn't helpful out of context... or maybe it is? I'm having trouble following this, but it's definitely the thing that decides how many followers are in each city.
 
Bam
Spoiler :

Code:
/// Calculate the number of followers for each religion
void CvCityReligions::RecomputeFollowers(CvReligiousFollowChangeReason eReason, ReligionTypes eOldMajorityReligion, PlayerTypes eResponsibleParty)
{
	int iOldFollowers = GetNumFollowers(eOldMajorityReligion);
	int iUnassignedFollowers = m_pCity->getPopulation();
	int iPressurePerFollower;

	// Safety check to avoid divide by zero
	if (iUnassignedFollowers < 1)
	{
		CvAssertMsg (false, "Invalid city population when recomputing followers");
		return;
	}

	// Find total pressure
	int iTotalPressure = 0;
	ReligionInCityList::iterator it;
	for(it = m_ReligionStatus.begin(); it != m_ReligionStatus.end(); it++)
	{
		iTotalPressure += it->m_iPressure;
	}

	// safety check - if pressure was wiped out somehow, just rebuild pressure of 1 atheist
	if (iTotalPressure <= 0)
	{
		m_ReligionStatus.clear();

		CvReligionInCity religion;
		religion.m_bFoundedHere = false;
		religion.m_eReligion = NO_RELIGION;
		religion.m_iFollowers = 1;
		religion.m_iPressure = GC.getRELIGION_ATHEISM_PRESSURE_PER_POP();
		m_ReligionStatus.push_back(religion);

		iTotalPressure = GC.getRELIGION_ATHEISM_PRESSURE_PER_POP();
	}

	iPressurePerFollower = iTotalPressure / iUnassignedFollowers;

	// Loop through each religion
	for(it = m_ReligionStatus.begin(); it != m_ReligionStatus.end(); it++)
	{
		it->m_iFollowers = it->m_iPressure / iPressurePerFollower;
		iUnassignedFollowers -= it->m_iFollowers;
		it->m_iTemp = it->m_iPressure - (it->m_iFollowers * iPressurePerFollower);  // Remainder
	}

	// Assign out the remainder
	for (int iI = 0; iI < iUnassignedFollowers; iI++)
	{
		ReligionInCityList::iterator itLargestRemainder = NULL;
		int iLargestRemainder = 0;

		for (it = m_ReligionStatus.begin(); it != m_ReligionStatus.end(); it++)
		{
			if (it->m_iTemp > iLargestRemainder)
			{
				iLargestRemainder = it->m_iTemp;
				itLargestRemainder = it;
			}
		}

		if (itLargestRemainder && iLargestRemainder > 0)
		{
			itLargestRemainder->m_iFollowers++;
			itLargestRemainder->m_iTemp = 0;
		}
	}

	ReligionTypes eMajority = GetReligiousMajority();
	int iFollowers = GetNumFollowers(eMajority);

	if(eMajority != eOldMajorityReligion || iFollowers != iOldFollowers)
	{
		CityConvertsReligion(eMajority, eOldMajorityReligion, eResponsibleParty);
		GC.GetEngineUserInterface()->setDirty(CityInfo_DIRTY_BIT, true);
		LogFollowersChange(eReason);
	}
}

Actually, this isn't helpful out of context... or maybe it is? I'm having trouble following this, but it's definitely the thing that decides how many followers are in each city.

My C's too out of practice to follow this well, but it looks like it's passing to other functions? I think we've only got half the info here.
 
Maybe, I find this particular file hard to read. I looked in the CvCity file, but all I saw in there was modifying yield based on beliefs.
 
I'm not 100% sure, its' been 5 years since C++ for me, but it looks to me like:
Spoiler :

// Find total pressure
int iTotalPressure = 0;
ReligionInCityList::iterator it;
for(it = m_ReligionStatus.begin(); it != m_ReligionStatus.end(); it++)
{
iTotalPressure += it->m_iPressure;
}
iPressurePerFollower = iTotalPressure / iUnassignedFollowers;
// Loop through each religion
for(it = m_ReligionStatus.begin(); it != m_ReligionStatus.end(); it++)
{
it->m_iFollowers = it->m_iPressure / iPressurePerFollower;
iUnassignedFollowers -= it->m_iFollowers;
it->m_iTemp = it->m_iPressure - (it->m_iFollowers * iPressurePerFollower); // Remainder
}

// Assign out the remainder
for (int iI = 0; iI < iUnassignedFollowers; iI++)
{
ReligionInCityList::iterator itLargestRemainder = NULL;
int iLargestRemainder = 0;

for (it = m_ReligionStatus.begin(); it != m_ReligionStatus.end(); it++)
{
if (it->m_iTemp > iLargestRemainder)
{
iLargestRemainder = it->m_iTemp;
itLargestRemainder = it;
}
}

if (itLargestRemainder && iLargestRemainder > 0)
{
itLargestRemainder->m_iFollowers++;
itLargestRemainder->m_iTemp = 0;
}
}


defines iTotalPressure as the sum of the pressure the city has received over all turns
defines PressurePerFollower as the iTotalpPressure divided by the number of unaligned citizens.
then runs a test as
iFollowers = pressure this turn / PressurePer Follower
modify Unassigned citizens (UnassignedFollowers) = (UnassignedFollowers) - iFollowers
set iTemp = pressure this turn - (iFollowers * PressurePerFollower)

if iTemp =/= 0, increment the religious status of the city by iTemp
if the remainder is larger than 0 and larger than some other number i can't find defined, then increment the number of followers by one.
 
Back
Top Bottom