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
Subject: [Freeciv-Dev] Re: (PR#3936) introducing native coordinates
From: "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Date: Sat, 5 Apr 2003 17:27:44 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Sat, Apr 05, 2003 at 09:56:05AM -0800, Jason Short wrote:
> Raimar Falke wrote:
> > On Fri, Apr 04, 2003 at 07:48:14PM -0800, Jason Short wrote:
> > 
> >>This is a significant design issue, and should be closely scrutinized. 
> >>I'd encourage everyone to at least read this patch.
> >>
> >>Native coordinates (sometimes called "compressed" coordinates in the
> >>past) are a concept Ross came up with to make isometric (and other
> >>non-standard) maps easier to deal with.  They save around 50% memory
> >>(and on disk, in savegames) for map storage over "standard" map
> >>coordinates and make topology operations *much* simpler.  Other
> >>coordinate systems may share one of these properties, but none have
> >>both.  In the process, they invalidate the need for "regular" map positions.
> >>
> >>The patch introduces native_to_map_pos and map_to_native_pos macros into
> >>map.h, along with one very simple user.  I've also written an
> >>explanation of the coordinate systems for doc/HACKING.  I'd like
> >>feedback on this explanation, particularly from people who don't already
> >>know what "native coordinates" are.
> >>
> >>All other explanation is in the patch (or if it isn't, it should be).
> > 
> > 
> > What operations (would) require native coordinates? I have the feeling
> > that a lot can be done with indexed coordinates. For example
> > savegames.
> 
> True, storage (such as savegames and map storage) can be done either 
> with native or index coordinates.  

> The goal here is backward-compatability

That is the question. Considering how many people look at the
savegames (almost zero) and how much other more fancy topologies we
want to support (note that the savegame format lives relative long) I
would go with indexed coordinates. Native coordinates are here IMHO
just a kludge to fit into the old 2D savegame format.

> ; we might as well use native coordinates for 
> savegames and indexed coordinates for map.tiles because that's 
> (basically) what's done now.
> 
> Native coordinates are especially good (compared to map coordinates) for 
> topology operations.  For instance normalize_map_pos can be written 
> something like:

About what other topology operations are we talking here? That
normalize_map_pos will be more complex is obvious.

> > AFAIK there is no sane way to represent an iso-map in the
> > 2d layout we have in savegames?!
> 
> No, the iso-map
> 
>    X X X      XXX
>     X X   <=> XXX
>    X X X      XXX
> 
> can easily be represented in our 2d layout in the second (native) form.

Ok but how valuable would than this print out of the map at the start
of the gamelog?

How will native coordinates (and also the "normal" ones) cope with
more fancy topologies like this one (should be a circle or an
ellipse):

    ##
   ####
  ######
  ######
 ########
  ######
  ######
   ####
    ##

Maybe this is quite easy because you only do a masking operation onto
a base rectangle?!

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "That's fundamental game play!  My main enemy is *ALWAYS* fighting 
  a 4-front war.  I make sure of it!"
    -- Tony Stuckey, freeciv-dev




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