Complete.Org: Mailing Lists: Archives: freeciv-dev: August 1999:
Re: [Freeciv-Dev] Suggestion: FreeCiv on a Hex!
Home

Re: [Freeciv-Dev] Suggestion: FreeCiv on a Hex!

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Artur Biesiadowski <abies@xxxxxxxxx>
Cc: Tony Stuckey <stuckey@xxxxxxxxxxxxxxxxx>, Freeciv Dev <freeciv-dev@xxxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] Suggestion: FreeCiv on a Hex!
From: Stephen Hodge <stephenh@xxxxxxxxxx>
Date: Wed, 18 Aug 1999 20:46:56 +1000

Artur Biesiadowski wrote:
> On Tue, 17 Aug 1999, Tony Stuckey wrote:
> > > coordinates are also not obvious - you will have either holes in array
> > > holding data or complicated proximity function.
> >       What's not obvious about them?  They're just a square map with the
> > odd columns offset half a square.
> 
> But what tiles are adjacent to 10,10 ? 10,11 and 10,9 for sure. But on the
> right side ? 11,10 for sure and one of the 11,9 or 11,11. Which one
> depends on 'oddnes' of tile. I suppose that it is just (x+y)%2 == 0, but
> when you add such check everywhere it will stop to be readable.
> Of course it is not a major problem, just an annoyance.

Just define a few routines to determine whether two tiles are adjacant and
get a list of tiles adjacent to a cell. Similarly a couple of routines to
convert from screen coordinates to cell coordinates are almost all you need
to handle this. Probably some sort of mask for the terrain images too. I
don't think it would be very difficult to support squares, diamonds, and
hexes. Most of the work would be in the initial abstraction of the current
source (which I haven't looked at).

Regards,
Steve Hodge

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