Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2000:
[Freeciv-Dev] Re: warmap patch and gotohand
Home

[Freeciv-Dev] Re: warmap patch and gotohand

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Thue Janus Kristensen <thue@xxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: warmap patch and gotohand
From: Nicolas BRUNEL <brunel@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 4 May 2000 20:59:14 +0000 (GMT)

> >    - the field seacost is withdrawn. It wasn't used anywhere as a seacost
> > field. There was always a test before to check if the unit was a land or
> > sea unit.
> 
> Have you tested your patch and seen if the AI still manages to use
> transports?

Yes, it does.

> >    - the local_vector is no more set to zero. It can be wrong. But, It
> > looks like it is always set before being used.
> Yes, it shouldn't be neccesary to reset it as far as I can see.

It is necessary to reset it for the square on which is the
unit. I'm testing it. It looks ok.

> I can't see how you would update the old warmap.

Me too. But, lots of units have the same destination and are close one
from one other. We calculate many shortest pathes. Is there a way to store
them ? If we calculate the warmap of the destination, it can be used for
all units having this destination. Something like this can be done :

   1 - Choose destination for all units.
   2 - for each destination calculate its warmap and move units with this
destination accordingly.

  The main problem will be to iterate smartly on each units having the
same destination.

> >    In ai/aiunit.c : int find_something_to_kill
> >    A test is added so that AI only try to conquer ennemy cities.
> I didn't notice that it tried conquring friendly cities before.

Here is the code :

for (i = 0; i < game.nplayers; i++) {
    aplayer = &game.players[i];
    city_list_iterate(aplayer->cities, acity)
      city_reinforcements_cost_and_value(acity, punit);
      acity->ai.invasion = 0;
    city_list_iterate_end;
  }

At the beginning of find_something_to_kill, AI is doing the sum of the
belligerence value of all unit going to or around a given city. The
summation is done over all cities. It includes its own cities. Ai doesn't
try to conquer its own cities. But, if this information is not used
elsewhere, it is useless for its own cities.

Bye,

Nicolas






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