Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: (PR#8487) RFC: hex tilesets
Home

[Freeciv-Dev] Re: (PR#8487) RFC: hex tilesets

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8487) RFC: hex tilesets
From: "andrearo@xxxxxxxxxxxx" <andrearo@xxxxxxxxxxxx>
Date: Sun, 11 Apr 2004 13:04:18 -0700
Reply-to: rt@xxxxxxxxxxx

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

On Sun, 11 Apr 2004, Jason Short wrote:
>
> Basically this means an additional parameter or two needs to be added to
> the tileset, and the drawing code needs to have just a few changes to
> work for hexagons.
>
> The only real design question is how the tileset should specify a hex
> tileset.  Recall that there are two types of hexagons: those with the
> "extra" sides on top and bottom (iso-hex), and those with them on left
> and right (hex).
>
> One possibility is that is_isometric in the *tileset* for hex tilesets
> should mean iso-hex (as opposed to hex).  So a normal hex tileset (like
> isophex) would specify something like
>
>    is_hex = 1
>    is_isometric = 0
>    hex_side = 16
>
> while a hex tileset may specify
>
>    is_hex = 1
>    is_isometric = 1
>    hex_side = 16
>
> and a normal iso-tileset may have
>
>    is_hex = 0
>    is_isometric = 1

I like this way to specify a hex tileset,
it differentiates iso-hex and hex tiles properly.

> In loading (tilespec_read_toplevel) these values are converted into more
> "useful" internal forms:
>
> - Hex tilesets are drawn like isometric ones, so is_isometric (the
> variable in tilespec.h) is always set.
>
> - hex_side is converted into hex_width and hex_height (also variables in
> tilespec.h).  These values are used in drawing the map grid.  So the map
> grid is basically drawn like an octogon, except that 2 of the side
> lengths are always zero (or 4 of the side lengths, for rectangular
> tilesets).
>
> All told it shouldn't be very hard.  The only drawback is a few dozen
> extra lines of code.  If nobody has any suggestions I'll go ahead with a
> patch.  (See also PR#7481, which includes a partial implementation.)

Something else you have to consider is how to best draw coastal-tiles,
since then you have to devide the hexagon into 4 smaller tiles. You might
mave to come up with something clever to do this properly for iso-hex and
hex tilesets. You can see how I did this in isophex. (I had a fealing
this was a hack back when I made it...) Any ideas?


On Sun, 31 Mar 2004, Jason Short wrote:
>Now we just need a hex tileset tilted the other way...

What dimensions should the normal hex tiles be?
Maybe I can update isophex to the latest CVS code, and include hex tiles
in it also.

There's some glitches in the dithering of hex tiles,
looking at the screenshots you made. I'm not sure why this is, though...

Great work on getting the hex code to work!

Andreas Røsdal







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