PDA

View Full Version : Aligning Hex Grids



7H3LaughingMan
October 17th, 2016, 21:52
I am having issues trying to align a Hex Map that I made in Hexographer with the Fantasy Grounds Hex Grid. I have been messing around with the Hex Width & Hex Height in Hexographer to try and hone in the exact ratio needed. So far I found out that any multiple of 42 Pixels for the Hex Height will allow the top/bottom of the Hex to align properly in Fantasy Grounds. I have been messing with the Hex Width and it is always off by some small amount and on a bigger map it will get way off on the left/right sides of the Hex.

Does anyone have any suggestions as to the Hex Width / Height Ratio Fantasy Grounds uses and what would be the best way to get these to align properly.

damned
October 18th, 2016, 09:45
Hi 7H3LaughingMan your best bet is probably to leave the grid off your output map. You could put a single hex in one corner as a size guide.

Nylanfs
October 18th, 2016, 12:06
With hexographer I don't think that is an option.

Zacchaeus
October 18th, 2016, 12:54
I've never used hex grids but the square one is usually drawn at 50px a side. When you draw a hex grid you can also draw it to 50px but I don't know what that measurement represents.

The key to getting a grid to fit is that the map needs to be exported from the drawing package at the right size. So if you draw your map at a scale of 5' equals 50px and then export it at a resolution which is a multiple of 50 then you should in theory get the grids to line up. So if your map is 120'x80' you'll want to export it at say 600x400 or 1200x800. You would then (again in theory) be able to draw a 50 or 100px grid on your map in FG. But as I say I have no experience with grids so all of the above could be nonsense.

7H3LaughingMan
October 18th, 2016, 14:28
Hi 7H3LaughingMan your best bet is probably to leave the grid off your output map. You could put a single hex in one corner as a size guide.

I could remove the grid that is put on the image of my map, but that wouldn't really help since the map itself is hexagonal. I could just not have the grid in Fantasy Grounds and go off the map but that feels like it would defeat the purpose.


I've never used hex grids but the square one is usually drawn at 50px a side. When you draw a hex grid you can also draw it to 50px but I don't know what that measurement represents.

The key to getting a grid to fit is that the map needs to be exported from the drawing package at the right size. So if you draw your map at a scale of 5' equals 50px and then export it at a resolution which is a multiple of 50 then you should in theory get the grids to line up. So if your map is 120'x80' you'll want to export it at say 600x400 or 1200x800. You would then (again in theory) be able to draw a 50 or 100px grid on your map in FG. But as I say I have no experience with grids so all of the above could be nonsense.

I understand what you are trying to say, but I feel like the main issue is that I don't know the dimensions of a hex according to Fantasy Grounds. I feel like the hexes aren't 100% perfect and are a bit wider than they should be and if that is a case then it would be a bug. I would have to do some testing before I am sure. But in the mean time I am going to include an image of the map in question to see if someone notices something wrong.

https://dl.dropboxusercontent.com/u/7231478/Island.png

damned
October 18th, 2016, 14:33
It may well be that the FG hex angles are not the same as hexographers....

Zacchaeus
October 18th, 2016, 15:12
Yep, too much maths for me. A regular Hex's internal angles should all be 120 degrees and clearly that's not the case in your image. You are going to have to work out what your map size needs to be in order to export it in such a way that all your hexes are regular hexes. I played about a bit and can get one hex to exactly fit an FG hex of 50px but then the drift is ridiculous.

7H3LaughingMan
October 18th, 2016, 15:52
Yep, too much maths for me. A regular Hex's internal angles should all be 120 degrees and clearly that's not the case in your image. You are going to have to work out what your map size needs to be in order to export it in such a way that all your hexes are regular hexes. I played about a bit and can get one hex to exactly fit an FG hex of 50px but then the drift is ridiculous.

I pulled up the image in GIMP and measured the internal angles. All over them are 120° and when I measure the length of each side they are the same. I even went and exported a bigger image from Hexographer to make it easier to measure the angles and the lengths.

https://dl.dropboxusercontent.com/u/7231478/Huge%20Island.png

Zacchaeus
October 18th, 2016, 16:23
Alright your big image is many times better than the last one you posted. I can get the grid to align pretty well if you adjust it slightly to 3200x3050 and draw a grid of about 146-147px size hex on it in FG.

Trenloe
October 18th, 2016, 16:42
Yeah, the vertical-to-horizontal ratio in FG is different to that on the map. All I can suggest is that you align it correctly vertically and then use the grid nudge controls to move it horizontally to make as good as match as possible. Then, if you're zooming in on a particular part of the map, do a little bit of nudging to make that part look as good as you can. Not ideal I know.

Or, do a quick resize of the map in your favourite graphics app - as Zacchaeus suggests above. Probably the best solution at present.

7H3LaughingMan
October 18th, 2016, 20:29
Alright, I figured it out by doing some math. I am going to post this so that other people can get some help with how to properly align Hex Grids.

First you are going to need the length of one of the sides. You can make some number up if you are making a map from scratch, for my example I chose 30 pixels to be the side length for my hexagon. Next you are going to need to bust out a calculator and do the following calculations.

Hexagon Height = 2 * sin(60) * Side Length
Hexagon Width = Side Length + cos(60) * Side Length * 2 (Remember your order of operations!)

When I use a side length of 30 pixels then I end up with a Hex Width of 60 and a Hex Height of 52. Plug those numbers into Hexographer and do a "Export Current Size as PNG Image". If you choose one that includes resize it is going to ignore the width/height we chose and use the default one it uses. Then you need to crop the image since it adds some extra bits on the sides usually and put it into Fantasy Grounds.

After all that is done you can draw the hex grid as usual, and to make it easier to get the right size just expand it till you get the number equal to the height. So when I was drawing it the hex size was 52. Once that is done you just need to align the grids and it was perfect!

https://dl.dropboxusercontent.com/u/7231478/Real%20Island.png

Trenloe
October 18th, 2016, 20:34
Alright, I figured it out by doing some math. I am going to post this so that other people can get some help with how to properly align Hex Grids.

First you are going to need the length of one of the sides. You can make some number up if you are making a map from scratch, for my example I chose 30 pixels to be the side length for my hexagon. Next you are going to need to bust out a calculator and do the following calculations.

Hexagon Height = 2 * sin(60) * Side Length
Hexagon Width = Side Length + cos(60) * Side Length * 2 (Remember your order of operations!)

When I use a side length of 30 pixels then I end up with a Hex Width of 60 and a Hex Height of 52. Plug those numbers into Hexographer and do a "Export Current Size as PNG Image". If you choose one that includes resize it is going to ignore the width/height we chose and use the default one it uses. Then you need to crop the image since it adds some extra bits on the sides usually and put it into Fantasy Grounds.

After all that is done you can draw the hex grid as usual, and to make it easier to get the right size just expand it till you get the number equal to the height. So when I was drawing it the hex size was 52. Once that is done you just need to align the grids and it was perfect!

https://dl.dropboxusercontent.com/u/7231478/Real%20Island.png
Glad you got it working with a bit of maths! :)

To simplify your two equations:

Hexagon Height = Side Length * 1.73
Hexagon Width = Side Length * 2

Zacchaeus
October 18th, 2016, 21:39
Hexagon Height = 2 * sin(60) * Side Length
Hexagon Width = Side Length + cos(60) * Side Length * 2 (Remember your order of operations!)

This is why I gave up



Hexagon Height = Side Length * 1.73
Hexagon Width = Side Length * 2

This I can deal with :)

bigbluepaw
May 31st, 2017, 00:00
Hey folks. I did a calculation of which combination of hexagon width and heights were closest to whole numbers. You can see the calcs here.

https://docs.google.com/spreadsheets/d/1uh5kN036WczOx3sZT3PvRaseKclEZ9_88KDX2YLqzwo/edit?usp=sharing

But the best combinations are...

97 height by 112 width
265 height by 306 width
418 height by 361 width

I'm unsure how this affects file size. Hope this helps others in the future.

sturtus
July 18th, 2018, 16:45
Worldographer, the new Hexographer, does allow you to specify the width and height of your hexes.

Edit: Setting 49 height and 56 width for row-based hexes created a FG friendly map.

benjihad
February 8th, 2019, 09:51
When I use a side length of 30 pixels then I end up with a Hex Width of 60 and a Hex Height of 52. Plug those numbers into Hexographer and do a "Export Current Size as PNG Image". If you choose one that includes resize it is going to ignore the width/height we chose and use the default one it uses. Then you need to crop the image since it adds some extra bits on the sides usually and put it into Fantasy Grounds.

After all that is done you can draw the hex grid as usual, and to make it easier to get the right size just expand it till you get the number equal to the height. So when I was drawing it the hex size was 52. Once that is done you just need to align the grids and it was perfect!

Excellent, I was having a heck of a time getting the hexes to be regular from Hexographer. This procedure worked finally for me except I swapped the hex height (60) and width (52) since I'm rolling with aligned hex rows instead of aligned hex columns. Thanks!

mattekure
February 8th, 2019, 13:34
You can turn off the grid in Hexographer before export. that way it will export an image without the grid lines.
26253

benjihad
February 8th, 2019, 13:47
You can turn off the grid in Hexographer before export. that way it will export an image without the grid lines.

True, but that defeats the purpose of what I'm doing with it. The method outlined above allows for keeping the grid lines in the original image generated by Hexographer 1. :)

epithet
February 8th, 2019, 18:22
Now if only the hexes drawn by Fantasy Grounds weren't made out of fat jagged lines...

I would really love it if you could set a grid (square or hex) and then make it invisible (leaving only the grid lines on the map image, or none.)

Trenloe
February 8th, 2019, 19:02
I would really love it if you could set a grid (square or hex) and then make it invisible (leaving only the grid lines on the map image, or none.)
Go vote for it: https://fg2app.idea.informer.com/proj/?ia=76187

lostsanityreturned
February 9th, 2019, 18:21
Now if only the hexes drawn by Fantasy Grounds weren't made out of fat jagged lines...

I would really love it if you could set a grid (square or hex) and then make it invisible (leaving only the grid lines on the map image, or none.)

agreed. Wonder if this is possible to adjust in the ruleset file... Would make it pretty hard to line up initially but could still be worth a look as an interim fix.

UltimateGM
April 9th, 2019, 22:04
Is there a program like map align that we can use to scale the maps to fit the hex on or a way to code that into map align or does it already do that and I am missing something?


Edit: I wish the map gods at paizo would include maps in their pdfs with the option to remove the grid like they did in some of their Pathfinder products.

Zacchaeus
April 10th, 2019, 01:23
No. The grid alignment tool only works for square grids. Aligning hex grids is next to impossible. As you point out the best solution is to not have the grid baked into the map, then you can just draw an FG grid to whatever you want.

iceforge
July 20th, 2019, 01:50
I fiddled for the longest time with making Worldographer maps line up with the grid on FG, the numbers here did help guide me, but did not give accurate results.

Ended up getting my map to be accurate lined up with FG grid by using 60 Hex width with 53 Hex Height, so I recommend that for anyone else

Andraax
July 20th, 2019, 01:56
Or, just export your maps without a grid and rely on FG to draw the grid for you...

LordEntrails
July 20th, 2019, 02:57
And welcome to the forums :)

Thanks for letting us know what worked in your case.

BlueDrake
June 17th, 2020, 14:39
I'm a bit late to this, but I'm using the old version of Hexographer (v1.80.4) and a Width of 48 pixels and height of 42 pixels creates maps with a hex grid that aligns perfectly with the fantasy grounds grid. Set the hex height to 42 in FG and just like magic the grid aligns :)

Szabtom
June 17th, 2020, 15:05
Thanks, BlueDrake!

cas206
September 5th, 2020, 03:45
You can add width 40 by height 37 to the list of known dimensions that work. And here is how to do it for any size.

https://docs.google.com/document/d/1eztACHNrzR7jD6Cgh_oLCoNB57dq7TqRsOMTNEhlu-Q/edit?usp=sharing