Battle Analysis: Wargame Engine

 

Wargame Design:

Hexagon Library

The Hexagon Library provides hexagon math to calculate hexagon coordinates, range, bearing and line of sight. The Hexgon Name Calculator then calculates the hexagon name which is displayed on the screen.

map pixels ← [Hexagon Map] → hexagon point ← [Hexagon Name Calculator] → hexagon name

The hexagon point is a cartesian coordinate. The hexagon point make is easy to do analytical geometry on the wargame map. The hexagon name is not a coordinate. It is a label to identify a hexagon on the wargame map.

Graphical User Interface

  The Map Manager and the Counter Manager converts mouse clicks into wargame select commands.

As the mouse moves over the battlefield, map information is displayed. When the mouse is clicked, the Map Manager records the hexagon and sends it to the Command Generator. As the mouse moves over the counters, the Counter Manager records the id and displays the unit's name on the screen. When the mouse is clicked, the Counter Manager records the id and sends it to the Command Generator.

There are only 3 events created from the mouse clicks on the wargame battlefield.

  [map image mouse down event] → [hexagon point select]

  [counter image mouse down event] → [unit select]

  [next phase button mouse down event] → [button select]

Command Generator

The Command Generator checks the wargame phase and wargame mode to create a wargame command from the select events.

  [unit select] → (moving mode) → unit start move

  [hexagon point select] → (moving mode) → unit move

  [unit select] → (combat mode) → unit start combat

  [button select] → (combat mode) → movement mode

Wargame Engine

Wargame Engine is the basic rules of the wargame.

  For example: if the wargame mode is moving mode and the unit can move → start moving.

  For example: if the wargame mode is moving mode and the unit is moving and the move calculator calculates unit has move points into the hexagon → move.

Wargame Calculators

Each wargame has unique rules which are programmed with wargame calculators.

Wargame Data