PDA

View Full Version : Grids on maps (just an observation)



Willot
April 18th, 2014, 23:18
Is it just me? Or when doing a conversion from a Paper to FG that the grid lines placed on artist's Maps NEVER line up correctly? I mean do the artists feel that to measure their art with say A RULER would in someway detract from the feel and message about the human condition they are trying to get across? (it isnt a scale thing either If I actually look at two squares on either side of a map they are different sizes) ARGGGG :ninja:

Zeus
April 18th, 2014, 23:56
https://www.fantasygrounds.com/forums/showthread.php?19813-Map-Align-Utility-to-scale-and-align-map-to-grid&highlight=aligning+grid

damned
April 19th, 2014, 09:26
Is it just me?

its not just you - its so common....

Phystus
April 22nd, 2014, 23:49
No, it's not just you. But it even happened to me when I scanned in my own handmade maps drawn on commercial graph paper. The graph paper grid didn't line up.

So I suspect that it's more about the difference in precision between paper and digital than any malice aforethought on the part of the artists.

~P

grapper
April 23rd, 2014, 15:07
Squares being different sizes on the same map is probably a result of an image being scanned. If you're scanning from a book and the page is not perfectly flat on the scan bed you'll get a distortion. There was also a trend for a while to create maps with isometric views. You'll never get those to line up ;).

The problem with grid alignment (which can be fixed with the link that Zeus gave in a previous post) is caused by the map grid not being an integer number of pixels. When you overlay a grid in FG you can only select an integer pixel size grid. Scanned images are unlikely to have an integer number of pixels per square, unless you just get lucky. Digitally created images usually do start out with an integer spacing, but resizing them can easily result in this getting thrown off.

For example. Say you start with a map that has a 75 pixel spacing on the grid and you decide that it is too big, so you cut the dimensions in half. Now the grid spacing is 37.5 pixels. If you try to overlay a grid on that map in FG and choose a 37 pixel size it will be off by half a pixel per square and after 10 squares the grids are misaligned and the overlaid grid is too small by 5 pixels (about 13%). If you retry and choose a 38 pixel size the overlaid grid is half a pixel too big each square and after 10 squares it is again off by 5 pixels in the other direction.

Trenloe
April 23rd, 2014, 15:35
The app linked in post 2 is good when the squares aren't square. It can resize the map to make the grid equal pixels in the X and Y directions (vertical and horizontal, respectively).

If you are in Fantasy Grounds and need to quickly align a grid to a map you haven't prepared, a good way is to:

Count 10 squares on your map.
Initially draw a grid that matches these 10 squares - make a note of the pixel size (it will be shown in green at the middle of the square you are drawing).
Divide the 10 square pixel size by 10 - this will be your single grid square size. Round to the nearest whole number.
Then draw a square towards the middle of the map that roughly aligns to a single grid square, but make sure it is the same size in pixels (the green number at the middle of the grid) as the single grid size you calculated in step 3.
Use the grid alignment buttons (press the # menu icon above the image to display the grid alignment buttons) to nudge the grid so it aligns well at the centre of the map.

You may find that the grid will be slightly off at the edge of the map. But, because you took an average over 10 squares, hopefully the difference won't be that much. Of course, if the map itself has very bad grid sizes (sizes differ across the map) then this won't help and there is very little you can do to make it align correctly - although a bit of "fiddling" with the grid alignment and size button may help.

If your map is a large map that the players are exploring, you can use the grid alignment/resize buttons to nudge/resize the grid a little to align the grid to the current location the players are exploring.

grapper
April 23rd, 2014, 15:57
I noticed that the post Zeus linked is for a program. If you're willing to do a little arithmetic you can do the calculations by hand pretty easily using a calculator. Xorne had a demo video for this at one time, but I'm not sure where it is now.

Step by step version:

Open the map in paint or your favorite image editing program.
Use the select tool to select a large number of squares in one direction (across or up/down doesn't matter, pick the direction that gives the longest count).
Make sure the ends of the selected region match the grid in the direction that you're measuring.
Write down the number of squares in the measurement direction. (n)
Write down the number of pixels in the selected direction (in paint this should be in the bar at the bottom and will change as you stretch the selection box) You'll usually see two number, the height and the width, you just need the number for the direction that you're measuring. (s)
Write down the full size of the image in the direction that you're measuring (in paint this is also given in status bar) (w)
Choose a new grid size, i.e. the number of pixels per square. This number is up to you, but for small maps I like to use 50 pixels and for very large maps, I use 25. (p)
Calculate the new image dimension by multiplying the number of pixels in the new grid (p) times the number of squares in the measurement direction (n) times the full image size in the measurement direction (w), and then dividing by the size of the selected region (s).
p x n x w / s
resize the image to the new dimension. (in paint choose "by pixels" and make sure that "maintain aspect ratio" is selected)


Math version
you want to rescale the map by the ratio of the new grid size to the old grid size. You can get a measurement of the existing grid size by measuring a large number of them and taking an average; this gets around the non-integer-number-of-pixels problem.

*can someone double check my math and make sure I didn't flip a ratio in there? When I'm doing this for myself it is usually obvious which way the numbers go, but for some reason typing it up make me paranoid that I got it backwards.

Trenloe
April 23rd, 2014, 16:12
Xorne had a demo video for this at one time, but I'm not sure where it is now.
Xorne's videos are in the wiki: https://www.fantasygrounds.com/wiki/index.php/Videos "Map Re-Scaling" touches on it briefly.

Bidmaron
April 23rd, 2014, 19:19
Your math is right

jasonisop
May 20th, 2014, 03:40
Is there any way to lighten the grid lines, or alpha them out completely yet still retain functionality?

Trenloe
May 20th, 2014, 04:09
Is there any way to lighten the grid lines, or alpha them out completely yet still retain functionality?
Nope, I'm afraid not.

There are a couple of options related to this on the FG wishlist: https://fg2app.idea.informer.com/proj/ Type in "Grid" in the "I would like to..." section to see the current items relating to grids.

hangarflying
May 20th, 2014, 17:30
I noticed that the post Zeus linked is for a program. If you're willing to do a little arithmetic you can do the calculations by hand pretty easily using a calculator. Xorne had a demo video for this at one time, but I'm not sure where it is now.

Step by step version:

Open the map in paint or your favorite image editing program.
Use the select tool to select a large number of squares in one direction (across or up/down doesn't matter, pick the direction that gives the longest count).
Make sure the ends of the selected region match the grid in the direction that you're measuring.
Write down the number of squares in the measurement direction. (n)
Write down the number of pixels in the selected direction (in paint this should be in the bar at the bottom and will change as you stretch the selection box) You'll usually see two number, the height and the width, you just need the number for the direction that you're measuring. (s)
Write down the full size of the image in the direction that you're measuring (in paint this is also given in status bar) (w)
Choose a new grid size, i.e. the number of pixels per square. This number is up to you, but for small maps I like to use 50 pixels and for very large maps, I use 25. (p)
Calculate the new image dimension by multiplying the number of pixels in the new grid (p) times the number of squares in the measurement direction (n) times the full image size in the measurement direction (w), and then dividing by the size of the selected region (s).
p x n x w / s
resize the image to the new dimension. (in paint choose "by pixels" and make sure that "maintain aspect ratio" is selected)


Math version
you want to rescale the map by the ratio of the new grid size to the old grid size. You can get a measurement of the existing grid size by measuring a large number of them and taking an average; this gets around the non-integer-number-of-pixels problem.

*can someone double check my math and make sure I didn't flip a ratio in there? When I'm doing this for myself it is usually obvious which way the numbers go, but for some reason typing it up make me paranoid that I got it backwards.

It would actually be a good idea to do this for both the vertical and horizontal. A lot of times, maps pulled from PDFs are not perfectly square, and resizing in both directions will help make it square-er for the FG grid.

grapper
May 20th, 2014, 18:27
It would actually be a good idea to do this for both the vertical and horizontal. A lot of times, maps pulled from PDFs are not perfectly square, and resizing in both directions will help make it square-er for the FG grid.

Good tip. I've never had that happen, but if you find that the grid is not square, that is a good solution.


Also, someone pointed out that you can also scale by percentage, in that case, you don't need to know the full image size (w)
The procedure would then be:


Open the map in paint or your favorite image editing program.
Use the select tool to select a large number of squares in one direction (across or up/down doesn't matter, pick the direction that gives the longest count).
Make sure the ends of the selected region match the grid in the direction that you're measuring.
Write down the number of squares in the measurement direction. (n)
Write down the number of pixels in the selected direction (in paint this should be in the bar at the bottom and will change as you stretch the selection box) You'll usually see two number, the height and the width, you just need the number for the direction that you're measuring. (s)
Choose a new grid size, i.e. the number of pixels per square. This number is up to you, but for small maps I like to use 50 pixels and for very large maps, I use 25. (p)
Calculate the scale factor by multiplying the number of pixels in the new grid (p) times the number of squares in the measurement direction (n) divide by the size of the selected region (s) and multiply by 100% to get the scale factor in percentage.


p x n / s x 100%



resize the image to the new dimension. (in paint choose "by percentage" and make sure that "maintain aspect ratio" is selected)

Griogre
May 20th, 2014, 22:35
There is also a small utility program to help you do the same thing attached to this thread in the armory: https://www.fantasygrounds.com/forums/showthread.php?19813-Map-Align-Utility-to-scale-and-align-map-to-grid