Who gets new religion if two player finishs tech reaearch in same turn?

SimCutie

Warlord
Joined
Dec 10, 2005
Messages
197
If two players of different team are researching same religion technology like meditation and both finished research in same turn, then who founds the religion by the religion tech?
Lets say that we have 4 playser A, B, C, D. (A, C) is team 1, and (B, D) is team 2. The turn play order is A, B, C, D.
They are doing same reasearch on monotheism (A,B, C, D all).
Then, C rearched to finish research on monotheism first.
Then A or C will get religion (Judaism in this case) and holy city.
Even if D finished same monotheism tech research in same turn. their team (B, D) have no chance to found Judaism. Am I right?

And this unfairness seems to apply to technology first bonus like free unit or wonder building race.
Isn't it too unfair ?
 
Hmmm, well, I'm not sure, but if let's say it was ABCD, and A was human, and A, B and D all finished researching monotheism at the same time, dosen't the human player have priority (I'm pretty sure in mp A would get it automatically because he is first in the order.) Now that the SDK is out, isn't it possible to code it so it's random, or the team with the least religions acquires it.
 
I don't know how it works now, but it would be cool if it depended on your research rate and how many research points you actually needed to get the tech.

So if I have a research rate of 20 per turn, and I need 20 more points to get the tech, it would theoretically take me the full turn to research the tech. If you are only researching 10 points per turn, but you only need 5 points to finish the tech, then it would only take you half a turn to get the tech. So you would get it before me.

If there was still a tie (probably a lot less likely), it could be random.

Daniel
 
Not True Lord Olleus. I just played a game and had 1 single turn to go on a wonder, ended my turn, and a computer, not me, got the wonder. I think it has to do with how many hammers or beakers you need to finish the research or production. A similar situation is also referenced in one of the strategy threads reguarding roll over research and production, I believe the thread was comparing Civ 4 with Civ 3 and how different some tactics were, but I don't remember exactly what its name was nor where it was.
 
That's where you're wrong. The AI player finished it one turn ahead of you. Say you were on turn 37, you would've got it on turn 38. But you went first, so the AI got it on their turn 37.

The Human going first is very important.
 
AlCosta15 said:
That's where you're wrong. The AI player finished it one turn ahead of you. Say you were on turn 37, you would've got it on turn 38. But you went first, so the AI got it on their turn 37.

The Human going first is very important.
Actually, I'm pretty sure you're wrong.

Unlinke previous versions of Civ all this sort of stuff is handled when you end your turn, rather then when you begin it. Try playing a turn-based mutiplayer game and you'll see what I mean.

Incedently, this way of doing it makes turn based multiplayer alot[/q] quicker, as all you usually have to do in your turn is move units - you can worry about allocating science, citizens and production in your oponent's turn.

What probably happend in this particular case is that some effect wore off (or some effect started) before the hammers were counted, either that or it was an interface error - they have made a few changes to this sort of interface thing with the new patch, though I'm not certain on the specifics.

As an answer to the first question; in turn based games the player who finishes the thing earlier in the player order gets it (because it finishes at the end of their turn), and I think in simultaneous games the person who has most production/science surplass after completion gets it.
 
AlCosta15 said:
That's where you're wrong. The AI player finished it one turn ahead of you. Say you were on turn 37, you would've got it on turn 38. But you went first, so the AI got it on their turn 37.

The Human going first is very important.


I agree with this. This has happend to me as well. I had 1 turn left to go building the pyramids one time and an AI beat me to it. However, it took the game until the next turn before it said "City working pyramids cannot be continued" or whatever it says and then I got the gold for what I had done.

In this case I had 2 turns to get it and the AI had 1. I ended my turn and they got it with mine saying 1 turn to go. Regardless of the fact it still said I had 1 turn to go, upon using the next turn the game realized it cannot be completed.
 
The holy city allocation is done in CvGame.cpp in the function called doHolyCity() ... here's the most relevant code:

Code:
for (iJ = 0; iJ < MAX_TEAMS; iJ++)
{
	if (GET_TEAM((TeamTypes)iJ).isAlive())
	{
		if (GET_TEAM((TeamTypes)iJ).isHasTech((TechTypes)(GC.getReligionInfo((ReligionTypes)iI).getTechPrereq())))
		{
			if (GET_TEAM((TeamTypes)iJ).getNumCities() > 0)
			{
				iValue = getSorenRandNum(10, "Found Religion (Team)");

				if ([B]!(GET_TEAM((TeamTypes)iJ).isHuman())[/B])
				{
					iValue += 10;
				}

				for (iK = 0; iK < GC.getNumReligionInfos(); iK++)
				{
					iValue += [B](GET_TEAM((TeamTypes)iJ).getHasReligionCount((ReligionTypes)iK) * 20);[/B]
				}

				if (iValue < iBestValue)
				{
					iBestValue = iValue;
					eBestTeam = ((TeamTypes)iJ);
				}
			}
		}
	}
}

So, the team that has the tech and gets the lowest adjusted rand wins the holy city lottery. Notice the +10 to all non-humans and +20 to anyone with a holy city ... since the rand is max 10, this guarantees victory to the human if:
- the human is in the running
- the human has no holy cities already
and guarantees victory to a civ without a holy city, if the other possible civs do. This effect is readily apparent if you start up a game in the say the modern era ... human always gets judaism, then all civs get one holy city, etc.

The turn order for players, however, has no effect.
 
jdog5000 said:
The holy city allocation is done in CvGame.cpp in the function called doHolyCity() ... here's the most relevant code:

Code:
for (iJ = 0; iJ < MAX_TEAMS; iJ++)
{
	if (GET_TEAM((TeamTypes)iJ).isAlive())
...
}

So, the team that has the tech and gets the lowest adjusted rand wins the holy city lottery. Notice the +10 to all non-humans and +20 to anyone with a holy city ... since the rand is max 10, this guarantees victory to the human if:
- the human is in the running
- the human has no holy cities already
and guarantees victory to a civ without a holy city, if the other possible civs do. This effect is readily apparent if you start up a game in the say the modern era ... human always gets judaism, then all civs get one holy city, etc.

The turn order for players, however, has no effect.
This is correct only if this part of the code is used to choose winner of religon-tech. This code is used when a city is foud to be a holy city or a player found to be have religin-tech but not hasReligion() after human player finished turn by pressing next turn button.
See this code in CvTeam.cpp

Code:
CvTeam.cpp : line 3366

for (iI = 0; iI < GC.getNumReligionInfos(); iI++)
{
  if (GC.getReligionInfo((ReligionTypes)iI).getTechPrereq() == eIndex)
  {
    if (!(GC.getGameINLINE().isReligionFounded((ReligionTypes)iI)))
    {
      iBestValue = MAX_INT;
      eBestPlayer = NO_PLAYER;

      for (iJ = 0; iJ < MAX_PLAYERS; iJ++)
      {
        if (GET_PLAYER((PlayerTypes)iJ).isAlive())
        {
        [B]  if (GET_PLAYER((PlayerTypes)iJ).getTeam() == getID())[/B]          {
            iValue = 10;

            iValue += GC.getGameINLINE().getSorenRandNum(10, "Found Religion (Player)");

            for (iK = 0; iK < GC.getNumReligionInfos(); iK++)
            {
              iValue += (GET_PLAYER((PlayerTypes)iJ).getHasReligionCount((ReligionTypes)iK) * 10);
            }

            if (GET_PLAYER((PlayerTypes)iJ).getCurrentResearch() != eIndex)
            {
              iValue *= 10;
            }

            if (iValue < iBestValue)
            {
              iBestValue = iValue;
              eBestPlayer = ((PlayerTypes)iJ);
            }
          }
        }
      }

      if (eBestPlayer != NO_PLAYER)
      {
        [B]GET_PLAYER(eBestPlayer).foundReligion((ReligionTypes)iI);[/B]
        bReligionFounded = true;
        bFirstBonus = true;
      }
    }
  }
}
This is part of the code used when a Team has finished research on technology. the part I set bold indicates that only the players in same team with player who finished the tech first are eligible for religion founding/holy-city winner. This is part used before doHolyCity() part ( when Human player is doing his turn) and If a player finishes reserach a tech, His team will elect winner of the holy city using this code and sets Player.foundReligion(). So the above doHolyCity() part have no chance to foundReligion().
 
I'm 99% sure it's whoever runs the largest overflow. Meaning that if we both research Meditation at the same time, but I overflow by 10 beakers, and you overflow by 8 beakers, I get to discover Buddhism.
 
Back
Top Bottom