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: Sun, 13 Apr 2003 20:32:20 +0000 (GMT)

On Sun, 13 Apr 2003, Mike Kaufman wrote:
> On Sun, Apr 13, 2003 at 08:59:17PM +0100, Gregory Berkolaiko wrote:
> > Now I finally got to citymap and I don't like the concept.First of all,
> > it means that AI players work in coordination: they do not try to make
> > cities on others' spots.Secondly, I don't like mixing server and AI and
> > here you have server creating a city and putting it on AIs map.I feel
> > that citymap should be maintained on per-player basis by players
> > themselves.This will lead to more CPU usage, but I think this is the
> Amen. This is exactly what I'm talking about Per. Please do not continue
> down the path of more tightly integrating AI into the server.

Apparently you don't appreciate the genius of this code ;)

Duplicating the map for each player will not consume more CPU, but more
memory. The current implementation uses 61kb. Multiply by 32 players, and
you spend 3mb.

That is totally meaningless, since each player will generate almost
exactly the same map. You do not want to try to settle on top of another
player's city. This "try to make cities on others' spots" almost never
happens in real games (and in the in rare cases where it does happens,
because of danger, it is usually for allied players, where you'd want to
coordinate anyway).

To explain more carefully what this code does: This is a map of the world
containing only a single int value. If this int is zero, the tile is
unassigned. If it is positive, then this tile is within city radius of one
or more cities - it is increased by one for each such city. This way you
know the "crowdedness" of a tile. If it is negative, it is reserved by a
settler or a city worker with given unit/city abs(id).

Yes, it unashamedly uses omniscience and does a bit of coordination
between AIs in a few rare situations that almost never arise, but it is
very good at catching errors, uses little memory and works very well. I
do not want to change it.

  - Per

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