Complete.Org: Mailing Lists: Archives: freeciv-dev: February 1999:
[Freeciv-Dev] time and first fix to mapgen4.diff
Home

[Freeciv-Dev] time and first fix to mapgen4.diff

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: schaefer@xxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] time and first fix to mapgen4.diff
From: Peter Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Feb 1999 16:45:22 +0100

The time delta matches civ2 better and is
considering the spacerace too.

The mapgen adjust_terrain_param function
was programmed very sloppily by me and needed 2 bugs removed
and 1 improvement made.
--
Peter Schaefer           mailto:schaefer@xxxxxxxxxxxxxxxxxxxxxxxxxxx     
X-Url: http://wwwhoppe.math.uni-augsburg.de/~schaefer/
coz' hackers LOVE irix
--- feb12cvs/common/game.c      Fri Feb 12 19:09:49 1999
+++ freeciv/common/game.c       Tue Feb 16 15:58:15 1999
@@ -311,19 +311,47 @@
 ***************************************************************/
 void game_next_year(void)
 {
+  int spaceshipparts;
+
   if (game.year == 1) /* hacked it to get rid of year 0 */
     game.year = 0;
 
-  if (game.year < 1000)
-    game.year += 20;
-  else if (game.year < 1500)
-    game.year += 10;
-  else if (game.year < 1700)
-    game.year += 5;
-  else if (game.year < 1800)
+    /* !McFred: 
+       - want game.year += 1 for spaceship.
+    */
+
+  /* test game with 7 normal AI's, gen 4 map, foodbox 10, foodbase 0: 
+   * Gunpowder about 0 AD
+   * Railroad  about 500 AD
+   * Electricity about 1000 AD
+   * Refining about 1500 AD (212 active units)
+   * about 1750 AD
+   * about 1900 AD
+   */
+
+
+  spaceshipparts= 0;
+  if(game.global_advances[ improvement_types[B_SCOMP].tech_requirement ])
+    spaceshipparts++;
+  if(game.global_advances[ improvement_types[B_SMODULE].tech_requirement ])
+    spaceshipparts++;
+  if(game.global_advances[ improvement_types[B_SSTRUCTURAL].tech_requirement ])
+    spaceshipparts++;
+
+  if( game.year >= 1900 || ( spaceshipparts>=3 && game.year>0 ) )
+    game.year += 1;
+  else if( game.year >= 1750 || spaceshipparts>=2 )
     game.year += 2;
+  else if( game.year >= 1500 || spaceshipparts>=1 )
+    game.year += 5;
+  else if( game.year >= 1000 )
+    game.year += 10;
+  else if( game.year >= 0 )
+    game.year += 20;
+  else if( game.year >= -1000 ) /* used this line for tuning (was -1250) */
+    game.year += 25;
   else
-    game.year++;
+    game.year += 50; 
 
   if (game.year == 0) 
     game.year = 1;
--- freemap/server/mapgen.c     Fri Feb 12 19:08:41 1999
+++ freeciv/server/mapgen.c     Tue Feb 16 16:31:32 1999
@@ -726,25 +726,37 @@
 
   map.riverlength/= 10;/* left in */
 
-  total = map.riverlength + map.mountains
-    + map.deserts + map.forestsize 
-    + map.swampsize + map.grasssize
-    + map.deserts;
+    total = map.riverlength + map.mountains + map.deserts 
+    + map.forestsize + map.swampsize + map.grasssize;
 
   if(total>100){
-    map.riverlength= map.riverlength*100/total;
-    map.mountains= map.mountains*100/total;
+    total = map.riverlength + map.mountains + map.deserts 
+    + map.forestsize + map.swampsize + map.grasssize;
     map.forestsize= map.forestsize*100/total;
+
+    total = map.riverlength + map.mountains + map.deserts 
+    + map.forestsize + map.swampsize + map.grasssize;
+    map.riverlength= map.riverlength*100/total;
+
+    total = map.riverlength + map.mountains + map.deserts 
+    + map.forestsize + map.swampsize + map.grasssize;
     map.swampsize= map.swampsize*100/total;
-    map.deserts= map.deserts*100/total;
+
+    total = map.riverlength + map.mountains + map.deserts 
+    + map.forestsize + map.swampsize + map.grasssize;
+    map.mountains= map.mountains*100/total;
 
-    total = map.grasssize+ map.riverlength + map.mountains
-    + map.deserts + map.forestsize 
-    + map.swampsize + 0
-    + map.deserts;
+    total = map.riverlength + map.mountains + map.deserts 
+    + map.forestsize + map.swampsize + map.grasssize;
+    map.deserts= map.deserts*100/total;
 
+    total = map.riverlength + map.mountains + map.deserts 
+    + map.forestsize + map.swampsize + 0;
     map.grasssize= 100 - total;
   }
+  /* if smaller than 100, rest goes implicitly to grass */
+
+  map.riverlength*= 10;
 }
 
 

[Prev in Thread] Current Thread [Next in Thread]