Interturn Mechanics

Lanzelot

Moderator
Moderator
Joined
Jun 25, 2007
Messages
6,329
Location
Heidelberg
Most of the following stuff probably has already been known to the "old researchers" like DaveMcW, Bamspeedy, SirPleb, etc. So I don't claim credit for it. However, as far as I know, the bits and pieces of the following information are scattered about in different locations, GOTM threads, Succession Game discussions, etc. and no nice compilation is yet available for easy reference. Also sometimes one can find incorrect information making its round in the discussion forums.

Therefore I tried to write down all points I know from own experience or which I read somewhere, and also conducted a few test games in order to verify those points I didn't know, and here they are, the first hopefully complete

Interturn Mechanics

Most people probably have already wondered, what exactly happens in which order after you have played your turn and press the "end-of-turn button". In my experience, the interturn phase can be divided roughly into three different phases: one where some "global" steps are performed for you as well as for the AIs, followed by a phase, where your "per-city" steps are performed, and then concluded by a phase, where the AIs' "per-city" actions are done. The first phase looks as follows:

  • First all worker actions are calculated. (So if in the previous turn some worker job showed "1 turn" until completion, it will complete now, and consequently if an irrigation, mine, road or railway completes at this point, the extra food, shield or commerce from that improvement is already harvested, even though it was not yet visible when checking your city the previous turn! Another nice effect is, that if a worker is about to finish connecting a luxury resource, you can already lower the lux slider the turn before without having to fear riots.)
  • Now the AIs get to move their units. (This means, if a worker has 1 turn left on finishing a task when you end your turn, and an AI is about to capture this worker, the task will still be finished.)
  • Then all commerce (beakers and gold) is calculated. This is done "globally", meaning for all cities at once, before going through the list of individual cities. (This is the reason why the governor setting "Emphasize commerce" doesn't do you any good: it's not possible to pick up "commerce on growth", because commerce has already been calculated by the time a new citizen is added to your towns.) Also your expenses (maintenance cost for buildings and unit upkeep) is subtracted from your bank account. (This is the reason, why you don't have to pay anything yet for new buildings/units which are going to be completed during the current interturn.)
    If a tech is finished, you get it now, and by going to the "big picture", you can from F4 already trade it to the AI or from F1 switch city production to any new buildings/units enabled this tech.
  • I'm not completely sure about this point, but I think that now all commerce is collected for the AIs. In any case, I have never yet seen it, that I lose the Philosophy race, if F1 tells me "1 turn to go" and no AI had it yet at this point. So the human player seems to get his new techs before the AI does.

Afterwards the next phase starts, and the following steps are performed for one city at a time, starting with your capital and then moving through the list of cities in the order they were founded. All these steps are completed for one city and then the algorithm moves on to the next city on the list, performing the same steps for that city, etc.
  • The city is checked for happiness and if unhappy, it starts to riot. (This has two consequences: first it means you still get commerce from cities that are about to riot, while you don't get food and shields. Sometimes (in very special circumstances) this can be used to finish an important tech a turn earlier by lowering the lux slider and increasing the science slider, so that the tech finishes albeit at the price of some cities going into riot... And second it means that cities, which grow this turn and would end up in an unhappy state afterwards, still don't riot this turn. So you get the full production from them and can deal with the unhappiness issue in the following turn.)
  • Then food is collected, and if a city grows because of that, the governor assigns the new citizen to some tile.
  • Then shields are collected (including the ones from new citizens that have been added in the previous step) and finished projects (buildings/units) are added to the city. If this leads to the completion of a wonder, and if this wonder triggers your Golden Age, then for all remaining cities which are to be processed following the current one, you already get the increased shield output! (But not the increased commerce output, because that has already been collected "globally" in the "commerce step" above.) This also means, if the current city completes a wonder that adds a building to all other cities (like Temple of Artemis or Pyramids), then all following cities in the list already get the benefit of that building during this interturn sequence! So a city that grows this turn, keeps half of its food, if another city further up in the list has completed the Pyramids this turn, a city that has one too many unhappy citizens, does not riot, if another city further up the list has just completed Artemis, etc. For some strange reason this does not work for wonders with a "general" effect, like Hanging Gardens, Bach's Cathedral etc! So an unhappy city still riots, even if a previous city has completed the Hanging Gardens. If you then select "Zoom to XXX" on the riot pop-up and enter city screen, you see that the people are already happy, but the city nevertheless riots!? Looks like a programming error to me.
    If you complete a wonder that gives free techs, you get the techs immediately, before the game proceeds to the next city. (I used this fact once to build the Theory of Evolution and the United Nations within the same interturn! You only need to be careful that the city working on the ToE is older than the city working on the UN-prebuild, otherwise that second city will finish the palace, before you are able to switch it to UN... :D)
  • At the end, the culture of a city is checked, and the cultural borders are increased if the next culture limit is reached. This may result in another rearrangement of the citizens' tile and specialist assignments. (This means, that if the collection of the shields in the previous step has led to the completion of a cultural building, you already get its culture this turn. This is the reason, why a city that builds a temple (2cpt) gets its first culture expansion (total of 10 culture points) already after 4 turns instead of 5...)

After all cities have been processed, some "global" steps are being performed again in the final phase. I'm not sure, in which order the following three final steps take place, as it is very hard to find some kind of test that would show it. But I guess it doesn't matter anyway. I'm listing it here in the order that seems most natural to me.

  • Your wounded units, which did not use any movement points last turn, get their healing period. This means, if a unit is stationed in a city that just finished a barracks during the steps above, it already gets the full benefit of those barracks and heals completely.
  • Also it appears to me that at this point (at least after your "per-city production phase") the AIs get their production phase. This would be the explanation, why you can't lose a race to a wonder, if you have one turn left on it and no one has it yet. The AIs seem to get their production after the human does, so if a city that is producing a wonder says "Complete in 1 turn", it's definitely yours. :goodjob:
  • Score points are updated. This means that any building and wonder increasing the number of happy faces, which finished during interturn, already contributes to your score this turn.
    It also means, that theoretically in those turns where you finish a tech (and can therefore break into the F1 screen between the "commerce phase" and the "production phase"), you can get "double duty" out of your commerce: first in form of gold and beakers (during commerce phase), and then a second time by setting the lux slider to 100%, so that the commerce increases happiness during the score calculating phase. Note however, that this is a banned exploit under HoF rules:

    Q. Is it legal to use the "big picture" to set entertainment at 100% the turn you discover a tech?
    A. No. This would double-credit commerce for that turn (first towards the tech, again towards happy faces).
 
Great stuff Lanzelot.

I have one question, do you know when score points are calculated, say if you build a market that makes more citizens happy, does that contribute to more happiness points in that turn or not?
 
I'm not completely sure about this point, but I think that now all commerce is collected for the AIs. In any case, I have never yet seen it, that I loose the Philosophy race, if F1 tells me "1 turn to go" and no AI had it yet at this point. So the human player seems to get his new techs before the AI does.

Could it function as the wonder race?, when there are ties, the wonder is given to the player with the higher ranking in player number, not because it is AI or human, thus the techs, when tie occurs in philo race, will probably be given to the player who is first to play in the turn order, thus versus the AI, if you are player 1 (set in the editor), you will win the phil tech when tie occurs, if you are not set to player 1 and have a lower ranking in order, then the AI will win the tech.

When players are not selected from the editor and you are playing without custom rules, you are selecting civs, they could be pre-arranged by the game to be player 1, 2 and so on, so you need to discover your civ playing order and you´ll know why you lose/win a tech/wonder race to the AI.
 
I have one question, do you know when score points are calculated, say if you build a market that makes more citizens happy, does that contribute to more happiness points in that turn or not?

Made a test concerning this: score calculation takes place after the build phase, so any happiness builds finishing during interturn are already contributing to the score.
Updated the main post accordingly.
 
Good work! :goodjob:

It is so handy to have everything in one place.
 
This order of events fits my experience of Civ 3.
Thanks for writing this up so nicely and posting it. :goodjob:
 
Made a test concerning this: score calculation takes place after the build phase, so any happiness builds finishing during interturn are already contributing to the score.

Updated the main post accordingly.

Thanks for your test
 
@Lanzelot: Two questions.

1) From what you have read, when is an AI killed on the IBT?

2) Similarly, how does the IBT determine that a civ is still alive?

The setup: I take Rome's last city on Turn 1 but Rome doesn't die because it has one settler somewhere; on a boat or walking around in the wilderness. In Case A, China attacks that tile and wins, destroying or capturing the last Roman settler. In Case B, China attacks but the settler manages to survive.

How does the game know what to do?
 
Uff, good question... :confused:

My (wild) guess would be that, when a town is taken or a settler killed, the game immediately checks, whether that was the last town/settler of that nation, and if yes, it immediately removes all remaining units of that nation, before proceeding?! (Independent of whether that AI already had it's turn in the IBT or not.) If it were done otherwise, it would only lead to "strange effects"... (But then, it would not be the first time that the Firaxis programmers coded "strange effects", would it... :lol:)

I have no good idea how to test it. One could set up a Hotseat game, but I suspect that the hotseat game mechanics are very different from the standard single player mechanics. (For example, worker turns, unit healings as well as units on auto-move behave quite differently in Hotseat/PBEM, basically getting 2 turns in a row followed by one "immobile turn". And that's probably not the only difference...)
 
Thanks Lanzelot. I know I've lowered the luxury slider, or anticipated reduced growth time via the 1st mentioned mechanic before. I know I've also completed the Theory of Evolution and completed the Internet (I think also the U. N. once or twice) the same turn via these mechanics also.
 
Nice one!
About units - during the second phase some actions can be performed with/on all units that have some points left can. Upgrade, disband, fortify and activate are available - the latter two obviously useless. Not sure if first and second aren't exploits (anyway haven't used that in game). Disbanding can add some shields to the bin. Upgrading can result in healed 'green' unit ready to go at the beginning of the turn.
 
Disbanding can add some shields to the bin. Upgrading can result in healed 'green' unit ready to go at the beginning of the turn.

Disbanding during the interturn is quite interesting. It has one advantage and one disadvantage: For shields you get exactly the same effect, if you disband them in the "real" turn or during the following interturn. If you disband during interturn, you will have to pay unit upkeep for that unit (disadvantage compared to disbanding in the real turn), but if you wait until the interturn, then the disbanded unit could still fend off an AI attack, while at the same time giving the shields into the shield-bin still in time for this interturn's production phase! Quite interesting possibilities...

Upgrading during interturn doesn't do you any good: as far as I remember, the unit is not ready to go at the beginning of the next turn. It has to pause just as if you had upgraded it the next turn... :( I already tried it, not during the production phase, but during the commerce phase, for example when Military Tradition just finished during that phase: upgraded some Knights to Cavs, thinking that they would be ready to strike right the following turn, but they weren't...
 
Lanzelot said:
Upgrading during interturn doesn't do you any good: as far as I remember, the unit is not ready to go at the beginning of the next turn.

The commerce phase does mess things up a bit. But if you don't learn any new techs, I quite distinctly remember that you can upgrade during the interturn and your unit will stand ready to go the beginning of the next turn. I know I've used this as follows: pillage iron/saltpeter. Set builds to horsemen. Road up iron/saltpeter. Click next turn. Horseman completes. Zoom to city. Pay for upgrade. And your knight/cavalry stands ready to go.

See the 10 AD save here. You just have to click next turn, zoom to the city, and upgrade.
 
pillage iron/saltpeter. Set builds to horsemen. Road up iron/saltpeter. Click next turn. Horseman completes. Zoom to city. Pay for upgrade. And your knight/cavalry stands ready to go.

Wow, that's powerful :eek: -- thanks for the tip! So the discovery of a new tech really does mess things up quite strangely. As the commerce phase happens before the production phase, you would expect that if you upgrade during commerce phase and the unit is not ready to go, it should even less be ready to go when upgrading during the production phase... :crazyeye:
Got to try this in my next GOTM...
 
may save some time, allow counterattack and speed things up. depends on the unit which will be upgraded. probably of possible use only in really hard times (and in transition phase between two unit generations) when every unit counts.
 
Wow, that's powerful :eek: -- thanks for the tip! So the discovery of a new tech really does mess things up quite strangely. As the commerce phase happens before the production phase, you would expect that if you upgrade during commerce phase and the unit is not ready to go, it should even less be ready to go when upgrading during the production phase... :crazyeye:
Got to try this in my next GOTM...

I guess for upper level ones it might help when going for fast domination/conquest. If you don't mind me asking this here, for a fast spaceship game, do you think overall it would work better to use some sort of disconnect-reconnect to help take more territory faster and using cash that way, or have those workers out developing land elsewhere and using cash for other things? I'm assuming the AIs have gotten you Chialry/Military Tradition, of course.
 
If I can answer, (I'm rather builder than warmonger). In my case:

With sufficient number of workers I don't mind sparing 6-9 (less for IND civ) to reconnect iron when needed (usually less for saltpeter). But I usually try to have almost too many of them (up to and at DG).

With developed core (builder one) there still might not be enough cash to upgrade horse to knight every turn, but I go with reconnecting during the war at the cost of research (using all the ways to reduce losses). Up to some point, where I can slow down while still at war, and produce up to date units. I believe that terrain gained for ICSing will more than make up for research time wasted.

If things at the front line went wrong I would stay in reconnecting mode longer.
OTOH each unit costs upkeep and that I also take into account as to when to stop.
 
Top Bottom