bugFreeciv - Bugs: bug #15684, ownership of tiles not stable via...

Show feedback again

bug #15684: ownership of tiles not stable via save / load cycle

Submitted by:  Matthias Pfafferodt <syntron>
Submitted on:  Tue Mar 23 20:16:20 2010  
Category: NoneSeverity: 3 - Normal
Priority: 1 - LaterStatus: None
Assigned to: NoneOpen/Closed: Open
Release: svn16977Operating System: None
Planned Release: Contains string changes: None

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)

Tue Nov 2 10:36:55 2010, comment #10:

See also bug #16710.

pepeto <pepeto>
Project Member
Fri Aug 20 21:39:05 2010, comment #9:

Another cause is if you discover previously unknown territory that would otherwise have been within your borders -- normally your borders expand next turn, but if you save and load, the borders are recalculated and the land is yours the same turn.

Jacob Nevins <jtn>
Project Administrator
Fri Aug 6 23:52:03 2010, comment #8:

One cause of such instability can be if a border source has been destroyed this turn. For instance, say a buoy on a tile that would have otherwise been within your borders is pillaged. The tile->source (claimer) will have been the buoy tile itself, and after the buoy is destroyed there's no cheap way to determine that tile->source should become the city (or whatever) that would otherwise have claimed the tile. So it becomes NULL and your borders (temporarily) shrink.

If you save and re-load at this point, this tile will once again be within your borders, because there is an expensive way to determine correct borders -- map_calculate_borders() -- which is called when savefiles are loaded. (It's also called on turn end, so you would have got the tile back soon enough anyway.)

The same applies but more so when a fortress is pillaged (and presumably when a city is destroyed, I haven't tested) -- not only does the border source tile become unowned, so do any other tiles that were under its influence, and this state is resolved either by turn-end or save/reload.

I assume that it is too expensive to do a full map_calculate_borders() whenever a border source is destroyed, even though it doesn't happen that often?

I haven't checked whether any of this is what's going on in your test case, though.

Jacob Nevins <jtn>
Project Administrator
Sat Mar 27 15:03:30 2010, comment #7:

and the diff between the manual save and the save after the game was started again (restart). No changes besides the event cache and the timeout setting are found. So this seems to depend on the timing of the call to the autosave function?

(file #8689)

Matthias Pfafferodt <syntron>
Project Member
Sat Mar 27 15:01:04 2010, comment #6:

I started a new game for this due to changes in the savegame format (variable city radii):

1. > ./ser -r test.ser

will save 'civgame-T0050-Y-1500BC-auto.sav.bz2'

2. > ./ser -f civgame-T0050-Y-1500BC-auto.sav.bz2

save this file (civgame-T0050-Y-1500BC-manual.sav.bz2)

3. set timeout 0; save civgame-T0050-Y-1500BC-restart

creates the third file

Besides the first savefiles the script test.serv and the diffs are attached

(file #8685, file #8686, file #8687, file #8688)

Matthias Pfafferodt <syntron>
Project Member
Sat Mar 27 14:05:51 2010, comment #5:

I meant a diff between 2 the auto save and a manual save after the game started again).

pepeto <pepeto>
Project Member
Sat Mar 27 14:03:05 2010, comment #4:

> Could you attach the diff just after starting it?

I think you mean the original savegame files. Both are attached.

I do not have a savefile from the gamestart (turn 0) as this was a autogame running with 'saveturn 50'. But you can try your own game. I did observe similar differences in the savefiles for most of my tests.

(file #8679, file #8680)

Matthias Pfafferodt <syntron>
Project Member
Sat Mar 27 13:44:41 2010, comment #3:

> 2. load it (do not start the game!)

Could you attach the diff just after starting it?

pepeto <pepeto>
Project Member
Thu Mar 25 07:09:33 2010, comment #2:

The savegame was created using current trunk (for this test svn 17149). The autogame options are:

after that the saved game of the 50th turn (civgame-T0050-Y-1500BC-auto.sav.bz2) was loaded and saved again (civgame-T0050-Y-1500BC-manual.sav.bz2). The diff between both save files is attached.

(file #8646)

Matthias Pfafferodt <syntron>
Project Member
Wed Mar 24 22:24:11 2010, comment #1:

What was the version of the savegame, and with what branch did you loaded it?

pepeto <pepeto>
Project Member
Tue Mar 23 20:16:20 2010, original submission:

take a game in a late state (all tiles owned by a player) and do

1. save it
2. load it (do not start the game!)
3. save it again

and compare both save files via diff (or kdiff3). I did observe changes in the owner / map_owner fields.

Expected result: identical files (exception: event cache?)

Matthias Pfafferodt <syntron>
Project Member


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

Attach File(s):

Attached Files
file #8685:  test.serv added by syntron (93B - text/plain)
file #8686:  civgame-T0050-Y-1500BC-auto.sav.bz2 added by syntron (16kB - application/x-bzip2)
file #8687:  civgame-auto-manual.diff added by syntron (22kB - text/x-diff)
file #8688:  civgame-auto-restart.diff added by syntron (22kB - text/x-diff)
file #8679:  civgame-T0050-Y-1500BC-auto.sav.bz2 added by syntron (27kB - application/x-bzip2)
file #8680:  civgame-T0050-Y-1500BC-manual.sav.bz2 added by syntron (27kB - application/x-bzip2)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jtn (Posted a comment)
  • -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.


    Error: not logged in



    Follow 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Dec 31 16:10:07 2010pepetoAssigned topepeto=>None
    Sun Nov 28 00:51:13 2010pepetoAssigned toNone=>pepeto
    Sat Mar 27 15:03:30 2010syntronAttached File-=>Added civgame-manual-restart.diff, #8689
    Sat Mar 27 15:01:04 2010syntronAttached File-=>Added test.serv, #8685
      Attached File-=>Added civgame-T0050-Y-1500BC-auto.sav.bz2, #8686
      Attached File-=>Added civgame-auto-manual.diff, #8687
      Attached File-=>Added civgame-auto-restart.diff, #8688
    Sat Mar 27 14:03:05 2010syntronAttached File-=>Added civgame-T0050-Y-1500BC-auto.sav.bz2, #8679
      Attached File-=>Added civgame-T0050-Y-1500BC-manual.sav.bz2, #8680
    Thu Mar 25 07:09:33 2010syntronAttached File-=>Added civgame-T0050-Y-1500BC.diff, #8646
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup