Sunday, January 21, 2018

Cards and Cannon

To resolve cannon fire (or other types of fire), most wargaming rules use a ruler to measure distance, followed by a die roll to determine casualties. Many variations are possible, but the basic structure of measuring the range to the target and rolling for damage is a constant in dozens of wargames rulesets.

However, other approaches are possible as well.  It is well-known that H.G.Wells used toy cannon, shooting matchsticks. Although most wargamers do not like the idea of damaging their figures this way, there is something to say for more tactile mechanisms such as the one used by Wells.

This article describes a procedure for resolving cannon fire, by using cards to lay out the firing path.

A Path of Cards

I encountered this mechanic in Miniature Wargames issue 264, April 2005 (I often look up old articles, and then happen to come across something more interesting ;-)), in an article titled "A Deck of Cards", written by Andy Philippson. The article describes playing mechanics using ordinary playing cards. It is mostly about drawing cards to activate units, but one particular mechanic about shooting cannon drew my attention.

In order to determine whether a cannon hits its target, take the cards 2-10 from one suit, plus the Joker (10 cards total). Now, shuffle the cards, and lay out the cards in a straight line lengthwise, starting from the gun towards the target:
  • If the card that reaches the target has an even number, the target is hit. If the card is odd, the target is not hit.
  • If the Joker shows up before the row of cards have reached the target, this means the shell has "exploded" prematurely, and the shot stops right there (and yes, I know that a cannonball does not really explode in mid-air :-) , but as with many mechanics, invent your own favourite explanation for this effect ...).
  • If the Joker shows up as the first card, the cannon explodes and the crew takes damage.
  • If the "2" or "10" shows up, this means the shot deviates, and you place the next card 1 card-width to the left (if the 2 is first encountered), or to the right (if the 10 is first encountered).
That's the idea. Of course, you still need to fill out some more details regarding damage etc.

I quickly set up some ACW figures to show the mechanic in action (images taken with an iPad, they could have been of better quality ...):

The path of fire is laid out, with the "2" indicating a deviation to the right. Since the last card hitting the target is odd, the shot does zero damage.
The Joker shows up, ending the shot. No damage to the target.
The "10" deviates the shot to the right, with the "2" a further deviation. The shot passes next to the target.
Discussion

The use of the Joker stopping the shot might seem a bit harsh, but actually makes this mechanic a fine-grained distance modifier. We have 10 cards, so the joker could turn up with 10% probability in any of the card positions along the firing line. You could see this as a variable range (the shot can be 1 card length long, 2 card lengths long, ... each with 10% probability of occurring), but as we have shown in a previous post, random ranges are (sometimes) equivalent to distance modifiers. So, this mechanic has a more fine-grained distance modifier compared to a single die modifier for "over half range", as is often seen in rulesets.

It might seem a bit strange not to measure the distance between the gun and the target. But actually, we do. We measure the distance in units of card length instead of inches or centimeters. That's a perfect valid measure, although perhaps a coarse one. But that doesn't really matter, since the measured distance is usually only compared to the maximum or half range of the gun. If the maximum range is, let's say 24", it isn't that important whether you measure that distance in inches, centimeters, or card lengths.

The additional feature of deviation is another (geometric) probability built in to determine whether damage is inflicted or not.

Thus, this mechanic is perfectly capable of capturing the results of a more traditional ruler-and-dice approach. It comes down to whether you like this particular mechanic better. Laying out cards like this creates a unique tension ... when you turn over the next card in the sequence, there's always the possibility that the Joker turns up and that your shot will fall short. As the sequence of cards is laid down, you know the Joker can stop your shot with increasing probability ... this suspense during the resolution is more difficult to replicate with a simple die roll.

Moreover, laying out the cards creates a nice visual mechanic, comparable to using a cone-shaped firing template. Fantasy wargaming uses this mechanic fairly often for all sorts of (magical) effects; in historical wargaming it is considered somewhat old-school, but firing templates are often described in the books by Featherstone or Grant.

Variations

The mechanic as described above uses 10 cards (including the Joker), but you could easily increase or decrease the number of cards for making the effective firing range longer or shorter. Perhaps the number of cards could depend on weapon type, or other tactical modifiers.

The number on the card that hits the target (odd or even) determines whether damage is inflicted or not. But you could also use the number itself as an indicator of damage inflicted. That would open a new set of possibilities with damage ranging from 2-10, or any other range depending on the selection of cards. Obviously, this needs to be tuned with the rules in use.

Just as the "2" and "10" indicate deviations, you could add more cards that do exactly that, or less cards ... again variations can be introduced, perhaps even by printing out custom cards specifically tuned to various weapon types.

Battlemasters

When reading the article, I remembered I had seen this mechanic before. And suddenly I remembered! The classic Games Workshop/MB game Battlemasters (1992), still fondly remembered by GW afficionados of the late eighties/early nineties.

Battlemasters is played on a hexgrid, and also includes a cannon for the Imperial army. When the cannon shoots, a path of cards is laid out, hex by hex, till the cards reach the target. Again, an explosion stops the shot early, and there is the same rule that if the explosion is the first card, the cannon takes damage. There is no deviation left or right, but there are cards that make the ball "bounce", inflicting reduced damage if any troops would be present in that location.

I still have the components of Battlemasters lying around (the figures have long been drafted for other uses), so here they are, illustrating the principle in action.

My original Battlemasters cannon, aiming at some Treemen. Put the target card at the Treemen's hex.
The path of the projectile is laid out using cards. Sometimes the ball bounces, sometimes the shot falls short.
When the shot reaches the target, turn over the aiming card, and damage is done!
The similarities between Battlemasters and the mechanics described in the Miniatures Wargames article are very obvious, even more so because the article has activation mechanics almost identical to Battlemasters. Thus, I assume that the author has drawn his inspiration from Battlemasters - 13 years later - to develop his own card-driven wargame.

Conclusion

I think this mechanic is a nice visual representation of a cannon shot, especially if you would use custom-printed cards to add to the drama. The card deck can be tuned such that in terms of to-hit probablity and amount of damage, the same effects can achieved as with a more traditional ruler-and-dice mechanic.

I wonder if any other rulesets have used something similar? Let me know!

Addenda
  • Discussion on The Wargames Website.
  • An interesting suggestion was made on TWW: you could use a suit of cards, or even a full deck, but define the effectiveness of a gun in terms of which cards would "stop the shot", just as the Joker does. So, you could have a "Queen-gun", meaning that whenever a Q, K or Joker shows up, the shot fails. Similarly, you could have a "10-gun" etc. Maximum firing ranges would not be necessary, since the shot will statistically fail sooner or later depending on its type.

Wednesday, January 03, 2018

Square Grids (2)

In a previous post ("Square Grids") we outlined several methods how to measure distances on a square grid, with the aim of approaching the Euclidean distance as closely as possible.

One of the possible solutions is to count a diagonal move as 1.5 movement points. Such a procedure allows for a more accurate movement compared to not allowing diagonals, or counting diagonals as 1 movement point.

However, one could take this a step further and also define movement points for other types of movement. E.g., we can define a number of movement points when executing a Knight's move (as in chess, 2 squares horizontally, 1 square vertically, or vice versa). Using Pythagoras' Theorem, one can easily compute that such a distance equals the square root of 2*2 + 1*1 = square root of 5 = 2.236, or approximotely 2.25.

Hence, let us define movement on a square grid as follows:
  • 1 movement point for a horizontel or vertical move;
  • 1.5 movement points for a diagonal move;
  • 2.25 movement points for a Knight's move.
The resulting movement ranges, for 3, 5 and 7 movement points, are illustrated in the diagram below. The dark shaded squares are the ones we can reach when rounding our movement allowance down, i.e. we can spend up to 3.5, 5.5 or 7.5 movement points.

Diagonal movememtn counts as 1 movement point; a Knight's move counts as 2.25 movement points.
Dark shaded squares indicate an expenditure 0.5 movement points above the nominal number.
The overal picture, especially when compared to the diagrams in the previous blogpost, is that we can approach the circle (the ideal Euclidean distance) even better.

And why stop here? We could define custom movement points for a move that would take us 3 squares forwards and 2 squares sideways ( a so-called Zebra move in chess), or a move that would take us 3 forwards, and 1 sideways (a Camel move in chess -- both Zebras and Camels are called "leapers" in the context of fairy chess pieces), etc. The more we include these special "moves", the closer we can get to approaching the ideal Euclidean distance. In the limit, every possible movement between a starting square and end square can be given its own customized movement point cost.

"But such a system would become totally unworkable!", I hear you say. Quite right, it would become unworkable, working with fractions, and remembering all those special moves with their own movement points expenditures.

That's why - in a wargame that uses a gridded playing field - we don't really want a measurement procedure, we want a counting procedure. There's a subtle difference between both. A measurement procedure would express the movement cost between two gridcells on the playing field. But a counting procedure is what we need when playing. We want to to go from gridcell to gridcell, physically moving the figures (or using our finger to point out the movement path), while counting and accumulating the spent movement points as we proceed along the movement path. Thus, complicated counts such as the Knight's move, the Camel move or the Zebra move, do not fit that pattern.

It is tempting to play around with more complicated counting procedures, but I think the game will suffer. And, the more complicated counts we include and the closer we approximate Euclidean distances, the more we should think about removing the grid and use a ruler in the first place!

What's the probability xD6 beats yD6?

What's the probability a roll of xD6 beats yD6? In other words, roll x number of D6's, add them all up, and compare to the sum of rolling a number of y D6's. I got this exact question from a long-time gaming friend some time ago.

My first question was "How large are x and y?" With small numbers, one could do the calculation by hand, but with larger numbers, finding a closed-form formula might be more difficult. "Anything from 1 to 12", was the answer.

What's the distribution of xD6?

The first thing to consider is the probability distribution of the sum of rolling x number of D6's. Most gamers know that the distribution of outcomes for a single D6 equals {1, 2, 3, 4,5 ,6}, with all outcomes having a 1/6 probability of occuring. But what is the distribution of adding multiple D6's together?

In mathematics, this is known as a convolution operator. Simply stated, a convolution adds distributions together, arriving at a final distribution that reflects the sum of various independent variables. We will not go into the mathematics of computing such convolutions for die rolls, but most wargamers are familiar with the notion that the more dice you roll and add together, the more the final result behaves like a "bell curve" (although I always like to point out that a bell curve has a precise mathematical definition, being the Gaussian normal distribution, but let's not start that discussion here :-)).

The plot below shows the resulting probability distributions for rolling 2D6, 4D6, ... , 12D6 (using the excellent tool anydice.com). As you can see, the more dice you roll, the more spread out the results become (varying between rolling all 1's or all 6's), but there's a clear "bulge" in the middle of the distribution that indicates a higher probability for those particular results. Also note that these are discrete distributions, i.e. only the dots are possible outcomes. The lines between the dots are only drawn for a nicer visualization.


Comparing xD6 to yD6

When we want to compute the probability that xD6 beats yD6, we need to consider all possible results of xD6, and compare to them all possible lower results of yD6. All combined probabilities of such combinations need to be added to arrive at the final probability.

We can illustrate this process on the graph below. The distributions for 6D6 and 10D6 are shown. Let's single out the probability that 6D6 gives 28 as a result. We now need to multiply this probability (2.5%) with all probabilities that 10D6 gives a lower result, and add them all up. Then we need to repeat the process for all other outcomes of the 6D6 roll as well.


 Especially for high numbers of x and y, this can result in quite some tedious calculations, so perhaps there is an easier way?

What's the distribution of xD6 -yD6?

What we really want to compute when comparing xD6 to yD6 is the probability that xD6 - yD6 gives us a number greater than 0. This means subtracting two distributions, which is itself a convolution operator.

But we can do something clever here. The distribution of a single D6 is exactly the same as the distribution of 7-D6 (see also "D20 = 21 - D20?").

Thus, yD6 has an identical distribution of 7y-yD6, and so we can say that:

probability xD6 - yD6 > 0
equals
probability xD6 + yD6 -7y > 0
equals
probability (x+y)D6 > 7y

Let's illustrate this using x = 6 and y = 8. The graph below shows that 6D6-8D6 has exactly the same distribution as 14D6, except it is shifted by a distance of 7*8 = 56.  The probability that 6D6 - 8D6 is greater than 0, is the same probability that 14D6 is greater than 56.


What's the probability that zD6 > some number?

So, we need to compute the probability that any distribution zD6 is larger than some number (which itself is a multiple of 7). Can we do that?

It is difficult to find a closed-form solution for this probability. It can be done, but the mathematics involved would fall outside the scope of this article. An alternative could be to approximate zD6 with a Gaussian distribution with the proper mean and deviation, and compute the integral under part of the Gaussian curve ... which involves the so-called erf or error function and is a built-in function in many numerical mathematical packages. But again, this would fall outside the scope of some simple game design calculations. And moreover, such approximation would only hold for large numbers of z.

So, what do we do?

In the end, I fear there's not much we can do than to simulate a large number of die rolls, and compute the probabilities as an average of all these simulations. You can quickly program something like that, using a proper programming language, or even something like MS Excel.

I have done exactly that, and the table below gives the final results ...


The color codings indicate the percentages: 10% and 40% intervals on both sides, and anything below 1% in grey. Draws are not included in the percentages, so that's why 2D6 only has a 44.5% probability of beating another 2D6.

But what about using this as a gaming mechanic?

The mathematics above say nothing about the elegance or usefulness of comparing xD6 to yD6 as a gaming mechanic. I fear this is where everything falls apart. It seems to me that comparing die rolls like this is quite some hassle. You need to roll multiple dice, compute the sum, and compare it to another sum. That's a lot of work for a binary decision. On the positive side, modifiers can easily be included by increasing or decreasing the number of dice.

Moreover, from the table above one can see that the "workable" range of probabilities (yellow and orange areas) is quite limited. So, although x and y vary from 1 to 12, they better do not deviate too much in order not to have a foregone conclusion.

My conclusion?

I would not recommend comparing xD6 to yD6 as a gaming mechanic ... I still prefer using single polyhedral dice for opposed die rolling.