Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] (PR#6721) A Quincuncial topology
Home

[Freeciv-Dev] (PR#6721) A Quincuncial topology

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mburda@xxxxxxxxx, rt-guest@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#6721) A Quincuncial topology
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Nov 2003 22:41:46 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6721 >

Summary:

This topology is a crazy, kinda cool approximation of a sphere.  To get
it to work we'd have to have something that I will call
"mirror-wrapping".  For instance an 8x3 map that mirror-wrapped in the Y
(north-south) direction would look like

  xwvutsrq
  ponmlkji
  hgfedcba
  ABCDEFGH
  IJKLMNOP
  QRSTUVWX
  xwvutsrq
  ponmlkji
  hgfedcba

where the capital letters are the normal positions (0,0) through (7,3).
 Thus for each Y wrap there is a mirroring of the X value

  Y = Y + map.ysize
  X = map.xsize - 1 - X

which makes the math complicated, but possible.  Note that you can have
a mirror-wrap in both X and Y directions, or mirror-wrap in one and wrap
in the other: the cartesian constraints imposed by two-dimensional
display are satisfied with any combination.

The two quincuncial topologies that have been described so far are
approximations of a sphere.  One is a rectangular (dimensions 2x1) map
which mirror-wraps in Y and wraps in X.  The other has a square map with
mirror-wrapping in both X and Y directions.  I believe PNG files
demonstrating both of these are included earlier in the ticket.

From a topologist's point of view, this is a reasonable approximation of
a sphere.  For instance with the first quincuncial topology if you head
across one of the poles you end up coming down south on the other side
of the world, just as you'd expect.  E.g., if you head north from Canada
you end up in Russia.  This is not perfect, however: it only works if
Canada is situated properly.  Otherwise you might head north from Canada
and end up in...Canada.

From a core-implementation point of view, the problems in implementing
this haven't been well studied.  However I believe there will be a
problem with many users of vectors.  For instance if you travel north
from C=(2,0) it puts you at f=(2,-1) which normalizes to F=(5,0).  But
to travel "backwards" from F to get to C is north, not south as it would
be if the map was always well-oriented.  I'm pretty sure this will give
problems with some parts of the code, particularly goto code.

From a user's point of view there are problems, however.  Back when we
discussed approximations of a sphere I remember considering a wrapping
like this, since it is the obvious way to simulate a pole. 
Unfortunately it breaks down since the wrapping itself is not symmetric,
as I described above.  A unit at A will witness a different type of
wrapping than a unit at D will.  In fact what a player at D will see is
a singularity, since tile D borders itself.  This presents a roadblock
that isn't fatal, but will probably prevent it from ever gaining
widespread acceptance.

jason



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