Re: [Freeciv-Dev] (PR#39441) tracking release 2.0.10

2007-07-11 Thread Christian Knoke

http://bugs.freeciv.org/Ticket/Display.html?id=39441 >

William Allen Simpson wrote on Jul 10, 22:42 (-0700):

> However, it's not worth doing.  I doubt anybody is interested in playing
> 2.1 games on 2.0 with no resources.

It makes it much easier and effortless to playtest a new version, or
just some elements of it, if you can skip back to the previous version
when the new one fails.

Christian

-- 
Christian Knoke* * *http://cknoke.de
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39452) Editor Regenerate Water

2007-07-11 Thread William Allen Simpson

http://bugs.freeciv.org/Ticket/Display.html?id=39452 >

Committed trunk revision 13095.

Index: server/ruleset.c
===
--- server/ruleset.c(revision 13094)
+++ server/ruleset.c(working copy)
@@ -1685,7 +1685,7 @@
   filename, tsec[i]);
   exit(EXIT_FAILURE);
 }
-if (UNKNOWN_TERRAIN_IDENTIFIER == pterrain->identifier) {
+if (TERRAIN_UNKNOWN_IDENTIFIER == pterrain->identifier) {
   freelog(LOG_FATAL, "\"%s\" [%s] cannot use '%c' as an identifier;"
  " it is reserved.",
   filename, tsec[i], pterrain->identifier);
Index: server/maphand.c
===
--- server/maphand.c(revision 13094)
+++ server/maphand.c(working copy)
@@ -129,7 +129,6 @@
 **/
 void assign_continent_numbers(void)
 {
-  
   /* Initialize */
   map.num_continents = 0;
   map.num_oceans = 0;
@@ -172,6 +171,164 @@
  map.num_continents, map.num_oceans);
 }
 
+/**
+  Regenerate all oceanic tiles with coasts, lakes, and deeper oceans.
+  Assumes assign_continent_numbers() and recalculate_lake_surrounders()
+  have already been done!
+  FIXME: insufficiently generalized, use terrain property.
+**/
+void map_regenerate_water(void)
+{
+#define DEFAULT_LAKE_SEA_SIZE (4)  /* should be configurable */
+#define DEFAULT_NEAR_COAST (6)
+  struct terrain *lake = terrain_by_identifier(TERRAIN_LAKE_IDENTIFIER);
+  struct terrain *sea = terrain_by_identifier(TERRAIN_SEA_IDENTIFIER);
+  struct terrain *coast = terrain_by_identifier(TERRAIN_COAST_IDENTIFIER);
+  struct terrain *shelf = terrain_by_identifier(TERRAIN_SHELF_IDENTIFIER);
+  struct terrain *floor = terrain_by_identifier(TERRAIN_FLOOR_IDENTIFIER);
+  int shelf_depth = shelf->property[MG_OCEAN_DEPTH];
+  int coast_count = 0;
+  int shelf_count = 0;
+  int floor_count = 0;
+
+  /* coasts, lakes, and seas */
+  whole_map_iterate(ptile) {
+struct terrain *pterrain = tile_get_terrain(ptile);
+Continent_id here = tile_get_continent(ptile);
+
+if (T_UNKNOWN == pterrain) {
+  continue;
+}
+if (!is_ocean(pterrain)) {
+  continue;
+}
+if (0 < lake_surrounders[-here]) {
+  if (DEFAULT_LAKE_SEA_SIZE < ocean_sizes[-here]) {
+tile_change_terrain(ptile, lake);
+  } else {
+tile_change_terrain(ptile, sea);
+  }
+  update_tile_knowledge(ptile);
+  continue;
+}
+/* leave any existing deep features in place */
+if (pterrain->property[MG_OCEAN_DEPTH] > shelf_depth) {
+  continue;
+}
+
+/* default to shelf */
+tile_change_terrain(ptile, shelf);
+update_tile_knowledge(ptile);
+shelf_count++;
+
+adjc_iterate(ptile, tile2) {
+  if (T_UNKNOWN == tile2->terrain) {
+continue;
+  }
+  /* glacier not otherwise near land floats */
+  if (TERRAIN_GLACIER_IDENTIFIER == tile2->terrain->identifier) {
+continue;
+  }
+  /* any land makes coast */
+  if (!is_ocean(tile2->terrain)) {
+tile_change_terrain(ptile, coast);
+update_tile_knowledge(ptile);
+coast_count++;
+shelf_count--;
+break;
+  }
+} adjc_iterate_end;
+  } whole_map_iterate_end;
+
+  /* continental shelf */
+  whole_map_iterate(ptile) {
+struct terrain *pterrain = tile_get_terrain(ptile);
+int shallow = 0;
+
+if (T_UNKNOWN == pterrain) {
+  continue;
+}
+if (!is_ocean(pterrain)) {
+  continue;
+}
+/* leave any other existing features in place */
+if (pterrain != shelf) {
+  continue;
+}
+
+adjc_iterate(ptile, tile2) {
+  if (T_UNKNOWN == tile2->terrain)
+continue;
+
+  switch (tile2->terrain->identifier) {
+  case TERRAIN_COAST_IDENTIFIER:
+shallow++;
+break;
+  default:
+break;
+  };
+} adjc_iterate_end;
+
+if (DEFAULT_NEAR_COAST < shallow) {
+  /* smooth with neighbors */
+  tile_change_terrain(ptile, coast);
+  update_tile_knowledge(ptile);
+  coast_count++;
+  shelf_count--;
+} else if (0 == shallow) {
+  tile_change_terrain(ptile, floor);
+  update_tile_knowledge(ptile);
+  floor_count++;
+  shelf_count--;
+}
+  } whole_map_iterate_end;
+
+  /* deep ocean floor */
+  whole_map_iterate(ptile) {
+struct terrain *pterrain = tile_get_terrain(ptile);
+int shallow = 0;
+
+if (T_UNKNOWN == pterrain) {
+  continue;
+}
+if (!is_ocean(pterrain)) {
+  continue;
+}
+/* leave any other existing features in place */
+if (pterrain != floor) {
+  continue;
+}
+
+adjc_iterate(ptile, tile2) {
+  if (T_UNKNOWN == tile2->terrain)
+continue;
+
+  switch

[Freeciv-Dev] (PR#39382) civ1 and civ2 rulesets crash, no sea barbarians, bad tech Never

2007-07-11 Thread Ulrik Sverdrup

http://bugs.freeciv.org/Ticket/Display.html?id=39382 >

To resolve the last item in this bug, the "bad tech Never" message for
the civ1 ruleset; trunk requires a req for Airbase that is always false.
Here is a small patch.
(The requirement "None" is always active, and negated it is never active)
Index: data/civ1/terrain.ruleset
===
--- data/civ1/terrain.ruleset	(revision 13094)
+++ data/civ1/terrain.ruleset	(arbetskopia)
@@ -939,8 +939,8 @@
 graphic_alt  = "-"
 activity_gfx = "unit.airbase"
 reqs =
-{ "type", "name", "range"
-  "Tech", "Never", "Player"
+{ "type", "name", "range", "negated"
+  "None", "", "", 1
 }
 gui_type = "Airbase"
 native_to= "Air", "Missile"
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39452) Editor Regenerate Water

2007-07-11 Thread William Allen Simpson

http://bugs.freeciv.org/Ticket/Display.html?id=39452 >

Adds Regenerate Water to the terrain editor.  This will assist in testing
the civ3+ water, and for future optional conversion of saved games.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#13215) AI choice problems in civ1 ruleset

2007-07-11 Thread Ulrik Sverdrup

http://bugs.freeciv.org/Ticket/Display.html?id=13215 >

(PR#13215) AI choice problems in civ1 ruleset
(PR#39399) 2.1 Ancients modpack bug

Combined these tickets; both the civ1 and ancients rulesets have a
'simplified' list of alternatives in the early game which gives this
behaviour from the ai.

In civ1 there is no Coinage and in Ancients there is no Coinage or
NonMil or even Workers (the Settlers in Ancients can only found cities).

According to the code error text, this is a bug in the ruleset. But the
documentation does not say that units with unit flags NonMil, Settlers
and possibly others should be available from the start.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39441) tracking release 2.0.10

2007-07-11 Thread Ulrik Sverdrup

http://bugs.freeciv.org/Ticket/Display.html?id=39441 >

Further about savegame compatibility:
In 2.1 we introduced the $..$ delimiter for secfiles for code blocks. 

First it was read-only, but that caused ticket 39442: So I built upon
that in http://bugs.freeciv.org/Ticket/Display.html?id=39442 so that
saves with code blocks are probably not 2.0-compatible anymore. That
change could maybe be backed out for S2_1 of course, making $..$
read-only again.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev