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: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8487) RFC: hex tilesets
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 11 Apr 2004 13:21:17 -0700
Reply-to: rt@xxxxxxxxxxx

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

andrearo@xxxxxxxxxxxx wrote:
> <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.

Fine.

>>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?

Cell-based drawing (like is done with ocean) won't work cleanly without 
changes.  I guess there should just be 6 cells instead of 4.  This may 
take some work.  (2^3 * 4 = 32 different cell sprites needed for oceans. 
  2^2 * 6 = 24 different cell sprites needed for hex oceans.)

However you no longer have to do the ocean with cell drawing.  You can 
do it the same way it's done in non-iso view, with a set of coastlines 
(although these coastlines won't be properly matched either).  Or you 
can do it the way other iso-view terrain is done, via blending (though 
this will look really bad, I think, and will also have the dithering 
problem).  Check out the available tileset options (in the [terrain] 
section of the top-level tileset file and doc/README.graphics) to see if 
there are any better 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...

Hmm, I think dithering is only done NSEW.  This will also need to be 
changed eventually.

These are minor problems at this point.

> Great work on getting the hex code to work!

If only I'd known earlier that there was an existing hex tileset ;-).

jason




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