[Freeciv-Dev] [patch #1541] [Metaticket] new savegame format
Follow-up Comment #4, patch #1541 (project freeciv): 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): void sg_load_player_version202000(struct loaddata *loading); { ... #ifdef FC_COMPAT_SAVEGAME sg_load_player_compat(struct loaddata *loading); #endif sg_load_player(loading); ... } #ifdef FC_COMPAT_SAVEGAME void sg_load_player_compat(struct loaddata *loading) { /* get savegame version and load corresponding function, i.e */ sg_load_player_version201000(loading); } void sg_load_player_version201000(struct loaddata *loading) { /* modify secfile; all changes between versions */ int data = secfile_secfile_lookup_int_default(loading-file, default_value, old.secfile.position); secfile_delete(old.secfile.position); secfile_insert_int(loading-file, data, new.secfile.definition); } #endif void sg_load_player(struct loaddata *loading) { /* loads the 2.3.0 development version of the savegame */ } This could use the internal definitions if the game is resetted before the main (current) loading routine is started. ___ Reply to this item at: http://gna.org/patch/?1541 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1541] [Metaticket] new savegame format
URL: http://gna.org/patch/?1541 Summary: [Metaticket] new savegame format Project: Freeciv Submitted by: syntron Submitted on: Samstag 20.03.2010 um 15:20 Category: general Priority: 5 - Normal Status: In Progress Privacy: Public Assigned to: syntron Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: 2.3.0 ___ Details: 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) ___ File Attachments: --- Date: Samstag 20.03.2010 um 15:20 Name: savegame2.diff Size: 216kB By: syntron http://gna.org/patch/download.php?file_id=8576 ___ Reply to this item at: http://gna.org/patch/?1541 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1541] [Metaticket] new savegame format
Update of patch #1541 (project freeciv): Depends on: = patch #1542 ___ Reply to this item at: http://gna.org/patch/?1541 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1541] [Metaticket] new savegame format
Update of patch #1541 (project freeciv): Depends on: = patch #1543 ___ Reply to this item at: http://gna.org/patch/?1541 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1541] [Metaticket] new savegame format
Update of patch #1541 (project freeciv): Depends on: = patch #1544 ___ Reply to this item at: http://gna.org/patch/?1541 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1541] [Metaticket] new savegame format
Update of patch #1541 (project freeciv): Depends on: = patch #1545 ___ Reply to this item at: http://gna.org/patch/?1541 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1541] [Metaticket] new savegame format
Update of patch #1541 (project freeciv): Depends on: = patch #1546 ___ Reply to this item at: http://gna.org/patch/?1541 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1541] [Metaticket] new savegame format
Follow-up Comment #1, patch #1541 (project freeciv): test script for the new format (file #8583) ___ Additional Item Attachment: File name: sg-test.binSize:1 KB ___ Reply to this item at: http://gna.org/patch/?1541 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1541] [Metaticket] new savegame format
Follow-up Comment #2, patch #1541 (project freeciv): 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 ___ Reply to this item at: http://gna.org/patch/?1541 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1541] [Metaticket] new savegame format
Follow-up Comment #3, patch #1541 (project freeciv): 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 ... ___ Reply to this item at: http://gna.org/patch/?1541 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev