[freeciv-ai] (PR#6227) Boats in assess danger
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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.
G.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freeciv-ai] (PR#6227) Boats in assess danger,
Gregory Berkolaiko <=
|
|