bugFreeciv - Bugs: bug #21347, Ability to not save resources not...

 
 
Show feedback again

bug #21347: Ability to not save resources not exposed to scenario editor

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sat 14 Dec 2013 01:27:03 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 01:27:03 PM UTC, original submission:

For scenarios, the savefile format has the ability to specify that no resources be saved in the scenario, so that resources will be generated randomly when the scenario is loaded for play, according to settings chosen in pregame.

(This is controlled by the "specials" capability in the savefile, which becomes the server's "have_resources" variable -- in fact these have controlled whether more stuff is saved at various times, see bug #21346 for confusion, which will need sorting out first.)

  • There's an additional wrinkle: if the savegame doesn't have the "specials" capability but does have "rivers_overlay", then just river specials are saved (in older versions; gen_roads makes this moot in newer versions).

However, there's no way for people editing scenarios with the built-in map editor to access this functionality, though -- it's currently necessary to hack savefiles by hand, I think. (Maybe the old, separate editor could use these?)

The only way to load a scenario for editing is to start a game with it (which will generate resources and set have_resources). If you go into edit mode and do "save scenario", those resources will be saved in the game and new resources will not be generated when the resulting scenario is loaded for play.

Existing scenarios with this property (search as earth-80x50-v3, which has "rivers_overlay" instead of "specials") thus can't be edited without losing this property.

The obvious place to expose this in the UI is as a flag alongside "Save players" in game/scenario properties. Implementation issues:

  • What should be the UI if a player does "save scenario" with this flag set but resources present on the map? The obvious one is to pop up a "clear resources or unset flag" choice, but the client/server interaction makes this hard. Unlike players, I'm uncomfortable with quietly discarding stuff in the savefile but leaving it visible in the editor -- too easy to lose work.
  • We'll need to squirrel away the 'have_resources' value from game load so that it can be reinstated on scenario save, because currently you can only edit having gone through a game-start transition, which will set the real have_resources flag.

Could in principle expose 'have_rivers_overlay', but if we only get round to this in S2_5 or later (as seems likely) then I think the issue goes away (and so should rivers_overlay, probably).

May as well expose 'have_huts' at the same time (once the confusion of bug #21345 is sorted out).

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

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -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-=>Depends on bugs #21346
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup