Summary: Behaviour on saving without have_resources poorly
                 Project: Freeciv
            Submitted by: jtn
            Submitted on: Sat Dec 14 13:26:42 2013
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: Any
         Planned Release: 



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.


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to