Map

The first sub-problem was the map representation. This problem had two components: terrain representation and hexgrid computation. A hexgrid is commonly used in wargames because it allows more precise directional alignment of units and doesn't have the problems with corners that a rectgrid (such as is used on a chessboard) imposes. A hexgrid looks like what's shown in Figure 13.1.

Figure 13.1. A hexgrid.

Each hex in the hexgrid can contain terrain of some type: trees, hills, depressions, rivers, lakes, open ground, etc. After much wasted effort trying to computationally define all these terrain elements, I realized my error, an error that is ...

Get Chris Crawford on Game Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.