[Freeciv-Dev] Re: Map coordinate cleanups.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, 18 Aug 2001, xyzzy@xxxxxxxxxxxxx wrote:
>
> Consider a diamond shaped map that's supposed to play like a sphere:
>
> X 0 1 2 3 4
> Y
> +--+
> 0 | |
> +--+--+--+
> 1 | | | |
> +--+--+--+--+--+
> 2 | | | | | |
> +--+--+--+--+--+
> 3 | | | |
> +--+--+--+
> 4 | |
> +--+
>
> Coordinates wrap around the east and west edges, but not the north
> and south. For example, (0,1) would wrap around the edge to (3,1),
> and (-1,2) would wrap to (4,2). What would the coordinate (4, -1)
> wrap to? Since it's a not a real coordinate, there is no meaningful
> way to wrap it. The cylinder topology just creates the illusion
> that it is possible to wrap non-real coordinates.
That's an interesting idea, but you haven't thought it through
properly.
If I understand you correctly, if I'm standing on (1, 1) and move left
I will arrive at (3, 1). As such, the coordinate pairts (0, 1) and
(3, 1) are canonically equivalent. On the other hand, if I stand on
(0, 2) and try to move north, I'm not allowed to do that.
Freeciv currently assumes that it can tell if a move is legal by
adding the appropriate offsets to the old coordinates and then calling
is_real_tile() (or normalize_map_pos(), or whatever) on the result.
But in the above case, is_real_tile() has no way to tell whether we
arrived at (0, 1) by going north or west. So in order to make this
topology work, you would have to create a function that tells you
whether you are allowed to move somewhere from a given position, and
if so, where.
The bottom line is that Freeciv implements coordinates the way it does
because declaring that coordinates "wrap" when you cross a magical
threshold is a reasonable way to implement and deal with a cylinder.
However, wrapping of any sort is not a reasonable way to implement
what you describe above, and so the whole sordid discussion does not
apply, and your argument is bogus.
--
Big Gaute http://www.srcf.ucam.org/~gs234/
Four thousand different MAGNATES, MOGULS & NABOBS are romping in my
gothic solarium!!
- [Freeciv-Dev] Re: Map coordinate cleanups., (continued)
- [Freeciv-Dev] Re: Map coordinate cleanups., Gregory Berkolaiko, 2001/08/18
- [Freeciv-Dev] Re: Map coordinate cleanups., Trent Piepho, 2001/08/18
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/18
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Ross W. Wetmore, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Ross W. Wetmore, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Gregory Berkolaiko, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups.,
Gaute B Strokkenes <=
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Gregory Berkolaiko, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Ross W. Wetmore, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Ross W. Wetmore, 2001/08/17
[Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/16
|
|