help about gamespeed, turns and calendar

Joined
Feb 6, 2006
Messages
795
I've a problem in setting game calendar for a particular game speed.

The problem involves giving each turn a time length less than one year.
If I set 12 months (or a multiple of 12), the game is OK.
If I set 3 months per each turn, the game crashes.
If I set other particular values (18, IIRC), the game is OK for few turns, then crashes.

How have I to do with values which are not multiple of 12?
I see that the regular game, at Marathon, has a value of 3, when you reach the modern era. So, this value "should" work, however...!!!

Am i missing anything?
Is there any other setting to adjust to make it work?
Anyone able to give a hint?
Thanks!
 
Are you sure, that the crashes come from the gamespeed-change?
In my mod, i have only values less than 12 (1-4), and there's no problem.
I've heard only from problems, if you choose values bigger than 12, which can't be divided through 12, but nothing about smaller values.
 
This is my test.
In the GameSpeedInfo.xml, in the GameTurnInfos per each game speed, I set only one GameTurnInfo, with a MonthIncrement of 1, and setting TurnsPerIncrement to the number of turns in the game (333 quick, 500 normal, 750 epic, 1500 marathon).
The game crashes in the very first turn!! Not at the game start, but in the moment I press Enter to end the turn.
Before that, the game worked normally, and it does again when I restore the xml file.
 
Strange :confused:.
Have you changed other things?

Maybe it's a problem with your computer.
I've attached my GameSpeedInfo.xml, i've nearly the same values, and it works for me. What happens, when you use it?
 

Attachments

  • CIV4GameSpeedInfo.zip
    1.2 KB · Views: 73
Ok, some more info. I make it clear: I've modded the SDK, so it might (and will!! :)) be an error introduced by me.

I've tried a Marathon game, setting the time increment to 1 month each turn. This is what I've noticed on the screen.
The game starts: on the screen, I read:
Turn 0, January, 4000BC
Next turn:
Turn 1, #, 3999BC
Next turn:
BOOOMMMM!!!

The error occurs in the function CvGame.doTurn, at the last line:
gDLL->getEngineIFace()->AutoSave();
I know that, because I've added traces before and after that line. The first line is traced, the second doesn't.

Could it be a symptom that, in the second game turn, the month is not displayed, and a # is shown instead?

Help! I'm getting mad!! :mad:
 
Further info.

When autosaving, the CvGameTextMgr::setDateStr function is called, to create the file name for the autosave.
(bool bSave is true, CalendarTypes eCalendar is CALENDAR_DEFAULT, GameSpeedTypes eSpeed is Marathon).

The executed code is thus:
Code:
...
int iMonth = getTurnMonthForGame(iGameTurn, iStartYear, eCalendar, eSpeed);
...
szString = (GC.getMonthInfo((MonthTypes)(iMonth % GC.getNumMonthInfos())).getDescription() + CvString(", ") + szYearBuffer);
...

However, iMonth is computed as negative (the initial month is -4000 * 12, the second turn is (-4000*12)+1, etc.).
When computing the corresponding MonthTypes, iMonth%12 is less than zero, so a valid MonthTypes cannot be computed.
I'm sure about that; I've added this trace
Code:
if ((iMonth % GC.getNumMonthInfos())<0 || (iMonth % GC.getNumMonthInfos())>=12)
and this condition IS VERIFIED!!!

This sounds really odd. Is all that right? Maybe I'm missing something, because this should have bugged the entire game (and it haven't, obviously).
 
Maybe the increment not a multiple of 12 does not work in negative(BC) years.
 
Last edited:
Top Bottom