Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2003:
[freeciv-ai] (PR#6227) Boats in assess danger

[freeciv-ai] (PR#6227) Boats in assess danger

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [freeciv-ai] (PR#6227) Boats in assess danger
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sun, 21 Sep 2003 10:26:15 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Assess_danger is completely broken when it comes to assessing danger
from overseas.  The problem is find_boat doesn't work here.

Here is what why: find_boat is supposed (in this context) to look for
the enemy boat closest to our city.  What it does is to look for the
closest boat accessible _by_land_, i.e. it will never find enemy boat on
another continent or out in the sea.

So all units on other continents are assumed to be 255 MPs away (NB:
such units are still taken into account).

Per's suggested fix, where he does
+  struct unit *ferry = find_unit_by_id(punit->ai.ferryboat);
isn't very good either, since it won't work on humans.

There are other possibilities:
1. only consider boats found on the same square as the danger-induced
unit.  This is not very good as it will completely ignore units which
are about to embark on a ferry -- these might be just one turn away.

2. assume that the boat will be where it is needed "by magic".  I.e.
assume enemy units can walk on water as fast as the enemy boat can. 
This will require some crafty path-finding, in particular it is harder
to make one-size-fits-all map for distance estimation because the
different units walk with different speed on land but with the same
speed on water :(

Despite very approximate character of method 2 I feel it is the way forward.


[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] (PR#6227) Boats in assess danger, Gregory Berkolaiko <=