Autumn Leaf
Since 1992
Oh, so this is actually two bugs in one. I've done a few Phoenicia rolls and made the same observations.
The continue button is an obvious miscalculation, RFC does it pretty much the same way except the starting turns are hardcoded there (so there's nothing to miscalculate).
My 2nd example was RFCMarathon, not original RFC (see below the Code for more on that however).
Most mods calculate the button based on RFC's model, which uses Teams. Not sure how that would affect the start date - seems it shouldn't, but it would call into a different routine in the DLL. Even original RFC has some commented-out lines that show Rhye trying variations. However, I'd say it's better to show a button with an auto-turn count of 0 or -1 than stop at 1 with no button.

Rhye's CvDawnOfMan button code (for 3000 BC start, excluding the 600 AD delayed start section):
Code:
iGameTurn = CyGame().getGameTurn()
iNumAutoPlayTurns = con.tBirth[CyGame().getActiveTeam()]
iNumTurnsRemaining = iNumAutoPlayTurns - iGameTurn
#if (iNumTurnsRemaining != self.iTurnsRemaining):
# self.iTurnsRemaining = iNumTurnsRemaining
screen = CyGInterfaceScreen( "CvLoadingScreen", self.iScreenID )
exponent = 1 + iNumAutoPlayTurns/190
if (gc.getPlayer(0).isPlayable()): #late start condition
screen.setBarPercentage("ProgressBar", InfoBarTypes.INFOBAR_STORED, float(math.pow(iGameTurn, exponent)) / float(math.pow(iNumAutoPlayTurns, exponent)))
else:
screen.setBarPercentage("ProgressBar", InfoBarTypes.INFOBAR_STORED, float(math.pow(iGameTurn-151, exponent)) / float(math.pow(iNumAutoPlayTurns-151, exponent)))
screen.setLabel("Text", "", CyTranslator().getText("TXT_KEY_AUTOPLAY_TURNS_REMAINING", (iNumTurnsRemaining,)), CvUtil.FONT_CENTER_JUSTIFY, 530, 445, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
if (iNumTurnsRemaining <= 0): #Rhye
screen.show( "Exit" ) #Rhye
Now the weird part is players starting at the wrong turn. The inconsistency here indeed seems to stem from the removal of that setAlive call - if I uncomment it, the game consistently spawns human players after Egypt one turn too late. I've looked into this before, and IIRC this is because setAlive sometimes ends the player's turn for some reason. I'll have to find a workaround for that - spawning human players one turn earlier could work, but there must be some saner way to do it.
RFCMarathon (the example I used in my post) by emryodead is a modmod that adds Epic and Marathon play lengths to otherwise vanilla original RFC; to do so it had to rewrite all the hard-coded turn/date conversions into function calls - and did a pretty good job, with a few minor bugs like the abovementioned starting turn slippage. However the start dates are still set in Consts.py. My suspicion is that random events, possibly the collapse of AI civs during autoplay, cause date and turn calculations to collide in unexpected ways.
I've tried reading setAlive with soft eyes. The only things that jumped out were the call setTurnActive(false), which might advance the turn counter unexpectedly depending on the spawning player's isAlive() status, and (GC.getGameINLINE().getNumGameTurnActive() == 0) OR-sandwiched into the MultiPlayer evaluation; as already mentioned, my c++ foo is very weak. I'll stick to reporting observations. It's less likely to get me in trouble.
