[Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7304 >
On Mon, 26 Jan 2004, Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7304 >
>
> > [rwetmore@xxxxxxxxxxxx - Tue Jan 27 03:15:14 2004]:
>
> > In all the above cases these are property lookups where the lookup is made
> > at a particular location (aka tile).
> >
> > There should be one API for returning each property from a tile.
> >
> > There may be many ways to find a tile given various coordinates, thus one
> > would always write something like
> >
> > nat_get_tile(xn, yn)->get_terrain()
> > map_get_tile(xn, yn)->get_terrain()
> >
[...]
>
> A reasonable argument.
>
> Unfortunately the current API is all in map coordinates. To do this
> properly the API would have to be in tile or perhaps index terms, since
> they are at a lower level - and, more to the point, 1-dimensional. We
> can't do
>
> map_set_special(native_to_map_pos(nx, ny), S_RIVER);
>
> but we could do
>
> index_set_special(native_pos_to_index(xn, yn), S_RIVER);
>
> or
>
> tile_set_special(nat_get_tile(xn, yn), S_RIVER);
>
> The last is clearly the cleanest form. However doing it this way
> requires addional functions in map.h - more than the 2 that are required
> for the direct form.
Yes, this is the nicest form. I believe Rafal had some patch along these
lines, although for a different reason. The only drawback is if one of
these functions does need the coordinates for some other reason, we must
add them to the tile struct. Which is logical, if the tile is to become
the common currency rather than coordinates.
> > >>Where would you ever want to really use the map coordinates, apart from
> > >>adjacency calculations which can be hidden in few macros?
> >
> > These are the original server core coordinates for Freeciv, which are
> > exactly what you see in the original standard Earth map topology. The
> > neighbour relationships are geometrically precise which means that apart
> > from rotation/translation, they look like you would expect as a naive
> > user.
I guess it's a question of taste but imagining an iso-map in the iso-view,
I would say native is the best since x goes horizontally and y goes
vertically. As for neighbour relations and iterates, they can be realised
cleanly via the nice methods contained in map.h of Ross' cleanups.
> > >>In future, when compiled with DEBUG option, which coordinates will
> > > clients
> > >>display on middle-click? They should be map coordinates (because such
> > >>things are used to locate units for debugging), but these would be very
> > >>hard to find on a map!
> >
> > This is something to be debated and agreed upon.
> >
> > It probably makes sense to be one of te GUI coordinates that mean
> something
> > in one of the *_view windows.
>
> These values are of no use to the player - they are only of use to
> debuggers and allow comparison to log messages. So the form that is
> used must correspond to what freeciv uses for logging. Currently that
> is map coordinates.
This is exactly what I meant. I was just bemoaning the fact that to be
useful for debugging these coordinates will not be easy to find on a map.
Although I admit that even in the boring rectangular case I find the right
tile by randomly clicking on different places.
G.
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, Gregory Berkolaiko, 2004/01/25
- [Freeciv-Dev] (PR#7304) iso-map support for mapgen, Jason Short, 2004/01/25
- [Freeciv-Dev] (PR#7304) iso-map support for mapgen, Jason Short, 2004/01/25
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, Gregory Berkolaiko, 2004/01/25
- [Freeciv-Dev] (PR#7304) iso-map support for mapgen, Jason Short, 2004/01/25
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, Gregory Berkolaiko, 2004/01/25
- [Freeciv-Dev] (PR#7304) iso-map support for mapgen, Jason Short, 2004/01/25
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, rwetmore@xxxxxxxxxxxx, 2004/01/26
- [Freeciv-Dev] (PR#7304) iso-map support for mapgen, Jason Short, 2004/01/26
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen,
Gregory Berkolaiko <=
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, Gregory Berkolaiko, 2004/01/27
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, Gregory Berkolaiko, 2004/01/28
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, Jason Short, 2004/01/28
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, Gregory Berkolaiko, 2004/01/28
|
|