Can't align national borders to grid

Contribute, display and discuss art and tilesets for use in Freeciv here.
Treefingers
Posts: 20
Joined: Fri Nov 08, 2013 11:40 pm

Can't align national borders to grid

Postby Treefingers » Fri Nov 29, 2013 9:15 pm

(This post is for a 128px wide, "non-iso" hex tileset)

I showed in another post that the location of the hotspot constrains the dimensions and location of my base tile images. But I've come across about the national border images that makes it impossible to line the grid image up with my tile images. To illustrate, I used a semi-transparent 128x128 box with a stronger 1px border around the top half of the image. I figured this should help find where I would be able to place the grid lines. Here's the result:

test-mapgrid-original.png
test-mapgrid-original.png (7.43 KiB) Viewed 3573 times

Visible are the national borders (red) and city outline (black). Immediately I noticed a critical difference. The city outline sprites include the bottom half of the 128px test image. The national border, however, does not. Keep in mind that both border types are pointing to exactly the same part of the same image in the spec file.

Now look at this:
test-mapgrid-point.png
test-mapgrid-point.png (9.12 KiB) Viewed 3573 times

Yellow boxes are the grid sprite for the nearby hex with blue lines. The marked sprites will be for the left edge of their hexes. To be able to draw a line on the left edge, the sprite box would need to completely overlap with that edge. This is the case for the city outline, but clearly not the case for the national border. Thus it appears to be impossible to draw national borders for a 128px tileset. I think hex2t avoids this simply by having small enough hexes that it's not affected.

I could use offsets and image edits to move the hexes around, of course, but that moves them out of alignment with the tile hotspot, which can't be moved. So I seem to be stuck.

Anyone out there know how to deal with this? Or am I off to file another bug report? :)

cazfi
Elite
Posts: 1713
Joined: Tue Jan 29, 2013 6:54 pm

Re: Can't align national borders to grid

Postby cazfi » Mon Dec 02, 2013 5:41 am

Looking hex2t grid.spec it seems that city outlines and national borders have different syntax (probably result of different development history and maintaining backward compatibility).

There's just three sprites for city outline
grid.city.lr
grid.city.we
grid.city.ns

whereas all six sides have their own sprite in case of borders:
grid.borders.e
grid.borders.w
grid.borders.n
grid.borders.s
grid.borders.l
grid.borders.r

Treefingers
Posts: 20
Joined: Fri Nov 08, 2013 11:40 pm

Re: Can't align national borders to grid

Postby Treefingers » Thu Dec 05, 2013 3:47 am

You're right, of course. I figured it was because it makes sense to center the main grid on top of the tile boundaries, but you probably want national borders placed on either side of a line (necessitating 2 images for each orientation). But more to the point, I suppose it is probable that the borders were added some time after the basic map grid was, which might explain the different sprite code.

cazfi
Elite
Posts: 1713
Joined: Tue Jan 29, 2013 6:54 pm

Re: Can't align national borders to grid

Postby cazfi » Fri Dec 06, 2013 10:58 pm

Treefingers wrote:you probably want national borders placed on either side of a line (necessitating 2 images for each orientation)

I realized that after I had written my previous post. They must be placed so that both sides are visible (and not drawn on top of each other) when border is between two nations, and also the shape of the "line" in some tilesets indicates which side is inside and which one outside of the border. Still, I think it would make sense to unify that, and to provide possibility for tileset to indicate inside/outside of the city outline too.