Complete.Org: Mailing Lists: Archives: freeciv-ai: May 2002:
[freeciv-ai] Re: ai bug when splitting up settlers
Home

[freeciv-ai] Re: ai bug when splitting up settlers

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] Re: ai bug when splitting up settlers
From: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Date: Mon, 13 May 2002 01:17:21 +0200 (MEST)

On Sun, 12 May 2002, Per I. Mathisen wrote:
> I've made my custom rulesets, where I've split the old settler up into a
> workers unit and a settlers unit which can only settle cities. The AI
> proceeds to build truly massive amounts of workers, and only a tiny amount
> of settlers (yes, settlers are unit type number 0).
>
> This tells me that the AI might be wanting settlers for all the wrong
> reasons, even if it uses them correctly when built.

settlers.c:void contemplate_terrain_improvements(struct city *pcity)

@@ -1571,12 +1567,15 @@
   virtualunit.moves_left = unit_type(&virtualunit)->move_rate;
   virtualunit.hp = unit_type(&virtualunit)->hp;
   want = evaluate_improvements(&virtualunit, &best_act, &gx, &gy);
+/* FIXME: AI does not ship F_SETTLERS around, only F_CITIES - Per */
+#ifdef AI_SMART_WHICH_IS_NOT_TRUE
   unit_list_iterate(pplayer->units, qpass) {
     /* We want a ferryboat with want 199 */
     if (qpass->ai.ferryboat == pcity->id)
       want = -199;
-  } unit_list_iterate_end;
-
+  } unit_list_iterate_end;
+#endif

+  assert(want >= 0);
   pcity->ai.settler_want = want;
 }

This fix seems to be necessary. This code was copy&pasted from the
F_CITIES code by whoever did the F_SETTLERS and F_CITIES split. I bet
there are a lot of other issues he did not fix also.

Yours,
Per

"As Israeli forces pursued militants, civilians
continued getting in the way and dying as a
result." -- New York Times, April 21



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