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]
To: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: scorelog/savegame inconsistencies
From: Justin Moore <justin@xxxxxxxxxxx>
Date: Mon, 30 Jul 2001 11:54:41 -0400 (EDT)

> The reason it's conceptually wrong is that civscore.log consists of
> derived information (the Reports that can be viewed during the game,
> plus a few more).  civscore.log can be constructed from the savegames.

   It depends on how often you save the games (I would guess).  If you
only save once every ten turns (or only manually) how could you construct
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
takes the hassle out of having to fiddle with the civscore.log file
itself.

   The patch allows for backwards compatability, though.  You can choose a
standalone file, a merge log/savegame file, or both.

> Actually, I have a utility to do that, and I've used it in the past to
> construct civscore.log files for games in which the civscore.log was
> missing or corrupted.

   I'd like to see this.  Where could I grab a copy?

> 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

   The largest (only?) game on civserver.freeciv.org right now has 4
players and has gone ~300 turns => 4 * 27 * 300 * 4 = ~127 Kb.

   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.
After a rigorous round of tests, I can put an upper bound on savegame
growth at 1K per player per ten turns.  Using the same civserver game,
their savefile would be (4 * 300 * 1 / 10) = 120 Kb larger.

   Maybe a helpful feature to go with my patch would be a command for the
server to write out the civscore.log file based on the data resident in
memory.  New civscore.log created on the spot, no reconstruction needed.

-jdm

Department of Computer Science, Duke University, Durham, NC 27708-0129
Email:  justin@xxxxxxxxxxx



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