Page 1 of 1

Can't align national borders to grid

Posted: Fri Nov 29, 2013 9:15 pm
by Treefingers
(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 (7.43 KiB) Viewed 4386 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 (9.12 KiB) Viewed 4386 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? :)

Re: Can't align national borders to grid

Posted: Mon Dec 02, 2013 5:41 am
by cazfi
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

whereas all six sides have their own sprite in case of borders:

Re: Can't align national borders to grid

Posted: Thu Dec 05, 2013 3:47 am
by Treefingers
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.

Re: Can't align national borders to grid

Posted: Fri Dec 06, 2013 10:58 pm
by cazfi
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.