Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#9610) autosettler "territory" and danger maps
Home

[Freeciv-Dev] Re: (PR#9610) autosettler "territory" and danger maps

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9610) autosettler "territory" and danger maps
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxxx>
Date: Fri, 6 Aug 2004 06:49:49 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9610 >

On Thu, 5 Aug 2004, Per I. Mathisen wrote:

>
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9610 >
>
> Here is my preliminary idea for a "movemap":
>
> A mapsize array of struct {
>   struct unit_list 1_turn_reach;
>   struct unit_list 2_turn_reach;
> } movemap;

I was thinking of merely adding together the attack ratings of the enemy
units.  But storing the list is of course better, although might take more
space.

> These unit lists contain all the units that can reach the tile in one or
> two turns. You can now iterate over all possibly dangerous units that can
> reach a given tile quickly.
>
> To set up this cache, run through all units once, and use pf to mark tiles
> in the movemap. For ferries, for each ferry { make pf map; for each tile {
> for each passenger { pf backtrace from tile and see if we can overlap with
> the ferry's pf map, if so mark tile } } }.
>
> This is expensive, but doing ferries properly is a real pain in the ***,
> any way you do it.

There is a better way of doing ferried units, like the one in rampage
(IIRC).

Your idea of doing it for all players is brilliant.  Of course you'd need
to store full lists (not some numbers) for it to be usable.

G.




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