bugFreeciv - Bugs: bug #21346, Behaviour on saving without...

 
 
Show feedback again

bug #21346: Behaviour on saving without have_resources poorly defined

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sat 14 Dec 2013 01:26:42 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: None
Assigned to: NoneOpen/Closed: Open
Release: Operating System: Any
Planned Release: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Sat 14 Dec 2013 02:08:24 PM UTC, comment #1:

> (There's also a rivers_overlay wart in saving, but since it


I don't think server ever saves as rivers_overlay, it just loads (old) scenarios where it's set.
What is missing here, is having savegame format support for such scenarios with rivers as gen-roads.

> saves S_OLD_RIVER from run-state I think it will never be
> activated in practice? I'm a bit surprised by the presence of
> compatibility code for absence of ruleset ROCO_RIVER, given
> that S_OLD_RIVER seems illegal while running now -- maybe this
> is work in progress?)


All this seems to be related to loading (where rivers_overlay code is) being different from saving (where you thought it to be)

Marko Lindqvist <cazfi>
Project Administrator
Sat 14 Dec 2013 01:26:42 PM UTC, original submission:

Freeciv seems to be changing its mind over time about what the map.server.have_resources variable (and associated 'specials' savefile capability) controls.

If have_resources is not set at save time, if I'm reading the code right:

  • In savegame.c (and S2_2), none of resources, specials, or bases are saved. (And similar behaviour on load.)
  • On S2_3/S2_4, resources and specials are not saved, but bases are. (And similarly for loading new-format savefiles.)
  • On S2_5, resources and non-road/river specials are not saved, but bases and roads/rivers are. Loading is similar (old savefiles are treated as above).
    • (There's also a rivers_overlay wart in saving, but since it saves S_OLD_RIVER from run-state I think it will never be activated in practice? I'm a bit surprised by the presence of compatibility code for absence of ruleset ROCO_RIVER, given that S_OLD_RIVER seems illegal while running now -- maybe this is work in progress?)
  • On trunk, resources are not saved, but extras (which includes old bases and specials) are.

(all modulo rivers_overlay)

This is I think mostly academic, because currently there's no way to save a scenario game without have_resources set, as it will get resources generated and have_resources set at game start, and the UI doesn't allow "save scenario" before that. (I think the debug-only '/scensave' command may be an exception to this?)

If we take the older behaviour as more correct/intended, then I think the 'have_resources'/'specials' flags are both misnamed, as in fact they controlled all terrain additions other than rivers.

Alternatively, we could retrospectively declare that it refers to just resources, and that older saving behaviour was a bug -- probably the most useful thing it controls is whether random resources get generated fresh on scenario load.
(Would need to work out what to do when loading scenarios from older eras, but because of the saving behaviour there shouldn't be many kicking around with specials that have previously been ignored on load.)

I haven't tested much of this understanding, and may have misread the situation; clearly some thought has been going into updating this stuff recently for roads/extras.

Jacob Nevins <jtn>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

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

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 14 Dec 2013 01:27:15 PM UTCjtnDependencies-=>bugs #21347 is dependent
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup