Zoukibayashi
June 19th, 2022, 20:52
Hopefully this is the right subforum for this - I suspect the issue might be an internal FG quirk, or if any fix is possible, it would be via xml file editing.
In short, I am trying to create an art asset pack that provides various terrain hex tiles (created in another program and exported as transparent png files) for use with Unity's map creation tools. This works brilliantly if I size them to what appears to be the default FG hex tile size, but introduces odd gaps if I deviate from this exact form.
The much longer explanation is as follows:
Please note that unless otherwise specified, all example tiled images provided are with grid snap on and all placement clicks in the approximate-center of the FG-gridded hexes.
FG "Default" Hex Tile and Expected Working Behaviour
When setting a new image intended for map creation with a grid type of "hexrow" (pointy-side-up), FG defaults to a grid size of (100, 100), with the individual hex tiles having an actual size of approximately 100 x 116 px each.
If I create a partially-transparent tile of 100 x 116 px and assume the same defaults in its accompanying xml file:
<?xml version="1.0"?>
<root>
<gridtype>hexrow</gridtype>
<gridsize>100,100</gridsize>
</root>
...then it functions beautifully and behaves exactly as I would expect: 53233
Hex Tile Size Deviation Troubles
However, the hex tiles I am trying to convert deviate from this standard in two ways:
The overall hex portion of the tile is 100 x 100 px.
The overall hex tile is 100 x 150 px, with the extra 50 px being above the hex portion to account for overlapping mountain/trees/etc art.
On the previous image example, this "squished" hex equates to the yellow area, with the blue border being the difference between that and the FG "default". To tile properly, it works out to an approximate grid size of (100, 93.1).
Although the art asset pack section (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996645724/Making+an+Asset+Pack+Tiles+Symbols+Brushes+Decorat ions) in the developer's guide doesn't mention this, it appears some of the imagecontrol tags listed elsewhere (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996645070/imagecontrol) in the same developer's guide may have an effect. From testing, <gridtype> and <gridoffset> do, but not <snaphex>.
As such, if I pair a test 100 x 150 px tile with an xml file of:
<?xml version="1.0"?>
<root>
<gridtype>hexrow</gridtype>
<gridsize>100,93.1</gridsize>
<gridoffset>0,50</gridoffset>
</root>
...and try to tile that in FG, then I end up with: 53231
While the offset is obviously not quite right, of greater concern are the consistent vertical gaps.
If I decide to forego <gridoffset> entirely and try to instead pseudo-center each tile by adding an additional 50 px below (for a total image size of 100 x 200 px), and pair that with the following xml:
<?xml version="1.0"?>
<root>
<gridtype>hexrow</gridtype>
<gridsize>100,93.1</gridsize>
</root>
...it still ends up displaying the same odd vertical gaps/padding: 53232
If I play around with the tile size within FG, I can reduce the visual gaps by stretching the image, but the odd gap padding/skew is still an issue. Even if this did work, it doesn't seem to be possible to set via xml anyway.
If I forego an accompanying xml file entirely (as was recommended to me to try via FGA), and manually set the grid size in FG, this vertical gap/padding is still present. What is causing it? Is there a way to remove it?
The Clunky Workaround
However, I have noticed that if take the same 100 x 150 px image tile, and set the xml to:
<?xml version="1.0"?>
<root>
<gridtype>square</gridtype>
<gridsize>100,150</gridsize>
</root>
...then I can tile with the occasional stagger to fake a hex map during the layout: 53235
...after which, I can manually set the map such: 53236
However, is there a way to avoid doing this? While this is fine for my own use purposes, it would not be ideal for community shared assets where it would be much preferable to also layout in hex mode.
In short, I am trying to create an art asset pack that provides various terrain hex tiles (created in another program and exported as transparent png files) for use with Unity's map creation tools. This works brilliantly if I size them to what appears to be the default FG hex tile size, but introduces odd gaps if I deviate from this exact form.
The much longer explanation is as follows:
Please note that unless otherwise specified, all example tiled images provided are with grid snap on and all placement clicks in the approximate-center of the FG-gridded hexes.
FG "Default" Hex Tile and Expected Working Behaviour
When setting a new image intended for map creation with a grid type of "hexrow" (pointy-side-up), FG defaults to a grid size of (100, 100), with the individual hex tiles having an actual size of approximately 100 x 116 px each.
If I create a partially-transparent tile of 100 x 116 px and assume the same defaults in its accompanying xml file:
<?xml version="1.0"?>
<root>
<gridtype>hexrow</gridtype>
<gridsize>100,100</gridsize>
</root>
...then it functions beautifully and behaves exactly as I would expect: 53233
Hex Tile Size Deviation Troubles
However, the hex tiles I am trying to convert deviate from this standard in two ways:
The overall hex portion of the tile is 100 x 100 px.
The overall hex tile is 100 x 150 px, with the extra 50 px being above the hex portion to account for overlapping mountain/trees/etc art.
On the previous image example, this "squished" hex equates to the yellow area, with the blue border being the difference between that and the FG "default". To tile properly, it works out to an approximate grid size of (100, 93.1).
Although the art asset pack section (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996645724/Making+an+Asset+Pack+Tiles+Symbols+Brushes+Decorat ions) in the developer's guide doesn't mention this, it appears some of the imagecontrol tags listed elsewhere (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996645070/imagecontrol) in the same developer's guide may have an effect. From testing, <gridtype> and <gridoffset> do, but not <snaphex>.
As such, if I pair a test 100 x 150 px tile with an xml file of:
<?xml version="1.0"?>
<root>
<gridtype>hexrow</gridtype>
<gridsize>100,93.1</gridsize>
<gridoffset>0,50</gridoffset>
</root>
...and try to tile that in FG, then I end up with: 53231
While the offset is obviously not quite right, of greater concern are the consistent vertical gaps.
If I decide to forego <gridoffset> entirely and try to instead pseudo-center each tile by adding an additional 50 px below (for a total image size of 100 x 200 px), and pair that with the following xml:
<?xml version="1.0"?>
<root>
<gridtype>hexrow</gridtype>
<gridsize>100,93.1</gridsize>
</root>
...it still ends up displaying the same odd vertical gaps/padding: 53232
If I play around with the tile size within FG, I can reduce the visual gaps by stretching the image, but the odd gap padding/skew is still an issue. Even if this did work, it doesn't seem to be possible to set via xml anyway.
If I forego an accompanying xml file entirely (as was recommended to me to try via FGA), and manually set the grid size in FG, this vertical gap/padding is still present. What is causing it? Is there a way to remove it?
The Clunky Workaround
However, I have noticed that if take the same 100 x 150 px image tile, and set the xml to:
<?xml version="1.0"?>
<root>
<gridtype>square</gridtype>
<gridsize>100,150</gridsize>
</root>
...then I can tile with the occasional stagger to fake a hex map during the layout: 53235
...after which, I can manually set the map such: 53236
However, is there a way to avoid doing this? While this is fine for my own use purposes, it would not be ideal for community shared assets where it would be much preferable to also layout in hex mode.