bugFreeciv - Bugs: bug #20043, On trunk, transforming any tile...

Show feedback again

bug #20043: On trunk, transforming any tile bordering lake turns lake to ocean

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Thu Aug 9 22:37:24 2012  
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Jacob Nevins <jtn>Open/Closed: Closed
Release: trunk r21766Operating System: Any
Planned Release: 2.5.0Contains 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.


Sat Aug 11 11:27:02 2012, SVN revision 21783:

When changing terrain, if the new terrain is freshwater (e.g. Lake) next to
non-freshwater, change the new terrain to non-freshwater (in effect
"flooding" it).
Change all transformations to Ocean in rulesets with Lakes to
transformations into Lake.
This will have the effect that the correct kind of oceanic terrain will
be chosen for transfromations.

Suggested by Marko Lindqvist (cazfi@gna).

See gna bug #20043.

(Browse SVN revision 21783)

Jacob Nevins <jtn>
Project AdministratorIn charge of this item.
Thu Aug 9 22:37:24 2012, original submission:

Since patch #3478, as noted in that bug's comment 6 and in bug #20038.

cazfi suggests a solution:

> 1) Fix flooding to happen also towards the transformed tile
> if it's freshwater and there's adjacent ocean tile
> 2) Make transform_to in all supplied rulesets (and document
> for custom ones) "Lake"
> - If one then transforms next to lake -> (s)he gets lake
> - If one transforms next to ocean -> (s)he gets lake that is
> then immediately flooded with ocean from adjacent tile.
> Temporary lake should not be user-visible at any point.

Attached patch implements this. Notes:

  • For (1), I've used most_shallow_ocean() as the replacement for the lake, rather than propagating one of the nearest ocean types, as I didn't want the possibility of Deep Ocean propagating all the way into an inland lake.
  • For (2), as well as unit transformations, I've also changed the global warming terrain changes from foo->Ocean to foo->Lake. So global warming now grows lakes (perhaps a bit counterintuitive) whereas in S2_4 it would leave ocean next to lake, and in trunk prior to this patch it would always introduce salinity to whole lakes (a bit harsh).
  • This has the effect that terrain help, menus etc say "Transform to Lake".
    • Hopefully this won't confuse the AI in rulesets where freshwater is advantageous? I could imagine it endlessly transforming its coasts in the hope that it'll get a juicy lake. But I don't know if it ever even considers such transformations.
  • The user will not see the intermediate step, but there is one way in which it might become apparent. The "foo -> Lake" step will go through tile_change_terrain(), which will do things like clear incompatible bases, etc. If, say, a base was compatible with "foo" and "Ocean" but not "Lake", it would be lost. (But the previous point means the user should have a clue why.) Probably too unlikely to be worth worrying about.
  • I've also changed the pre-existing flooding from using tile_set_terrain() to tile_change_terrain(). I think this makes more sense as it takes care of removing unsuitable bases, etc (salmon farm ;).
Jacob Nevins <jtn>
Project AdministratorIn charge of this item.


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

Attach File(s):

Attached Files
file #16360:  trunk-transform-to-lake.patch added by jtn (13kB - text/x-diff - trunk r21766)


Depends on the following items: None found

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.


    Error: not logged in



    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Aug 11 11:27:42 2012jtnStatusReady For Test=>Fixed
    Thu Aug 9 22:39:08 2012jtnReleasetrunk r=>trunk r21766
    Thu Aug 9 22:39:03 2012jtnAttached File-=>Added trunk-transform-to-lake.patch, #16360
      StatusIn Progress=>Ready For Test
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup