<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40338 >

 - This patch makes max size of freshwater lakes configurable.
Anything bigger than this is ocean, anything smaller is lake
 - Fixed reversed logic
 - Removed lakes from civ1 & civ2 rulesets, still present in default rules.

 Either lakes need to be removed from default ruleset too, or separate
graphics should be created for them. I'm in favor of keeping them as
separate terrain that does not have Whales around.


 It seems that regenerate_water() is still not always used in initial
map generator. This patch can be tested by "Regenerate water" in
editor mode.


 - ML

diff -Nurd -X.diff_ignore freeciv/common/packets.def freeciv/common/packets.def
--- freeciv/common/packets.def  2008-06-24 01:37:50.000000000 +0300
+++ freeciv/common/packets.def  2008-06-28 21:36:47.000000000 +0300
@@ -1178,6 +1178,7 @@
   /* parameters */
   UINT8 ocean_reclaim_requirement_pct; /* # adjacent land tiles for reclaim */
   UINT8 land_channel_requirement_pct; /* # adjacent ocean tiles for channel */
+  UINT8 lake_max_size;                /* bodies of water up to this size are 
freshwater */
   RIVER_MOVE river_move_mode;
 
   SINT16 river_defense_bonus;           /* % added to defense if Civ2 river */
diff -Nurd -X.diff_ignore freeciv/data/civ1/terrain.ruleset 
freeciv/data/civ1/terrain.ruleset
--- freeciv/data/civ1/terrain.ruleset   2008-06-28 20:28:00.000000000 +0300
+++ freeciv/data/civ1/terrain.ruleset   2008-06-28 21:36:47.000000000 +0300
@@ -30,6 +30,10 @@
 ; it may be "channeled" into a water tile (0-101; 0=anywhere, default 
101=nowhere)
 land_channel_requirement=101
 
+; Bodies of water up to this size are considered freshwater lakes, if there is
+; also terrain type(s) with flag "FreshWater" in the ruleset.
+lake_max_size = 0
+
 ; special movement costs for rivers:
 ;   0 - normal movement cost for rivers (matches Civ1)
 ;   1 - 1/3 movement cost, but only when moving exactly along rivers,
@@ -152,6 +156,7 @@
 ;                        units.  Most terrain improvements can only be built
 ;                        on land.  Oceanic terrain has no zones of control.
 ;                        The list goes on.
+;   - FreshWater       = This terrain is used for small bodies of water.
 ; property_*           = specific property % values used by mapgen.  Most
 ;                        terrains will have 0 for most values.
 ;  - mountainous       = degree to which this terrain is mountainous
@@ -167,41 +172,6 @@
 ; helptext             = optional help text string; should escape all raw 
 ;                        newlines so that xgettext parsing works
 
-[terrain_fresh_water_coast]
-name                 = _("Lake")
-graphic              = "coast"
-graphic_alt          = "-"
-identifier           = "+"
-movement_cost        = 1
-defense_bonus        = 0
-food                 = 1
-shield               = 0
-trade                = 2
-resources            = "resource_fish"
-road_trade_incr      = 0
-road_time            = 0
-irrigation_result    = "no"
-irrigation_food_incr = 0
-irrigation_time      = 0
-mining_result        = "no"
-mining_shield_incr   = 0
-mining_time          = 0
-transform_result     = "no"
-transform_time       = 0
-warmer_wetter_result = "no"
-warmer_drier_result  = "no"
-cooler_wetter_result = "no"
-cooler_drier_result  = "no"
-native_to            = "Sea", "Air", "Missile"
-flags                = "Oceanic", "NoCities", "NoPollution", "FreshWater"
-property_ocean_depth = 0
-helptext             = _("\
-Oceans cover much of the world, and only sea units (Triremes and\
- other boats) can travel on them.\
-\n\n\
-Ocean squares can never be polluted or subjected to fallout.\
-")
-
 [terrain_salt_water_coast]
 name                 = _("Sea")
 graphic              = "coast"
diff -Nurd -X.diff_ignore freeciv/data/civ2/terrain.ruleset 
freeciv/data/civ2/terrain.ruleset
--- freeciv/data/civ2/terrain.ruleset   2008-06-28 20:28:00.000000000 +0300
+++ freeciv/data/civ2/terrain.ruleset   2008-06-28 21:36:47.000000000 +0300
@@ -30,6 +30,10 @@
 ; it may be "channeled" into a water tile (0-101; 0=anywhere, default 
101=nowhere)
 land_channel_requirement=101
 
+; Bodies of water up to this size are considered freshwater lakes, if there is
+; also terrain type(s) with flag "FreshWater" in the ruleset.
+lake_max_size = 0
+
 ; special movement costs for rivers:
 ;   0 - normal movement cost for rivers (matches Civ1)
 ;   1 - 1/3 movement cost, but only when moving exactly along rivers,
@@ -160,6 +164,7 @@
 ;                        units.  Most terrain improvements can only be built
 ;                        on land.  Oceanic terrain has no zones of control.
 ;                        The list goes on.
+;   - FreshWater       = This terrain is used for small bodies of water.
 ; property_*           = specific property % values used by mapgen.  Most
 ;                        terrains will have 0 for most values.
 ;  - mountainous       = degree to which this terrain is mountainous
@@ -175,41 +180,6 @@
 ; helptext             = optional help text string; should escape all raw 
 ;                        newlines so that xgettext parsing works
 
-[terrain_fresh_water_coast]
-name                 = _("Lake")
-graphic              = "coast"
-graphic_alt          = "-"
-identifier           = "+"
-movement_cost        = 1
-defense_bonus        = 0
-food                 = 1
-shield               = 0
-trade                = 2
-resources            = "resource_fish"
-road_trade_incr      = 0
-road_time            = 0
-irrigation_result    = "no"
-irrigation_food_incr = 0
-irrigation_time      = 0
-mining_result        = "no"
-mining_shield_incr   = 0
-mining_time          = 0
-transform_result     = "no"
-transform_time       = 0
-warmer_wetter_result = "no"
-warmer_drier_result  = "no"
-cooler_wetter_result = "no"
-cooler_drier_result  = "no"
-native_to            = "Sea", "Air", "Missile", "Helicopter"
-flags                = "Oceanic", "NoCities", "NoPollution", "FreshWater"
-property_ocean_depth = 0
-helptext             = _("\
-Oceans cover much of the world, and only sea units (Triremes and\
- other boats) can travel on them.\
-\n\n\
-Ocean squares can never be polluted or subjected to fallout.\
-")
-
 [terrain_salt_water_coast]
 name                 = _("Sea")
 graphic              = "coast"
diff -Nurd -X.diff_ignore freeciv/data/default/terrain.ruleset 
freeciv/data/default/terrain.ruleset
--- freeciv/data/default/terrain.ruleset        2008-06-28 20:28:01.000000000 
+0300
+++ freeciv/data/default/terrain.ruleset        2008-06-28 21:36:47.000000000 
+0300
@@ -30,6 +30,10 @@
 ; it may be "channeled" into a water tile (0-101; 0=anywhere, default 
101=nowhere)
 land_channel_requirement = 10
 
+; Bodies of water up to this size are considered freshwater lakes, if there is
+; also terrain type(s) with flag "FreshWater" in the ruleset.
+lake_max_size = 14
+
 ; special movement costs for rivers:
 ;   0 - normal movement cost for rivers (matches Civ1)
 ;   1 - 1/3 movement cost, but only when moving exactly along rivers,
@@ -160,6 +164,7 @@
 ;                        units.  Most terrain improvements can only be built
 ;                        on land.  Oceanic terrain has no zones of control.
 ;                        The list goes on.
+;   - FreshWater       = This terrain is used for small bodies of water.
 ; property_*           = specific property % values used by mapgen.  Most
 ;                        terrains will have 0 for most values.
 ;  - mountainous       = degree to which this terrain is mountainous
@@ -175,10 +180,10 @@
 ; helptext             = optional help text string; should escape all raw 
 ;                        newlines so that xgettext parsing works
 
-[terrain_fresh_water_coast]
+[terrain_fresh_water_lake]
 name                 = _("Lake")
-graphic              = "coast"
-graphic_alt          = "-"
+graphic              = "lake"
+graphic_alt          = "coast"
 identifier           = "+"
 movement_cost        = 1
 defense_bonus        = 0
@@ -207,10 +212,7 @@
 flags                = "Oceanic", "NoCities", "NoPollution", "FreshWater"
 property_ocean_depth = 0
 helptext             = _("\
-Oceans cover much of the world, and only sea units (Triremes and\
- other boats) can travel on them.\
-\n\n\
-Ocean squares can never be polluted or subjected to fallout.\
+Lake squares can never be polluted or subjected to fallout.\
 ")
 
 [terrain_salt_water_coast]
diff -Nurd -X.diff_ignore freeciv/server/generator/utilities.c 
freeciv/server/generator/utilities.c
--- freeciv/server/generator/utilities.c        2008-06-28 20:49:38.000000000 
+0300
+++ freeciv/server/generator/utilities.c        2008-06-28 21:46:19.000000000 
+0300
@@ -22,6 +22,7 @@
 
 /* common */
 #include "map.h"
+#include "packets.h"
 
 #include "utilities.h"
 
@@ -316,7 +317,6 @@
 void regenerate_water(tile_knowledge_cb knowledge_cb)
 {
 #define MAX_ALT_TER_TYPES 5
-#define DEFAULT_LAKE_SEA_SIZE (4)  /* should be configurable */
 #define DEFAULT_NEAR_COAST (6)
   struct terrain *lakes[MAX_ALT_TER_TYPES];
   struct terrain *sea = find_terrain_by_identifier(TERRAIN_SEA_IDENTIFIER);
@@ -350,7 +350,7 @@
       continue;
     }
     if (0 < lake_surrounders[-here]) {
-      if (DEFAULT_LAKE_SEA_SIZE < ocean_sizes[-here]
+      if (terrain_control.lake_max_size >= ocean_sizes[-here]
           && num_laketypes > 0) {
         tile_change_terrain(ptile, lakes[myrand(num_laketypes)]);
       } else {
diff -Nurd -X.diff_ignore freeciv/server/ruleset.c freeciv/server/ruleset.c
--- freeciv/server/ruleset.c    2008-06-28 20:49:38.000000000 +0300
+++ freeciv/server/ruleset.c    2008-06-28 21:36:47.000000000 +0300
@@ -1681,6 +1681,9 @@
   terrain_control.land_channel_requirement_pct
     = secfile_lookup_int_default(file, 101,
                                 "parameters.land_channel_requirement");
+  terrain_control.lake_max_size
+    = secfile_lookup_int_default(file, 0,
+                                "parameters.lake_max_size");
   terrain_control.river_move_mode =
     secfile_lookup_int_default(file, RMV_FAST_STRICT, 
"parameters.river_move_mode");
   terrain_control.river_defense_bonus =
diff -Nurd -X.diff_ignore freeciv/version.in freeciv/version.in
--- freeciv/version.in  2008-06-25 12:21:40.000000000 +0300
+++ freeciv/version.in  2008-06-28 21:39:24.000000000 +0300
@@ -23,5 +23,5 @@
 #   - Avoid adding a new mandatory capability to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel.2008.May.08"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel.2008.Jun.28"
 NETWORK_CAPSTRING_OPTIONAL=""
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to