Complete.Org: Mailing Lists: Archives: freeciv-ai: April 2003:
[freeciv-ai] Re: New settler code

[freeciv-ai] Re: New settler code

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv AI development <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] Re: New settler code
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 12 Apr 2003 15:49:39 +0000 (GMT)

On Fri, 11 Apr 2003, Gregory Berkolaiko wrote:
> Please give me some info on that.In particular,
> 1. in aisettler.c
> } else if (cachemap[map_x][map_y].sum == -1 || !is_city_center(i, j)) {
>   /* We cannot read city center from cache */
> Why "!is_city_center(i, j)" ??

Because city center gives some special benefits that we cannot cache, or
the cache would become invalid (for when we consider the same tile not as
a city center).

> 2. Are you sure you initialize your cache in the right place?
> I think when you get to contemplate_new_city, your cache is not
> necessarily yours!

Right. I'll fix that by doing autosettlers and city management at the same
time. That way we'll save some (perhaps much) CPU.

> Another thing, I am not sure why you call citycache a cache, it's very
> confusing.

Ok. Renamed to cityresult.

  - Per

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