Sunday, June 25, 2017

Square Grids

Some wargamers (including me) like to use grids for their games. For some types of games they work wonderful, for others, not so much. I know that some wargamers are vehemently opposed against using grids in miniature wargaming, but I simply consider them to be one of many tools you can use when designing a game.

One of the recurring debates when using grids is whether to use a hexagonal grid, or a square grid. The main objection against square grids is diagonal movement. Moving to a diagonal adjacent square covers more distance on the 2D surface compared to a horizontal or vertical move. Pythagoras' theorem says that - if the distance measured from centre to centre between horizontally and vertically adjacent squares is equal to 1 - the diagonal distance equals the square root of 2. Any calculator will show you that the square root of 2 is 1.4142... , but for gaming purposes, 1.5 is close enough.

This article looks at some of the solutions one can use to address the discrepancy caused by diagonal movement on square grids.

Diagonal movement allowed, and counts as 1

The  simplest solution is just to ignore the issue at all, and consider diagonal movement equal to horizontal or vertical movement. Or, in other words, a diagonal move expends 1 movement point, just as well as movement in any of the other 2 directions.

The diagram below shows what squares you can reach using this method, when starting at the red square at the bottom-left. Movement distances of 3, 5 and 7 are shown in blue, green and orange. The circle arcs show the "true" Euclidean distance from the centre-point of the red square.

Diagonal movement counts as 1 movement point
It's rather obvious that the discrepancy becomes larger if the movement distance increases. This is not unsurprising. But is also means that for small movement distances (1,2,3), such things don't matter that much.

No diagonal movement allowed

The other end of the spectrum of possible solutions is to simply disallow diagonal movement at all. Only horizontal and vertical moves are allowed. This corresponds to what mathematically is known as the Manhattan distance - moving on a grid where you have only streets and avenues at 90 degree angles.

No diagonal movement is allowed
Again, we make significant errors, but we now "undershoot" the true distance. And as you can see, the effect on low movement rates is rater small.

Diagonal counts as 1.5

A good solution would be to count diagonal movement for its true distance, namely the square root of 2 (1.4142), or rather, its approximation by 1.5. This is a bit awkward, since you have to count using halves when moving diagonally, but it provides a nicer approximation to the circle. The diagram below shows the squares you can reach using this method, when not exceeding the movement allowance, and thus sometimes leaving 1/2 movement point unused. 

Diagonal movement counts as 1.5
You could also rule that you can go over by 1/2 - thus, you can use 7.5 movement points instead of 7. What we are doing then is introducing a "rounding down movement points" rule. It allows you to move the additional square here and there, as shown below. Nevertheless, it is a bit strange, since it goes against a well-established convention in wargaming, that you can never use more movement points than you have available.

Diagonal movement counts as 1.5, but going over by 0.5 is allowed
If you do not want to use the half movement points, you could also double all movement points, and count 2 movement points for a straight move, and 3 movement points for a diagonal move. But then all your other movement point expenditures (terrain, obstacles, ...) need to be doubled as well.

Addendum: see also the blogpost "Square Grids (2)" for including Knight's moves as well.

At most 1 diagonal movement allowed

This mechanic does exactly as it says. I consider it not very elegant, because you have to remember whether you already used up your diagonal movement or not, and somehow, players find this confusing, especially because you have to count at the same time.
What this rule actually does is to extend the "no diagonals allowed" movement pattern by one square outwards.

At most 1 diagonal movement allowed
-1 movement penalty when using any diagonal - a.k.a. +1 movement when you move straight

Again, this mechanic works exactly as it says in the title. If you use any diagonal movement, your movement penalty allowance is decreased by 1. It is an easy to use mechanic. An easier formulation of this mechanic is that you gain +1 movement point if you move on a straight horizontal or vertical line (this requires redefining your original movement rates by -1). The latter formulation is easily to see visually on the diagram, when you compare it to the "diagonals allowed" procedure.

Movement is reduced by 1 is you use any diagonal (or gain +1 when moving straight)
1 / 2 / 1 / 2 alternation

This is a variant on the 1.5 mechanic. If you don't like counting using halves, we can do an approximation by counting the first diagonal as 1, the second as 2, the third again as 1, and so on. On average, this means a diagonal is counted as 1.5. I consider this not a very elegant mechanic, since you have to remember where you were in the sequence. But, similar to the 1.5 rule, it approximates the circle very well, and is essentially the same as the 1.5 rule, with the variation of spending the extra 1/2 movement point.

First diagonal counts as 1, 2nd counts as 2, 3rd counts as 1, ...
2 / 1 / 2 / 1 alternation

A simple variation of the previous mechanic,  but we start by counting the first diagonal as 2 movement points. The effect is that we are able to move a little less further, because the first diagonal is more expensive, and if we use an odd number of diagonals, it does cost more than in the previous procedure. We get the same diagram as the basic 1.5 diagram.

First diagonal counts as 2, 2nd counts as 1, 3rd counts as 2, ...
Facing

A factor that might make things a bit more complicated is when facing is important. E.g. in a naval game, a ship might only be able to move forward in its current direction, and THEN only turn 45 degrees. The choice of mechanic might be dependent  on these additional constraints. E.g. in our Flagstone Fleets outdoors naval games (using the flagstones on the patio as our grid), we used the "+1 if you move straight" rule. It worked out well using the facing rules and the movement distances we employed.

Conclusion

Overall, I like either the "diagonals count as 1.5" for larger movement distances, or the "+1 if you move straight" for small movement distances, the most. I think they combine the approximation of the circle with an elegant an easy mechanic in the best possible manner.

Addenda

Sunday, June 18, 2017

D20 = 21 - D20 ?

One of the little tricks that can be used when designing a dice-based procedure is to transform a single die into its complement.

Now what do I mean by that?

We all know that a single D6 produces a uniform distribution of the numbers {1, 2, 3, 4, 5, 6}, all with equal probability (that's what a "uniform distribution" means in statistics and probability theory). Similarly, a single D20 produces a uniform distribution of the numbers 1 to 20, and so on.

Often, such a distribution is modified by a die modifier. E.g. when we roll a D6+2, we get a distribution of the numbers {3, 4, 5, 6, 7, 8}, again all with equal probability. A roll of D8-1 gives us {0, 1, 2, 3, 4, 5, 6, 7}, and gives us again a uniform distribution of those numbers.
 (However, adding two dice rolls, such as when rolling a 2D6 or 3D6 or D6+D8+D10, does NOT produce a uniform distribution. I will come back to that in a future blogpost.)

The die modifier can be negative, but we can also make the result of the die roll itself a negative number. E.g. if we would roll a -D6 (note the minus-sign!), we would get a uniform distribution of the numbers {-1, -2, -3, -4, -5, -6}. And we can add a modifier to that as well. So, when we roll 3-D6, we can get the results {2, 1, 0, -1, -2, -3}, again all with equal probability.

And if you can't get your head around taking the negative number rolled on a die, you could always use a die using negative numbers!

Taking the complement

You might say that using dice to produce negative numbers like that isn't very useful when designing a game mechanic. And probably that's true. I also cannot remember seeing a mechanic that uses negative dice rolls. But, you can use the arithmetic of negative dice to play around with existing die rolling procedures to make them more intuitive to use.

A key insight is that a single D6 produces exactly the same distribution as 7-D6 (check this for yourself if you aren't sure!). What we have done by rolling 7-D6 is taking the complement of each number against the number 7. A single D6 produces the numbers {1, 2, 3, 4, 5, 6}, and 7-D6 produces {6, 5, 4, 3, 2, 1}. Rolling a 1 gives us 7-1 = 6; rolling a 5 gives 7-5 = 2, and so on. In the end, we get exactly the same numbers as an ordinary D6.
For other die types, you can use exactly the same arithmetic. In general, x+1-Dx will give you the same distribution as the original Dx. Thus, 21-D20 is completely equivalent to a D20.

Transforming die rolling procedures

Transforming a positive die into a negative die this way is useful when you want to transform a procedure from rolling "low" to rolling "high" or vice versa. Let me give an example from my own gaming history to illustrate this.

In a fantasy roleplaying game we used to play regularly a long time ago, the attack roll went as follows:
  1. Look up your own Attack score (ATT), usually a number from 11-20
  2. Look up the defender's defensive score (DEF), usually a number from 1-10
  3. Compute ATT - DEF
  4. You hit the opponent if you roll a D20 lower or equal to this target number. In other words, the attack is succesfull if D20 <= ATT - DEF.
This procedure makes sense mathematically. But we didn't like it, for the following reasons:
  1. First, you need to ask the opponent for his DEF score before you could compute a target number. I am a big fan of die procedures that allow you to roll a die without having to ask the opponent for information.
  2. Second you need to roll lower or equal to the target number, which for some reason feels "wrong". Players like to roll high!
So, how can you change this procedure? You can simply switch terms from the left side to the right side of the inequality, as you would do with algebraic expressions. If you want to address the first issue, you could alter the mechanic to D20 - ATT <= -DEF (move the ATT term to the other side of the inequality). Roll a D20, subtract your own ATT, then compare to the negative DEF score of the opponent. But with all the negative signs, this is weird ...
(Some of you might see similarities to AD&D 1st edition, with THAC0 and negative Armour Classes etc ...)

What else? Perhaps we can rewrite the inequality to DEF <= ATT - D20. Take your ATT score, subtract a D20, then compare that roll against your opponent's DEF score. That also addresses the first issue, but still is weird due to the negative D20, which still means you want to roll low..

So here's the trick: replace the D20 by 21 - D20, and you transform a negative die roll to a positive or vice versa. So D20 <= ATT - DEF can be rewritten to 21 - D20 <= ATT - DEF, and further to 21 + DEF <= ATT + D20, which is equivalent to D20 + ATT >= DEF + 21.
This is a much more elegant mechanic. You roll a D20, add your ATT score, and compare against the DEF score + 21 of the opponent.

The +21 die modifier is a bit strange, so you could replace all old DEF scores by new ones by adding 21. Since the original DEF scores usually ranged from 1 to 10, this would mean DEF score going from 22 to 31. But we can play around with the +21 factor as well, by distributing it over both sides of the equation. E.g., instead of using D20 + ATT >= DEF + 21, we can also use D20 + ATT - 10 >= DEF + 11. Since the original score for ATT ranged from 11 to 20, we now would get new ATT scores from 1 to 10, and the new DEF score would range from 12 to 21.

Whether you like the new procedure better than the old is of course a matter of taste.