Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] (PR#6832) wishlist: exotic topologies; approximations of a
Home

[Freeciv-Dev] (PR#6832) wishlist: exotic topologies; approximations of a

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6832) wishlist: exotic topologies; approximations of a sphere
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Nov 2003 23:12:20 -0800
Reply-to: rt@xxxxxxxxxxx

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

The quincuncial topology discussed in PR#6721 is intended as an 
approximation of a sphere.


Another type of wrapping we could support is (what I will call) 
offset-wrapping.

   efghabcd
   mnopijkl
   uvwxqrst
   ABCDEFGH
   IJKLMNOP
   QRSTUVWX
   efghabcd
   mnopijkl
   uvwxqrst

in which a wrap in the Y direction is accompanied by a shift in the X 
direction:

   Y = Y + map.ysize
   X = X + map.xsize / 2

and the map _has_ to wrap in the X direction as well (note the 
relationship between e/E and d/D above):

   X = X + map.xsize

which means we end up with a straight linear-algebra wrapping, but the 
vectors of wrapping are non-orthogonal:

   (map.xsize, 0)
   (map.xsize / 2, map.ysize)
   (-map.xsize / 2, map.ysize)

(Of course, the third vector is a combination of the first two.)  The 
result is equivalent to a hexagonal tiling

   XX XXXXX XXXXX XX
   XX XXXXX XXXXX XX

   XXXXX XXXXX XXXXX
   XXXXX XXXXX XXXXX

   XX XXXXX XXXXX XX
   XX XXXXX XXXXX XX

and is fairly simple mathematically (should be easy to implement on top 
of the current code).  I suspect it will also give better gameplay than 
a simple torus map.


A more complicated implementation has a mirrored pole as well as the 
offset.  This differs from the quincuncial topology which is mirrored in 
both X and Y direction: an offset-mirror-wrap in the Y direction has the 
Y mirror but is offset (not mirrored) in X:

   uvwxqrst
   mnopijkl
   efghabcd
   ABCDEFGH
   IJKLMNOP
   QRSTUVWX
   uvwxqrst
   mnopijkl
   efghabcd

Again it must be accompanied by an X wrap (note the relationship between 
e/E and d/D above).  Unfortunately this topology is invalid: note that 
the neighbors of A are e-f-B-J-I-P-H-d but the neighbors of a are 
E-D-h-p-i-j-b-F.


Yet another type of wrapping is what I will called flip-wrapping.  Here 
we wrap normally along the axis, while mirroring the other coordinate. 
So when wrapping in the X direction:

   stuvwxABCDEFstuvwx
   mnopqrGHIJKLmnopqr
   ghijklMNOPQRghijkl
   abcdefSTUVWXabcdef

Or, mathematically,

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

this is certainly exotic but not particularly useful.  It gives most of 
the same implementation problems as the quinuncial one does.  It can 
wrap in a single direction (mobius strip) or both (klein bottle).

jason




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