Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] (PR#4137) Auto-Explore with new path-finding
Home

[Freeciv-Dev] (PR#4137) Auto-Explore with new path-finding

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#4137) Auto-Explore with new path-finding
From: "Cameron Morland" <cameron@xxxxxxxxxx>
Date: Sat, 3 May 2003 05:39:15 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Hi,

This patch merges parts 1 and 2 of the explorer code into one. Note that
this does change the behaviour of the explorer somewhat, since slightly
distant highly-desirable tiles are preferred over adjacent tiles (which
were always preferred before). I also fiddled with the desirability
definitions so they make more sense.

The code works by searching out from the current location using
simple_unit_path_iterator (where the path length is be non-decreasing,
as I understand it). It then keeps track of the greatest possible
desirability score at each given location (which is non-increasing). As
soon as the best score found so far exceeds the best possible score at
the given range, or we run out of tiles, we can be certain that the best
tile found is in fact the best tile available, so we break.

Note that all movement takes place using gotos; this has the desirable
effect of making use of rivers.

I'm going to be away for the next week or so (biking from Waterloo to
Ottawa), but here it is for your consideration. It reduces the size of
the code by 62 lines.

Attachment: pf_explorer.diff
Description: pf_explorer.diff


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