[messages] [Module Design] Hex Range count wrong

sfbaddict sfb at rogers.com
Wed Aug 5 03:42:54 CEST 2015


I didn't find this here with a cursory search so...

I'm using a hex map and the range count function is wrong. I've tweaked
the round up/down settings and using a 0 or 65 size but it's still
wrong. With the default settings the count goes wrong at 3 to 4 hexes.
playing a bit I can extend that to 14 or 15 hexes, but it still goes
wrong. 

http://keekerdc.com/2011/03/hexagon-gri ... lculations[1].
using a qbert style 3 axis coordinate system
[2]
The orientation of the axes is relatively arbitrary. The diagrams above
could be easily flipped vertically, so that y increases downward and x
increases up and to the right. This would create a (0,0,0) tile in the
upper left instead of the lower left. __(Just mentally rotate the image
90 Clockwise)__
[3]

distance = max(x2-x1,y2-y1,z2-z1)  max doesn't care about + or -
using 0101 as top left hence 0,0,0 as top left

0201 to 0709, rangeis 10 hexes counted visually
These converted to the x,y,z qbert coordinates are
first set 0,1,-1    second set 5,6,-11 
5-0, 6-1,-11+1  
5,5,-10                                       
max is -10                

or reversed  
0709 to  0201, range is 10 hexes counted visually
These converted to the x,y,z qbert coordinates are
first set  5,6,-11  second set  0,1,-1 
0-5, 1-6,-1+11
-5,-5,+10       
max is 10

Other ways http://www.redblobgames.com/grids/hexagons/#distances[4]

[1] http://keekerdc.com/2011/03/hexagon-grids-coordinate-systems-and-distance-calculations
[2] http://keekerdc.com/wp-content/uploads/2011/03/HexGridLandscapeTriCoordinates.gif
[3] http://i.imgur.com/AE85EB1.gif?1
[4] http://www.redblobgames.com/grids/hexagons/#distances


_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=49557#p49557


More information about the messages mailing list