Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [Patch] Fortress with enhanced vision (watchtower-like
Home

[Freeciv-Dev] Re: [Patch] Fortress with enhanced vision (watchtower-like

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Cc: Bert Buchholz <bertbuchholz@xxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [Patch] Fortress with enhanced vision (watchtower-like)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 26 Aug 2001 07:43:04 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sat, Aug 25, 2001 at 07:39:48PM -0400, Jason Dorje Short wrote:
> > > Another issue to have a more fine grained control over vision
> > > range. The vision range is currently a square with the dimensions
> > > (vision*2+1)X(vision*2+1). Maybe this could be changed to somelike
> > > like:
> > >
> > > vision=1:
> > >
> > >    x
> > >   xux
> > >    x
> > >
> > > vision=2:
> > >
> > >   xxx
> > >   xux
> > >   xxx
> > >
> > > vision=3:
> > >    x
> > >   xxx
> > >  xxuxx
> > >   xxx
> > >    x
> > > vision=4:
> > >   xxx
> > >  xxxxx
> > >  xxuxx
> > >  xxxxx
> > >   xxx
> > > and so on.
> > 
> > Yes, I see, this could possibly be used for other stuff as well, but is
> > this implemented in some way already or would this have to be done
> > completely new? Probably I could do this, but for that I'd have to take
> > a closer look at the tile-coordinates-handling...
> 
> I had some thoughts on this before.  There are three ways to measure
> distance:
> 
> (1) Use the lateral distance.  Thus distance=max(x-x0,y-y0).  This is
> what you're doing now:
> 
> 3 3 3 3 3 3 3
> 3 2 2 2 2 2 3
> 3 2 1 1 1 2 3
> 3 2 1 0 1 2 3
> 3 2 1 1 1 2 3
> 3 2 2 2 2 2 3
> 3 3 3 3 3 3 3
> 
> (2) Use the "manhattan" distance.  The manhattan distance is the sum of
> the distances along each axis (or, in Manhattan/New York City, the
> number of blocks you must walk to get from point A to point B). 
> Manhattan distances are like so:
> 
>       3
>     3 2 3
>   3 2 1 2 3
> 3 2 1 0 1 2 3
>   3 2 1 2 3
>     3 2 3
>       3
> 
> (3) Use the direct "pythagorean" distance.  This is the distance of a
> straight line between the two points, calculated using the pythagorean
> formula, so that your resulting shape corresponds to a circle.  The
> following table shows the *squares* of the distances:
> 
>       9
>   8 5 4 5 8
>   5 2 1 2 5
> 9 4 1 0 1 4 9
>   5 2 1 2 5
>   8 5 4 5 8
>       9
> 
> Which one of these is the closest to the way FreeCiv works now?  Well,
> most people would tell you #1.  In fact, the answer is #3.  In all cases
> that I know of, FreeCiv's areas correspond to circles.  But, the
> pythagorean distance is never used internally - it's always some special
> case like vision=1 (a circle of radius sqrt(2)), vision=2 (a circle of
> radius sqrt(8)), or citysize=2 (a circle of radius sqrt(5)).  It would
> be really good IMO if all of these were integrated to use just the
> Pythagorean distance, so only one system would be used.  This would be a
> problem from the ruleset's point of view since you would to need to use
> non-integer distances to represent most distances (or, alternately,
> conversions from the old system could be used like "vision=X" =>
> vision_radius=X*sqrt(2)).  The first step, though, is to implement the
> system.

If the pythagorean distance is used it has to be dense. This is to
prevent cases like if you get an increase by one and your current
vision is 2. 

index            | 0  1  2  3  4  5  6
square if radius | 0  1  2  4  5  8  9

I have no problem updating all the unit ruleset files.

I see no problem appling a patch which effectively leaves the game
like it is now but adds flexibility.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "How about the new language C&? No, that's not 'c ampersand', 'c reference', 
  'reference to c' or 'c and'. It's pronounced 'campersand', to confuse the 
  hell out of people who are unfamiliar with it, and it will, of course, 
  have no pointers."
    -- Xazziri in comp.lang.c++ about C#


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