Battle analysis


The battlefield with hexagons and the creation of a hexagon grid

The battlefield has a hexagon overlay placed over the map to locate combat units and calculate distance, range and line of sight.

The hexagons are given a unique name.

In order to analyze battles, the hexagon names are converted to a cartesian coordinate system,

   called hexagon grid,       so that the mathematics of analytic geometry can be utilized.

As the mouse moves, the hexagon grid conversions are displayed.

hexagon name ← (HexagonNameCalculator) → < hexagon point > ← (HexagonPointCalculator) → [screen pixels]

The HexagonNameCalculator calculates the name of the hexagon.

The HexagonPointCalculator calculates image pixel coordinates.


Programming Notes


The HexagonPointCalculator converts mouse events into hexagon grid coordinates.

There are 3 coordinates that are used for battle analysis:.

1. HexagonPoint

As the mouse moves over the map, the movement into and out of hexagons will be calculated. The hexagon will be identified by the coordinate of the hexagon center. This coordinate will be called the Hexagon Point. This Hexagon Point is used for wargame calculations.

2. GridPoint

As the mouse moves over the map, The movement over a hexside is also calculated. The hexside is identified by the coordinate of the center of the hexside line and is called the Grid Point. If the mouse moves over the center of the hexagon, its coordinate is calculated as a connecting point between hexsides. The GridPoint can be either a hexside or a center that is connecting 2 hexsides.

3. VertexPoint

As the mouse moves over the map, The movement over a hexagon corner is also calculated. The corner is called the Vertex Point


Wargames use a naming convention to label hexagons. The hexagon name is calculated with the HexagonNameCalculator and shown on the map.

Line of Sight

The hexagon grid provides methods to calculate line of sight, range, bearing.

line of sight, range, bearing for 90° turned map

Lines of Communication

lines of communication