Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2002:
[Freeciv-Dev] Re: [RFC] Path finding interface #6
Home

[Freeciv-Dev] Re: [RFC] Path finding interface #6

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [RFC] Path finding interface #6
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 13 Apr 2002 14:16:05 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Apr 08, 2002 at 09:08:43AM +0200, Raimar Falke wrote:

All new version 6. Changes to version 4:
 - make last_position a macro
 - remove _from_map
 - add pf_construct_path
 - change signature of pf_get_next_position

Gregory: After some more thinking I don't like the
get_zoc_permission. Reason: It just doesn't work. AFAI read the code
you have to know the source position to know if you can step on a
target tile. So while we may add a
  bool (*get_zoc_permission)(int src_x, int src_y, int dest_x, int dest_y, void 
*user_data)

the result may not be cachable and also I don't see a reason to allow
customization of the process. So I think that the path finding core
should do this internally. This may also allow some caching like (per
internal tile) a

 bool is_my_zoc=map_get_city(x, y)||map_get_terrain(x, y) == 
T_OCEAN||is_my_zoc(unit_owner, x, y);
 bool allied_tile=is_allied_unit_tile(map_get_tile(x, y), unit_owner);

This together with a global
 bool zoc_used = (move_type == LAND_MOVING) && doesn't have IGZOC flag

allows us to code the test as simple as
 zoc_ok = zoc_used || internal_src_tile.is_my_zoc || 
internal_dest_tile.is_my_zoc || internal_dest_tile.allied_tile

        Raimar, today "The Defender Of The Performance"

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
    1) Customers cause problems.
    2) Marketing is trying to create more customers.
  Therefore:
    3) Marketing is evil.

Attachment: path_finding6.h
Description: Text document


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