Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2003:
[freeciv-ai] Re: [Freeciv-Dev] (PR#6199) huge AI ferry cleanup
Home

[freeciv-ai] Re: [Freeciv-Dev] (PR#6199) huge AI ferry cleanup

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [freeciv-ai] Re: [Freeciv-Dev] (PR#6199) huge AI ferry cleanup
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sun, 21 Sep 2003 11:05:30 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Fri, 19 Sep 2003, Per I. Mathisen wrote:

> I sat down with Jordi's ferry patch, and kept testing things, changing
> things, and before I knew it, I had rewritten the beachhead code with pf,
> rewritten a big chunk of fstk and ksw, wrapped a lot of their ugly
> variables in a new struct and stopped several cases of code duplication
> (and not just duplication of text, mind you).

It is very nice.  As it is very big too, I am afraid it will be hard to 
see mistakes in the diff.

> I had to apply the chainsaw to some ugly kludges, however:
>   - assess_danger() and assess_distance() no longer finds ferries for
> enemy players' units. Consider how bad find_boat() is, it provided only a

Since it's not finding beachheads, inland cities will feel safe.  On the 
other hand, your other changes mean that they will not be safe.  Also, all 
cities will feel safe from humans, which is verrry bad.

>   - fstk used to calculate in the cost of a ferry. Since I did not see
> quite the reason for this (we should be calculating the time it takes to
> build it, or go to it), and it seemed that it did this even though the
> ferry was already built, I just removed it.

This is not correct, you remove the line
-      needferry = (go_by_boat && !ferryboat ? unit_value(boattype) : 0);
so it does check whether the ferryboat doesn't exist yet.  Yet, we should 
figure the time to build the ferry into the equation, so even as it is, 
overseas attacks get a boost, no need to increase it.

>   - I found the strange way that fstk tried to evaluate if a ferry is
> faster than walking to be unreliable, so I removed it rather than attempt
> to hack it back into place. We now always walk if we can, but this should
> be improved.

Indeed.  Otherwise we will have units that are build and cannot get to the 
target because the land route is blocked.  But it can be done later.

G.





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