patchFreeciv - Patches: patch #1541, new savegame format

 
 
Show feedback again

patch #1541: new savegame format

Submitted by:  Matthias Pfafferodt <syntron>
Submitted on:  Sat 20 Mar 2010 02:20:25 PM UTC  
 
Category: generalPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Matthias Pfafferodt <syntron>Open/Closed: Closed
Planned Release: 2.3.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 10 Jul 2010 11:30:52 AM UTC, SVN revision 17568:

remove some clutter from savegame2.c (gna patch #1541)

(Browse SVN revision 17568)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Sat 10 Jul 2010 11:00:21 AM UTC, SVN revision 17567:

fix missing definition of GAME_DEFAULT_SAVEVERSION (gna patch #1541)

(Browse SVN revision 17567)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Sat 10 Jul 2010 10:40:10 AM UTC, SVN revision 17565:

add new files for gna patch #1541

(Browse SVN revision 17565)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Sat 10 Jul 2010 10:39:28 AM UTC, SVN revision 17564:

basic support for savegame version 2 with timing

  • add saveversion setting
  • add content to savegame2.c
  • remove all optional capabilities
  • sever settings in a separate block
  • merge embassy/give_shared_vision into diplstate
  • save map data only for alive players
  • compatibility framework
  • number of players
  • cleanup struct unit
  • saving of known map for > 32 players
  • saving of bigger maps
  • fix player owner map (foggedborders)
  • ... (more) ...
  • if possible test the new format!

see gna patch #1541

(Browse SVN revision 17564)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Tue 06 Jul 2010 10:12:07 AM UTC, comment #10:

If somebody has a savegame which gave errors / resulted in bugs since march 2010 it should be tested against the new savefile format (using the script sg-test.bin; file #9459). I did include all the changes but perhaps I did missed something important.

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Tue 06 Jul 2010 10:06:51 AM UTC, comment #9:

updated version including all changes

(file #9458, file #9459)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Mon 05 Jul 2010 11:55:42 PM UTC, comment #8:

same information:

  • generator 2 should be used (else freeciv vrashes)
  • a game with size 100 and aifill 100 is working
  • saving a game needs > 5min and results in a big(!) savefile (130MB uncompressed)
  • most of the time is needed to compress the data
  • size 40 and aifill 40: 170kB (22MB uncompressed)
Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Mon 05 Jul 2010 11:34:01 PM UTC, comment #7:

an additional fix is needed to save the owner map for each player; this patch will be included in the main patch file

(file #9452)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Mon 05 Jul 2010 09:53:39 PM UTC, comment #6:

updated patch; this fixes a lot of trouble with the new savegame format. It is required if you want to use > 32 players or bigger maps.

patch comment:

(file #9448)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Mon 05 Jul 2010 03:10:45 PM UTC, comment #5:

basic support for savegame version 2 with timing

  • add saveversion setting
  • add content to savegame2.c
  • remove all optional capabilities
  • sever settings in a separate block
  • merge embassy/give_shared_vision into diplstate
  • save map data only for alive players
  • compatibility framework

How to test it:

apply the patch; rename any savegame as sg-testme.sav and run the attached script (sg-test.bin)

The old savegame file is used to load/save savefiles for 2.2.x. If debugging is activated such a file can be created by setting 'saveversion' to -1 (undocumented).

(file #9439, file #9440)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Mon 22 Mar 2010 08:43:36 PM UTC, comment #4:

About loading / saving different versions of savegames:

  • keep one function to load the current version
  • small functions between releases for savegame changes (2.2.0 -> 2.2.1; 2.2.0 => 2.3.0) which change the secfile data (add / modify / remove data)
  • compile option to deactivate this code path

pseud code (based on this patch):

This could use the internal definitions if the game is resetted before the main (current) loading routine is started.

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Sat 20 Mar 2010 08:00:55 PM UTC, comment #3:

> Did you already read things I wrote some times ago at http://freeciv.wikia.com/wiki/User:...


Yes I read this and one or two things are done:

  • not killing the server on error
  • remove old definitions
  • sorting all the different modules into their own functions. starting with this it should be possible to add code which allows to load only a certain savegame version

At the moment I have no concept wrt the last point. How to do this ...

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Sat 20 Mar 2010 07:04:21 PM UTC, comment #2:

> One the one hand there is no structure, one the other hand
> loading a damaged savegame will kill the server.


I doubt this is realizable without designing real game and map objects.

Did you already read things I wrote some times ago at http://freeciv.wikia.com/wiki/User:Pepeto/Some_ideas_for_2.3

pepeto <pepeto>
Project Member
Sat 20 Mar 2010 02:31:26 PM UTC, comment #1:

test script for the new format

(file #8583)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Sat 20 Mar 2010 02:20:25 PM UTC, original submission:

The current savegame.c file has some disadvantages. One the one hand there is no structure, one the other hand loading a damaged savegame will kill the server. This patch series adds a savegame2.c file to freeciv. This file is a rewrite of the old savegame file. Comments to additional movements of code or renaming of variables within the save file are wellcome.

The file attached to this ticket contants all data. Important is the bash script 'sg-test.bin'. It can be used to test the compability between the old and new savegames. If you rename a savegame as 'sg-testme.sav.bz2', this file will

  • load 'sg-testme.sav.bz2' and save it in the old format (sg-test01-old.sav.bz2)
  • load 'sg-test01-old.sav.bz2' and save it in the new format (sg-test02-new.sav.bz2)
  • load 'sg-test02-new.sav.bz2' and save it in the old format (sg-test03-old.sav.bz2)
  • load 'sg-test01-old.sav.bz2' and save it in the old format (sg-test04-old.sav.bz2)
  • create diffs between 1-3, 1-4 and 3-4

The main differences are:

  • no map for dead players are saved in the new format
  • differences within the event log
  • (sometimes) differences in the update time for tiles, this can also be found in the diff 1-4 (only old format)
Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #9459:  sg-test.bin added by syntron (2kB - application/x-shellscript)
file #9440:  sg-test.bin added by syntron (2kB - application/x-shellscript)
file #8583:  sg-test.bin added by syntron (2kB - application/x-shellscript)
file #8576:  savegame2.diff added by syntron (216kB - text/x-diff)

 

Digest:
   bug dependencies, patch dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by pepeto (Posted a comment)
  • -unavailable- added by syntron (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 20 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 10 Jul 2010 11:02:48 AM UTCsyntronStatusReady For Test=>Done
      Open/ClosedOpen=>Closed
    Tue 06 Jul 2010 10:06:51 AM UTCsyntronAttached File-=>Added 20100706-22-trunk-basic-support-for-savegame-version-2-with-timing.patch, #9458
      Attached File-=>Added sg-test.bin, #9459
    Mon 05 Jul 2010 11:34:01 PM UTCsyntronAttached File-=>Added 20100705-12-trunk-fix-player-owner-map-foggedborders.patch, #9452
    Mon 05 Jul 2010 09:53:39 PM UTCsyntronAttached File-=>Added 20100705-02-trunk-fix-savegame2.patch, #9448
    Mon 05 Jul 2010 09:43:46 PM UTCsyntronDependencies-=>Depends on bugs #16234
    Mon 05 Jul 2010 09:30:08 PM UTCsyntronDependencies-=>Depends on patch #1732
      Dependencies-=>Depends on patch #1629
    Mon 05 Jul 2010 03:10:45 PM UTCsyntronAttached File-=>Added 20100705-04-trunk-basic-support-for-savegame-version-2-with-timing.patch, #9439
      Attached File-=>Added sg-test.bin, #9440
      StatusIn Progress=>Ready For Test
      Summary[Metaticket] new savegame format=>new savegame format
    Sat 20 Mar 2010 02:31:26 PM UTCsyntronAttached File-=>Added sg-test.bin, #8583
    Sat 20 Mar 2010 02:30:40 PM UTCsyntronDependencies-=>Depends on patch #1546
    Sat 20 Mar 2010 02:28:58 PM UTCsyntronDependencies-=>Depends on patch #1545
    Sat 20 Mar 2010 02:26:06 PM UTCsyntronDependencies-=>Depends on patch #1544
    Sat 20 Mar 2010 02:25:01 PM UTCsyntronDependencies-=>Depends on patch #1543
    Sat 20 Mar 2010 02:23:02 PM UTCsyntronDependencies-=>Depends on patch #1542
    Sat 20 Mar 2010 02:20:26 PM UTCsyntronAttached File-=>Added savegame2.diff, #8576
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup