-
June 19th, 2022, 20:52 #1
- Join Date
- Jul 2019
- Posts
- 5
Unexpected Art Asset Hex Tile Behaviour
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:
Code:<?xml version="1.0"?> <root> <gridtype>hexrow</gridtype> <gridsize>100,100</gridsize> </root>
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 in the developer's guide doesn't mention this, it appears some of the imagecontrol tags listed elsewhere 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:
Code:<?xml version="1.0"?> <root> <gridtype>hexrow</gridtype> <gridsize>100,93.1</gridsize> <gridoffset>0,50</gridoffset> </root>
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:
Code:<?xml version="1.0"?> <root> <gridtype>hexrow</gridtype> <gridsize>100,93.1</gridsize> </root>
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:
Code:<?xml version="1.0"?> <root> <gridtype>square</gridtype> <gridsize>100,150</gridsize> </root>
...after which, I can manually set the map such: Final_Workaround.png
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.
-
June 19th, 2022, 20:58 #2
- Join Date
- Jul 2019
- Posts
- 5
Since I ran out of attachment space in the previous post, please find attached in this post my test pack/module used to demonstrate the issues above.
-
June 20th, 2022, 09:49 #3
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,588
Our image developer that I would run this by is currently on leave, so I'll have to wait for a while to ask him.
However, I already know that part of the answer is that the grid size information is designed to fill the grids, not to allow "overlapping" art assets. (which would be a separate type of feature we don't support).
Regards,
JPG
-
June 20th, 2022, 18:48 #4
- Join Date
- Jul 2019
- Posts
- 5
Thank you for the reply! I would be curious to know the answer once he returns from leave.
Certainly part of the issue is that I am trying to be too clever for my own good, in a way that FG does not officially support. However, I can also duplicate these vertical gaps with a non-overlapping 100 x 100 px hex tile, which is what lead me to believe this is not necessarily intended behavior.
If I make a tile with just the squished hex portion, and use the following xml:
Code:<?xml version="1.0"?> <root> <gridtype>hexrow</gridtype> <gridsize>100,93.1</gridsize> </root>
And if I instead pair it with the default (100, 100) grid-sizing:
Code:<?xml version="1.0"?> <root> <gridtype>hexrow</gridtype> <gridsize>100,100</gridsize> </root>
Although, now that I'm looking at that last one, I wonder if this is hinting to the issue? Are the hex grid layouts setting the visual grid to whatever is specified in the xml, but partially disregarding that with regards to the actual tiling?
Perhaps its even simpler than that and I have grievously misunderstood the intent of <gridsize>?
Regardless, I've added the above two example tiles to the test.mod attached. All examples were made with each tile the first selected (as there may be different behaviour depending on if another grid size was previously set by another tile in the same image).
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks