Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: RFC: 8-topology system
Home

[Freeciv-Dev] Re: RFC: 8-topology system

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: RFC: 8-topology system
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 17 Oct 2001 00:40:10 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Oct 16, 2001 at 06:22:35PM -0400, Jason Dorje Short wrote:
> Raimar Falke wrote:
> > 
> > On Tue, Oct 16, 2001 at 01:42:48PM -0400, Jason Dorje Short wrote:
> > > Here is a (hopefully) full explanation of how I propose to implement an
> > > 8-topology system.  The eight topologies include flat vs isometric,
> > > north-south wrapping vs no wrapping, and east-west wrapping vs no
> > > wrapping.  We also allow the possibility of adding non-rectangular maps
> > > in the future.  Any of these 8 topologies will work under my proposed
> > > general topological system (an earlier post), either with or without the
> > > linear-combination-of-vectors (LCOV) extension (LCOV allows
> > > wrap_map_pos()).
> > >
> > > The current code defines only map.xsize and map.ysize (henceforth
> > > referred to as xsize and ysize).  These currently define the topology
> > > itself.  Under the new system, they will only define the bounding
> > > rectangle for the topology.  The topology itself will be referred to by
> > > another set of values (declared either within the map structure or as
> > > part of a separate topology structure):
> > >
> > > - shape: 0 for rectangle; no other valid values yet.
> > 
> > 1 for a ellipse
> > 
> > I think that another shape is good. This may be of no real use but it
> > allows use to test the code. And a non-isometric ellipse has the
> > semantics of most north <=> y=0. Also such an ellipse will also have
> > non-real tiles in the rectangular xsize*ysize.
> 
> Yes, the purpose of the field is to allow other shapes :-).  A hexagon
> and a triangle were also mentioned (although the triangle has problems
> if it wraps).  My only worry is that the (width, height) dimensions
> won't be enough to easily express the dimensions of an arbitrary shape.
> 
> > So based on the xsize and ysize an ellipse should look like:
> > 
> >                               C
> >                     # # # # # # # # # # #
> >               # # # # # # # # # # # # # # # # #
> >             # # # # # # # # # # # # # # # # # # #
> >           # # # # # # # # # # # # # # # # # # # # #
> >         # # # # # # # # # # # # # # # # # # # # # # #
> >       # # # # # # # # # # # # # # # # # # # # # # # # #
> >       # # # # # # # # # # # # # # # # # # # # # # # # #
> >       # # # # # # # # # # # # # # # # # # # # # # # # #
> >     A # # # # # # # # # # # # # # # # # # # # # # # # # B
> >       # # # # # # # # # # # # # # # # # # # # # # # # #
> >       # # # # # # # # # # # # # # # # # # # # # # # # #
> >       # # # # # # # # # # # # # # # # # # # # # # # # #
> >         # # # # # # # # # # # # # # # # # # # # # # #
> >           # # # # # # # # # # # # # # # # # # # # #
> >             # # # # # # # # # # # # # # # # # # #
> >               # # # # # # # # # # # # # # # # #
> >                     # # # # # # # # # # #
> >                               D
> > 
> > For testing such shape may also omit wrapping.
> 
> Omit wrapping?  How could such a shape possibly wrap?

You may go from A to B and from C to D.

> We have (width, height) as the width and height of the ellipse. 
> xsize==width and ysize==height.
> 
> The center point is (width/2, height/2).
> 
> Allow the ellipse to range as far out as possible before encountering
> the next row.  For instance your picture above would become something
> like
> 
>                              # # #
>                      # # # # # # # # # # #
>                # # # # # # # # # # # # # # # # #
>              # # # # # # # # # # # # # # # # # # #
>            # # # # # # # # # # # # # # # # # # # # #
>          # # # # # # # # # # # # # # # # # # # # # # #
>        # # # # # # # # # # # # # # # # # # # # # # # # #
>        # # # # # # # # # # # # # # # # # # # # # # # # #
>      # # # # # # # # # # # # # # # # # # # # # # # # # # #
>      # # # # # # # # # # # # # # # # # # # # # # # # # # #
>      # # # # # # # # # # # # # # # # # # # # # # # # # # #
>        # # # # # # # # # # # # # # # # # # # # # # # # #
>        # # # # # # # # # # # # # # # # # # # # # # # # #
>          # # # # # # # # # # # # # # # # # # # # # # #
>            # # # # # # # # # # # # # # # # # # # # #
>              # # # # # # # # # # # # # # # # # # #
>                # # # # # # # # # # # # # # # # #
>                      # # # # # # # # # # #
>                              # # #
> 
> This preserves the ellipse while making the ends as unpointy as
> possible.  It means that the horizontal and vertical radiuses become one
> larger ( (width/2+1) and (height/2+1) ) but we want to use <
> (inequality) rather than <= in our comparison.

This figure was done with:
------
a=13
b=9

for y in range(-10,11):
    for x in range(-15,16):
        if x*x*b*b+a*a*y*y<=a*a*b*b:
            print "#",
        else:
            print " ",
    print
------

> The equation then becomes
> 
> Let
>   xr=widtht/2
>   yr=height/2
> in
>   ( (x-xr)/(xr+1) )^2 + ( (y-yr)/(yr+1) )^2 < 1
> 
> Which can either be done floating-point, or multiplied out to get a
> very-long-but-integer-only equation.

These are details. So can we add this shape to the 8 still virtual
forms of a map?!

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "When C++ is your hammer, everything looks like a thumb."
    -- Steven M. Haflich


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