Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10359) Saving changes game state
Home

[Freeciv-Dev] (PR#10359) Saving changes game state

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: marko.lindqvist@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10359) Saving changes game state
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 4 Oct 2004 19:03:57 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10359 >

> [marko.lindqvist@xxxxxxxxxxx - Mon Sep 27 18:59:34 2004]:
> 
> 
>   It seems that simply (auto)saving a game changes its state. Usually 
> this is difficult to notice - when you are not saving there is no save 
> games to compare.
>   Attached two autogames (modified versions of #10208 autogame) differ 
> only in saveturns setting. Running ally_assert.rc, which autosaves every 
> turn, assert fails in year -600. When running allytest.rc, which never 
> saves, assert does not fail (it would fail in year 220)
>   Another possible reason for this is that saveturns setting itself is 
> used for something it shouldn't be used for.

I can reproduce this.  (I did a cvs up -D to the time of the original
report; I don't know if the crash is reproducable now.)

Try running an autogame with saveturns 1.  Then run the same autogame
with saveturns 2.  The savefiles are the same.  So the problem is
probably not directly within game_save().

One possible problem is in gamelog_save.  This calls civ_score which
changes global data (pplayer->score).  Better would be to separate
civ_score into calculate_player_score and get_player_score.  However I
don't think this is the problem since removing the call to gamelog_save
does not affect savegames.

It's also possible that there is a memory error somewhere.  This could
cause different behavior since memory allocation might be different
depending on saveturns.  But the error might only be reproducable in the
original autogame.

jason



[Prev in Thread] Current Thread [Next in Thread]