Web Wargaming

simulations of historical conflicts on the web

wargame design  mapgrid  sequence of play  terrain  force  movement  combat  retreat  final game

MapGrid coordinates

Step 1: slice the map into columns(red)

Calculate how far away from the edge the point is(green).  The green point is less than the hexside width, so the hexpart x is (2 * column  - 1).  
The blue point is more than the hexside width, so the hexpart x is  2* column 

Step 2: slice the map into rows.

If it is a side hexside from before, the hexpart y is ( 2 * row +1 ).  

 

If it is a center or bottom hexside, 
add 1/4 hexagon height to adjust for the down shift and the hexpart y is       ( 2 * row ).


the rectangles are called:
center hexpart
lower hexpart
upper left hexpart
lower left hexpart

The hexpart coordinate will be the blue dot.  The hexagon coordinate will be the closest hexagon center from the mouse cursor at the red dot.

map line line line line bluedot reddot map
text