Page 1 of 5

MapScaleTool v1.01

Posted: Fri Jun 01, 2007 1:09 pm
by Kizan
After reading through the tuts on how to scale a scanned map that has pre-existing grid lines to match MapTools grid lines Decius and I decided that a tool was in order to make this an easier process.

Voila! MapScaleTool v1.01 enters. It's an excel spread sheet (nothing too fancy) that give directions on how to measure in an image editing program and will then do the calculations as described in the MapTool manual (v1.1)

It's available here:
http://www.beauvais1.com/mapscaletool

It's free and we hope it's useful. If you have any questions or comments please put them in this thread.

Thanx,

Kizan and Decius - Authors

Posted: Fri Jun 01, 2007 1:18 pm
by trevor
Thanks Kizan ! I've made the post sticky

Posted: Fri Jun 01, 2007 5:39 pm
by Phergus
Nicely done and it does work with OpenOffice.

Posted: Fri Jun 01, 2007 6:27 pm
by dorpond
Very awesome! Thanks!

Posted: Sat Jun 02, 2007 12:15 am
by Decius
Phergus wrote:Nicely done and it does work with OpenOffice.
Thanks! It's nice to know OpenOffice opens it. (Though it's a really simple spreadsheet, so I would have been very surprised if it didn't work.)

You still have to do a lot of the grunt work yourself in the image editing app, but the spreadsheet helps to take the guesswork out of the scary math part. ;) Ultimately I would love to see someone make a utility -- or have the functionality integrated into MapTool -- to load an image, let you do the measuring right there, and resize the image in one or two relatively simple steps.

Posted: Sat Jun 02, 2007 8:18 am
by dorpond
Decius wrote: Ultimately I would love to see someone make a utility -- or have the functionality integrated into MapTool -- to load an image, let you do the measuring right there, and resize the image in one or two relatively simple steps.
It's all math so that being said it is totally doable. All we would need is the method of how we would do it. Any ideas how we could make it function for the user in Maptool?

Posted: Sat Jun 02, 2007 11:33 am
by Kizan
Postulate: I am non-programmer.
Postulate: I am a technical Network Admin person

Problem: scaling/rescaling maps to fit the printed grid.

First solution: Somehow allowing precise (floating point precision) manual rescaling of the map in real time.

Second solution: provide the measuring tools and helpful instructions for the user to get the needed numbers for a rescale.

Second solution Optional: provide a in MT function to rescale the image in non-real time.

Thanx,

Kizan

Posted: Sat Jun 02, 2007 3:43 pm
by Decius

Code: Select all

    |----------------- 640 pixels --------------------|
  _  _________________________________________________
 |  |                                                 |
 |  |  Map scenery and stuff outside                  |
 |  |  the dungeon walls.                             |
 |  |                    _________C_________          | _
    |                   |         |         |         |  |
 4  |                   |         |         |         |  |
 8  |                   |         |         |         |
 0  |          _________|_________|_________|_________|  3
    |         |         |         |         |         |  0
 p  |       A |         |   Dungeon room    |         |B 0
 i  |         |         |   and hallways    |         |
 x  |         |_________|_________|_________|_________|  p
    |                   |         |                   |  i
 |  |                   |         |                   |  x
 |  |                   |         |     Scenery       |  |
 |_ |___________________|_________|___________________| _|
                                  D
              |------------- 520 pixels --------------|
  • The map image file is 640 pixels wide by 480 pixels tall
  • There are 520 pixels horizontally between points A and B
  • There are 300 pixels vertically between points C and D
  • There are 4 map squares horizontally between points A and B
  • There are 3 map squares vertically between points C and D
If you wanted a grid size of 80 in MapTool here are the equations you would use to get the width and height of the resized image:

(640*80)/(520/4) = 393.846
(480*80)/(300/3) = 384

Your final image would be resized down to 394 pixels wide by 384 pixels tall in order to give you a grid in the image that lines up with MapTools's 80 pixel grid. Obviously in a real-world scenario you'd be working with a much larger image which would result in more realistic dimensions, but this should illustrate the process.
dorpond wrote:It's all math so that being said it is totally doable. All we would need is the method of how we would do it. Any ideas how we could make it function for the user in Maptool?
What MapTool would require is a way for the user to load a map, define points A, B, C, and D, as well as the size of a single square on the map image. With that knowledge, MapTool could calculate the number of horizontal pixels between points A and B, the number of vertical pixels between points C and D, and the number of squares that could fit within those distances. MapTool could then dynamically rescale the image in the display window so its grid aligns properly with the scanned image. Whether it actually resizes and saves the image file or just shrinks it down when displaying it is a topic for discussion.

What I don't know is how this math applies to hexagonal maps. When counting hexagons between points, do you count in a straight line or zig-zag across since the hexagons are arranged in a brick-like alternating pattern?

Code: Select all

          __2__         __4__
         /     \       /     \
   __1__/       \__3__/       \__5__
  /     \       /     \       /     \
 /       \_____/       \_____/       \
 \       /     \       /     \       /
  \_____/       \_____/       \_____/
Or

Code: Select all

          _____         _____
         /     \       /     \
   __1__/       \__2__/       \__3__
  /     \       /     \       /     \
 /       \_____/       \_____/       \
 \       /     \       /     \       /
  \_____/       \_____/       \_____/
(Hmm, they looked right in the font I use in my editor.) Anyway, does anyone know how the math works for hexagons?

Posted: Sat Jun 02, 2007 5:53 pm
by Phergus
Hexes become problematic as any way you size them either the face-to-face dimension or the vertex-to-vertex distance must be a fractional value.

For gaming purposes most measures are done face-to-face. A tactical hex would be 5' face-to-face or I believe Hero uses 1 meter face-to-face.

Face-to-face (minor diameter) would be 40 pixels with the default MT settings. The vertex-to-vertex (major diameter) distance however is (2 * minor)/sqr(3). So you end up with an ugly 46.188021535170061160731902440157 pixels for the vertex-to-vertex distance.

To correct a map across X axis, with the hex layout as you drew them, it is best if you work in pairs of columns as the distance across from the leftmost vertex of a hex in column 1 to the leftmost vertex of column 2 (using your bottom illustration) is 1.5 times the major diameter.

The vertical is done just like the square grid maps.

Posted: Sat Jun 02, 2007 5:58 pm
by Decius
[head explodes]

Posted: Sun Jun 03, 2007 10:03 am
by jmucchiello
Decius wrote:Anyway, does anyone know how the math works for hexagons?

[head explodes]
He just described it wrong. A hex is composed of 6 equilateral triangles radiating from a central point. So the distance from vertex to opposite vertex is equal to twice the length of a side. The distance from edge to edge is equal to twice the height of a triangle. The height of an equilateral triangle is sqrt(3) times the edge length.

Posted: Sun Jun 03, 2007 1:18 pm
by Phergus
No, I described it correctly.

You are just coming at it from a known length of a side which isn't anywhere near as helpful for purposes of resizing a map image or for determining how many pixels across a hex is or should be.

You need the face-to-face distance to be an even number of pixels for MT to match a hex grid to it. (Until MT supports fractional pixel dimensions for hex sizes.)

If the face-to-face distance is a whole number of pixels, the vertex-to-vertex distance is not going to be. Period. But that is okay as it is the face-to-face distance that is important. When someone says the map is 40 pixels = 5' and that it is using 5' hexes, the distance between the center points of two adjacent hexes is 40 pixels which is the same as the face-to-face distance.

Your math is correct however and simple algebra takes you to the formulas I gave.

Posted: Tue Jun 05, 2007 2:41 pm
by voodoo
I've been petitioning for an easy way to resize maps so they exactly fit to the grid since I've discovered maptool.
As it is now, it is a pain, especially with the WotC maps. I have to open up photoshop, I cut a 20 square wide 1 square high rectangle, measure it, do the calculation, resize the map, load it into maptool, discover that it is not exact (and a small difference gets visible after about 20 squres), go back to photoshop, change things a little bit, load the map again in maptool...

The one thing kloogewerk does better is that: you determine point A, point B, the distance between them et voilĂ  !

I ain't no programmer but it wouldn't seem to be that difficult to implement.

Posted: Tue Jun 05, 2007 3:08 pm
by trevor
We have a couple floating ideas on the right UI enhancements to let you do this directly in MT.

Until then, I super appreciate your efforts Kizan and Decius !

Posted: Sat Jun 30, 2007 10:44 am
by dorpond
I am taking more pre-made adventure maps for my next game and *bleck* I can't wait until we can do all this resizing in Maptool.

Kizan, I am going to pull up your sheet here and see how well it works. Thanks again!