Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2001:
[Freeciv-Dev] Re: scorelog/savegame inconsistencies
Home

[Freeciv-Dev] Re: scorelog/savegame inconsistencies

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: scorelog/savegame inconsistencies
From: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Date: Mon, 30 Jul 2001 13:53:11 -0700 (PDT)

On Mon, 30 Jul 2001, Justin Moore wrote:
> the civscore.log?  And what about the times where you want to transfer the
> savegame file around?  Or you got your ass kicked when AI player X jumped
> you and you'd like to try from 100 years ago?  I'm just saying that it

Couldn't you take the score log, truncate it at the year you are starting over
from, and then append the score data to that?

> > This comes at the expense of grow memory use, by keeping the while
> > civscore.log info in memory, and disk use, by growing the savegames
> > with it.  The increase in size can be estimated by comparing the
> > relative size of compressed savegames and scorelogs.
> 
> The increase in memory is:
> num_players * num_tags * num_turns * sizeof(int)
> 
> Worst-case = 30 * 27 * 3500 * 4 = 10.8 MB, but that goes until 5000 AD

When you're talking about using a handheld device, stuff like this matters. 
It's also just wrong to save a large amount of data in memory that is never
used except to write it back out to disk.

>    Likewise, a 30-player AI that ran 280 turns has a scorelog of 2866 Kb
> and a savegame of 74.65 Kb.  And that's with my (kludgey) saving routine.

But think about auto saving every turn.  Each time you save you also write out
another copy of the score log that includes a copy of all the data from the
previous turn.  The size of the score data grows at O(turns^2) instead of
O(turns).



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