Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] Re: (PR#3936) introducing native coordinates
Home

[Freeciv-Dev] Re: (PR#3936) introducing native coordinates

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3936) introducing native coordinates
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Sun, 13 Apr 2003 12:00:40 +0200

On Sun, Apr 13, 2003 at 04:51:46AM -0500, Jason Dorje Short wrote:
> Raimar Falke wrote:
> >On Sat, Apr 12, 2003 at 08:24:06AM +0200, Raimar Falke wrote:
> >
> >>>but square_iterate and other local functions cannot be implemented
> >>>in these coordinates
> >>
> >>Why not? In the worst case I calculate all the vectors by
> >>hand and hardcode them. Something like:
> >
> >
> >Actually there is a "portable" way to do square_iterate: using
> >MAPSTEP.
> >
> >At the start you go radius times NW.
> >
> >At the body you do a STEP W. This radius times. Than a STEP S. Than
> >radius steps E and so on.
> 
> This is a clever(ish) way to define an operation on "native" coordinates 
> that really uses map coordinates.  Unfortunately, in addition to 

> being extremely inelegant

I disagree. It is one place less which is topology dependent.

> it pushes the problem down the chain

Yes.

> how do you implement MAPSTEP?

Modifying DIR_D[XY]

> Additionally, you are defining map directions in terms of map
> coordinates, rather than native coordinates - even though you
> propose to remove map coordinates from the code.

In the current code everything is a map coordinate. Map coordinates in
your proposal are similar to the effective form in my proposal. My
coordinates however are similar to your native coordinates.

> If the directions don't even line up with your map, how is anyone
> supposed to understand what's going on?

I think it is easier to understand one set of coordinates where
MAPSTEP does a magic thing as multiple sets of coordinates.

> Finally, and as an additional challenge, how would you hack around the 
> problem for map_distance?

First solution: find it out by hand

Second solution: using your map coordinates ;) Basically do something
like:
 (dx,dy)=current_map_distance_vector(nat_to_map(input))
And then simplify the resulting expressions.

> Note, all of these are trivial if you are simply willing to do them
> in map coordinates.

Yes. But you don't have to scare people by introducing multiple
coordinates (you have scared and confused me) and if these are only
used in one function (map_distance_vector). square_iterate and MAPSTEP
can be easy done without them as outlines before.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Only one human captain has ever survived battle with the Minbari
  fleet. He is behind me. You are in front of me. If you value your 
  lives, be somewhere else."
    -- Ambassador Delenn, "Severed Dreams," Babylon 5



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