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:
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.
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.
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...)
- 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.
- 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).