Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: AI
Home

[Freeciv-Dev] Re: AI

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: Raahul Kumar <raahul_da_man@xxxxxxxxx>, Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: AI
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Sun, 25 Nov 2001 16:28:57 +0100

> > Have you started work on the science adv yet? I'd like to see it as you
> > code it.
Cleaning of current code has higher priority actually - we need to clean things
up before we will modify them. While cleanup i will also hopefully catch all
candidates for move.

> > Threshold what do you think this magic no is? I was initially inclined to
> > believe that threshold * some movement factor was meant to be the max no of
> > squares a unit can move in one turn.
Well, IMHO not in one turn, but in reasonable number of turns. Maximal tiles
we can move through in one move are 3 (roads) (see bellow for railroad), and
current value is 12, so the reasonable number is 4 turns. So, basically, in
most of the code, we accept anything where we can get in maximally 4 turns.

So if we glance at e.g. exploring code, we see:

int maxcost = pplayer->ai.control ? 2 * THRESHOLD : 3;

So, if we aren't AI, just in autoexplore mode, we hunt only huts to which we
can get in one turn, otherwise we hunt even to the distance of 8 turns, seems
to me.

> >                                      Unfortunately, railroad move cost = 0
> > makes it fairly useless. 
We always compare threshold to warmap cost (if warmap cost is less than
threshold, we accept it, basically) - and if railroad is built to there, warmap
cost is zero, so it's always less, and we accept it - also because we can get
there in less that 4 turns. It is not useless, because you also must keep on
the mind combined situations, where we can use railroad only for a part of our
trip.

> >                          And why are threshold nos not far lower for sea
> > and air units?
No idea. I would expect 4 for sea units. And 2 resp. 1 for air units, when they
will come on the scene. get_threshold(struct unit *) would be nice, let's
insert it into TODO :-).

> > Amortise: Any ideas about this function? What are we trying to achieve
> > here.
> 
> This was discussed in the past. Search the archive.
So it should be included in the code in a comment as well, IMHO.

Raahul: Would be great if you would add the explanation you wrote here into the
code while cleaning it :-).

-- 

                                Petr "Pasky" Baudis

UN*X programmer, UN*X administrator, hobbies = IPv6, IRC
Real Users hate Real Programmers.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/


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