Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] (PR#2427) AI gets stuck and not producing settlers early g
Home

[Freeciv-Dev] (PR#2427) AI gets stuck and not producing settlers early g

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2427) AI gets stuck and not producing settlers early game
From: "Per I. Mathisen via RT" <rt@xxxxxxxxxxxxxx>
Date: Tue, 26 Nov 2002 12:45:09 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Often, some AI cities get stuck because they don't optimize for food. This
halts AI expansion. The biggest single way to fix this is for Raimar to
complete a new version of his CM-in-server patch, so that cities can be
optimized for food.

However, there are also other things that may be done. A patch that I
believe breaks _some_ blockage is attached.

Also needed to be done is some way to calculate how much food a city would
have at (size-1), so that we can make a settler even though we current
cannot upkeep it. I can't see how to do this easily ATM.

  - Per

Index: ai/advdomestic.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdomestic.c,v
retrieving revision 1.95
diff -u -r1.95 advdomestic.c
--- ai/advdomestic.c    2002/11/25 19:18:08     1.95
+++ ai/advdomestic.c    2002/11/26 20:39:55
@@ -954,7 +954,7 @@
 
   unit_type = best_role_unit(pcity, F_SETTLERS);
 
-  if (est_food > utype_food_cost(get_unit_type(unit_type), gov)) {
+  if (est_food >= utype_food_cost(get_unit_type(unit_type), gov)) {
     /* settler_want calculated in settlers.c called from ai_manage_city() */
     int want = pcity->ai.settler_want;
 
Index: ai/aicity.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aicity.c,v
retrieving revision 1.129
diff -u -r1.129 aicity.c
--- ai/aicity.c 2002/11/19 13:31:07     1.129
+++ ai/aicity.c 2002/11/26 20:39:55
@@ -235,15 +235,9 @@
      could somehow. -- Syela */
   freelog(LOG_VERBOSE, "Falling back - %s didn't want soldiers, settlers,"
                        " or buildings", pcity->name);
-  if (can_build_improvement(pcity, B_BARRACKS)) {
-    pcity->currently_building = B_BARRACKS;
-    pcity->is_building_unit = FALSE;
-  } else {
-    pcity->currently_building = best_role_unit(pcity, F_SETTLERS); /* yes, 
this could be truly bad */
-    pcity->is_building_unit = TRUE;
-  }
-/* I think fallbacks only happen with techlevel 0, and even then are rare.
-I haven't seen them, but I want to somewhat prepare for them anyway. -- Syela 
*/  
+ /* yes, this could be truly bad */
+  pcity->currently_building = best_role_unit(pcity, F_SETTLERS);
+  pcity->is_building_unit = TRUE;
 }
 
 /************************************************************************** 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2427) AI gets stuck and not producing settlers early game, Per I. Mathisen via RT <=