Thursday, July 26, 2018

Grids and Miniature Wargaming ... a never-ending discussion

Introduction

Grids for miniature wargaming are regularly discussed on various forums. Often, such discussions revolve around the procedure for counting distances along the grid. Often, the grids under consideration are either the hexagonal grid, the square grid, or the offset square grid (the so-called brick pattern, which is topologically equivalent to the hexagonal grid for most purposes).

However, there are many other types of grids. In mathematics, grids are well studied and also referred to as "tesselations" or "tilings of the plane". Different constraints can be put on such grids: should all grid cells have the same size and/or shape? Should the grid have a repeating pattern? Should the grid never have a repeating pattern? See this wikipedia page for an introduction to the topic.

Just to get your brain juices flowing, here are some specific pentagonal tilings (a pentagonal tiling uses pentagons). Would it be possible to use such a tiling for a miniature wargame?

The 15th monohedral convex pentagonal type, discovered in 2015
The "Cairo" pentagonal tiling.
Many of you would shudder at using such a grid, but why is that exactly? After all, there are plenty of examples of irregular grids that have been used in board wargames, also known as "area-based  movement" to distinguish them from "hex-based  movement".

Storm over Arnhem often is credited to be one of the first board wargames to use area movement, but a boardgame classic such as Risk uses area movement as well, as do countless other board(war)games.

Grid used in Storm over Arnhem. Image from Boardgamegeek.com
Risk map. Image from Boardgamegeek.com
Why do we not consider such playing grids for miniature wargames, and typically restrict ourselves to either a hexagonal grid or a square grid? After all, it should be easy enough to place miniatures in a grid cell, and move them from cell to cell, just as we do in such boardgames?

For miniature wargaming, we often need more functionality from the grid than simply moving playing pieces from cell to cell. More specifically, we need the following:
  • A movement procedure for miniatures or units on the grid;
  • A procedure for determining shooting ranges;
  • A way to orient miniatures or units relative to the orientation of the grid;
  • Align units to adjacent gridcells, such that we can make linear battlelines;
We will discuss each of these issues below.

Movement on the grid

This is the topic that usually gets most of the attention when discussing grids for miniature wargaming. Often, people try to come up with ways to move units on a square grid such that the distortion for diagonal movement is corrected. See also the previous blogposts Square Grids and Square Grids (2) on the topic, in which I also explain that we do not want a measurement procedure (measure a movement distance from starting cell to end cell), but rather want a counting procedure (count expended movement points when moving one cell to an adjacent cell).

In principle, it's very easy to come up with a counting procedure - simply count the number of cells as you move along. However, we want to take into account the various connections between cells. If connections are not symmetric (as in the case of a square grid), movement might become a bit more complex. In irregular-shaped grids, it might become very complex.

Movement on the Cairo grid. Each cell counts as 1 movement point, only edge-to-edge movement allowed.
Movement on the Cairo grid. Each cell counts as 1 movement point, edge-to-edge and point-to-point movement allowed.
Then why do some board(war)games use irregular grids? Usually, because movement is restricted to moving only 1 area, or perhaps 2. In such cases, the total movement distortion when compared to the "true" Euclidean distance is less of an issue.

Moreover, the irregular shaped cells can often serve a purpose. Difficult terrain can be turned into smaller grid cells, and easy-going terrain into larger grid cells, thereby avoiding different movement point costs for different types of terrain.

In miniature wargames, we are so used to having movement speeds doubled or halved depending on terrain, that we usually don't consider irregular grids for that purpose. Often, we prefer regular-shaped grids, and stick to different movement points for different types of terrain. But this also has a reason. Miniature wargames - unlike board wargames - often employ a different terrain setup for each game. Having your irregular grid reflect the terrain sounds like a great idea if you have a fixed map for each and every game, but when you want to shuffle terrain around for each game, a practical solution is not immediately feasible. However, this should not prohibit us from using irregular grids, since different movement values depending on terrain in a specific grid cell is still a possibility.

Shooting ranges on a grid

Most miniature wargaming rules require us to measure the distance between a shooter and a target. Again, as in a movement procedure, we rather want a counting procedure rather than a measurement procedure. We usually want to be able to count the number of cells that lie between the shooter and the target, and use this number as the shooting distance to determine whether the target is in range, whether modifiers need to be applied, and so on.

This is the real bottleneck for using irregular-shaped grids in miniature wargaming. Although we can imagine counting the number of cells, on an irregular grid we might be left to wonder whether it is the shortest distance possible. Especially when the size of the gridcells reflect the type of terrain as mentioned above, the counted shooting ranges can become really distorted, and it would allow you to shoot further if the intermediate terrain is easy-going and suddenly reduce your range when you difficult-to-traverse grid cells lying in front of you. Hence, counting shooting ranges requires cells more or less of equal size.

However, if your ground-scale is such that shooting is restricted to adjacent cells, this is not really a strong requirement. Some distortion might pop up, but no more as in the many boardgames that use an irregular grid and allow adjacent combat only.

Related to determining the shooting range is the issue of visibility. On hexagonal or square grids, the line-of-sight is checked vs intermediate grid cells and terrain therein that might block the line of sight. Because of the regularity of the grid, deciding what cells are crossed by the shooting line can often be eye-balled. But not so in an irregular grid, where this would become more complex, unless you limit shooting ranges to 1 or 2 cells.

Orientation of a unit within a gridcell

Miniature wargames often stipulate firing arcs for units when shooting. When playing on a grid, this means positioning units in a specific orientation on the grid (facing an edge, facing a corner, ...), and defining shooting arcs in terms of grid cells. Often, such a shooting arcs takes the form of a "wedge". In the case of hexagonal and square grids, this is often straightforward, but for irregular grids, this again is a non-trivial procedure if your shooting range extends to 2 cells or more. Even a shooting arc of 180 degrees becomes non-trivial to determine.

Alignment of a unit to adjacent grid cells

Another issue that has to with alignment, is the alignment of adjacent cells, and hence adjacent units. Some periods in which linear warfare is a major element on the battlefield, require that you can line up units next to each other. Easy to do on a square grid (at least in the horizontal and vertical direction, and perhaps the diagonal one), a bit less easy to do an a hexagonal grid (although there are 3 main axes each at 60 degrees where this is possible, but not orthogonal), but almost an impossibility if you use an irregular grid.

However, if the game is a skirmish game (no lineair formations needed), or set in a modern period (spread-out troops), this is less of an issue.

Conclusion

Taking all of the above into account, we want a grid that:
  • has uniform, regular, more-or-less equal-sized cells, such that we can have an easy counting procedure.
  • allows for easy orientation of units inside a cell and alignment with adjacent cells.
This brings us mathematically to uniform convex tilings, tilings which consist of regular polygons. When we take a look at the list of these tilings , we encounter the usual hexagonal and square grids, but there is also at least one other tiling which might prove to be useful to miniature wargaming, but which has (at least to my knowledge) not really been explored: the triangular tiling.

Triangular tiling
I think the triangular grid has a number of unexplored advantages, not in the least advantages in terms of alignment. However, it has asymmetric connections (both edge-to-edge and point-to-point) which might make a counting procedure more difficult. But we'll keep a full analysis for a future blogpost!

Addendum
  1. As can be expected, the discussion of grids (and especially hexagonal grids) has a long tradition in board wargaming. See e.g. this discussion on boardgamegeek
  2. I also wrote a follow-up post n triangular grids.

Sunday, July 22, 2018

Deviating templates

Introduction

When you look at the history of wargaming, there are all sorts of strange contraptions that various rulesets use to determine area effects of firing. Most of these come in the form of firing templates. Usually, the template is placed on the table, and all figures underneath the template have some probability of getting hit.

Templates are an old idea. Below you see a cannister template from The Wargame by Charles Grant, which was soldered together.


Here's another curious template, from Don Featherstone's Advanced Wargames.


Especially fantasy rules have used templates in all forms and sizes. Here you see a selection of templates from my "templates box", most from various incarnations of Warhammer. The "Fallen Drunk Giant" template is still one of my favourites :-)


In order to bring more variability (and randomness) in the fire effect, some rules also specify that the template can "deviate" from the original position. A random direction is determined, a random distance is rolled for, and the template "deviates" that particular distance in that particular direction, to determine the final area where the firing will have an effect.

There are various possible mechanisms to determine this random direction and random distance, and especially fantasy and science fiction rules have used a whole zoo of variations on this theme over the years.

It will be impractical to analyze them all in terms of probability and effect, but I have chosen one particular procedure using the "scatter die" and "artillery die", I believe first pioneered by Games Workshop back in the nineties (any corrections welcome!).


The idea is as follows:
  1. Place the firing template over the intended target.
  2. Roll the scatter die to determine direction of deviation (the direction of the face-up arrow). However, the scatter die also has 2 "Hit" faces, indicating no deviation at all.
  3. Roll the artillery die to determine the distance. The die can give 2, 4, 6, 8, and 10 as a result, along with a "misfire" that usually ends up in some hilarious effect for the crew firing the war engine.
What I want to do next is to analyze this procedure in terms of "probability getting hit" when a figure is located somewhere within the possible deviation area. I will not consider the direct hit or misfire effects, since these should be considered as separate probabilities and events. We will only look at the probabilities when scattering does take place, with any of the 5 possible distances.

Distribution of position of the template

Let's take a look at where the template might end up when there is a deviation. To make matters easier, we will consider a template with a 2" diameter (1" radius), and consider the artillery die distances in inches as well. This is a common application of the procedure, and can also be found in various Games Workshop games.

The diagram below shows the possible positions for the template, when the deviation would happen in the horizontal direction.


When taking into all possible random directions (a few are drawn below), a pattern starts to emerge.


It is obvious that the further you move away from the initial position of the template, there is less chance that any particular area will get covered by the deviated template. Indeed, the same number of possible template positions have to cover an ever-increasing larger circular area. Hence, the closer you are to the initial point of impact, the higher the probability your figure will be hit.

Let's look at this probability in some more detail.

Because the artillery die has equal probabilities for distances 2, 4, 6, 8 and 10 (remember, we ignore the misfire result), there is an equal probability for the template to end up in any of the 5 concentric circles.

Each of these 5 concentric range bands has its own area, which can easily be computed by subtracting the area of the smaller circle from the bigger circle. E.g., to compute the area of zone C, we compute

(7*7 - 5*5) times pi (area of a circle is pi times its radius squared) = 24pi.



The areas of all zones, using the same method of calculation:
  • Zone A: 8pi
  • Zone B: 16pi
  • Zone C: 24pi
  • Zone D: 32pi
  • Zone E: 40pi
The firing template itself has an area equal to pi (= pi*1*1). Therefore, if the template would end up somewhere in Zone C, it will cover a proportional area of its area divided by the area of Zone C = pi / 24pi = 1/24 = 4.17%. Thus, if a figure would be located anyewhere in Zone C, there's a 4.17% probability it will get hit if the template ends up in Zone C and the direction is generated randomly. For all zones:
  • Zone A: 12.5%
  • Zone B: 6.25%
  • Zone C: 4.17%
  • Zone D: 3.13%
  • Zone E:  2.5%
We made a simplifying assumption that the figure only has the dimensions of a single point. In reality, the figure itself covers some area, and if you count overlap between the figure and the template as well, probabilities will go up somewhat. BTW, this is one of my objections against using templates which are too small or have a strange shape w.r.t. to the size of the figures, since discussions w.r.t. overlap will always arise ... but I will keep that discussion for another blogpost.

Overall hit probability

Since each of the range bands has a 20% chance of occurring, the overall probability of a figure, located somewhere in the total possible impact area, is then as follows:
  • Zone A: 12.5% *1/5 = 2.5%
  • Zone B: 6.25% *1/5 = 1.25%
  • Zone C: 4.17% *1/5 = 0.83%
  • Zone D: 3.13% *1/5 = 0.63%
  • Zone E:  2.5% *1/5 = 0.5%
So, one can see this is a degrading probability the further the figure is located away from the point of impact. Depending on your assumptions on how such deviation should be modeled, this might make perfect sense. But you can also wonder how you will have to adapt the probabilities for ending up in each zone, such that the probabilities of getting hit are equal anywhere in the possible deviation area.

In order to achieve this, we have to adjust probabilities in proportion to their relative areas. Since the areas of Zone A, Zone B, Zone C, etc. are equal to 8pi, 16pi, 24pi and so on, we simply will have to design a randomizer proportional to these areas, and making sure that all probabilities sum up to 1. The sum of 8+16+24+32+40 = 120, and thus:
  • Zone A should be generated with a 8/120 = 6.67% probability
  • Zone B: 16/120 = 13.33%
  • Zone C: 24/120 = 20%
  • Zone D: 32/120 = 26.67%
  • Zone E:  40/120 = 33.33%
I'll leave it to the reader to come up with a simple mechanic for generating such probabilities (apart from rolling a D120 :-))

Some more mathematics

The analysis made above is also related to the problem of generating points in a circle with uniform probability, which is often a textbook exercise in many Probability 101 classes. Since the area of increasing concentric range bands goes up quadratically (a pattern that you can also see above), a random point can be generated by picking a random direction, and picking a random distance from the origin by taking the square root of a uniform random number generated between 0 and and the radius squared. Simply picking a random distance uniformly between 0 and the radius would produce a spread of points located closer to the centre of the circle.