-
Notifications
You must be signed in to change notification settings - Fork 5
Lanchester's laws
Lanchester's laws are simple formulas for modeling the effects of the size of a fighting force and the interplay of quality and quantity. When combined with a few other straightforward assumptions, they can be used to derive an additive encounter difficulty and XP system.
We'll use Dungeons & Dragons 5th edition as our primary example, but these concepts are not tied to any specific game.
We'll start with a brief review of Lanchester's laws. If this is your first time encountering Lanchester's laws, you may want to start with some of the more detailed treatments listed in the footnotes.1
There are two basic Lanchester's laws. The first is the linear law, which applies in situations where a greater quantity of units does not allow a greater amount of firepower to be brought to bear, but overall survivability is proportional to quantity; or alternatively, where firepower is proportional to quantity but survivability does not scale up with quantity. Here are examples of where the linear law applies:
- The combat consists of a sequence of 1v1 duels.
- A chokepoint only allows a fixed number of units of each side to fight at a time.
- The frontline only allows an equal number of units on each side to fight at a time.
- Attacks are unaimed, with their chance of hitting being proportional to the number of opponents.
- Area of effects are so large that attacks hit all opponents, meaning that a greater number does not result in greater survivability for that side.
Let's say one side is the player's party and the other side is their enemies. Both sides' units are identical, with the enemies having a fraction
The other basic law is the square law. This applies to situations where both available firepower and survivability scale proportionally to quantity. Ranged combat is often closer to this case, when any unit is capable of attacking any other unit.
If attrition of firepower from damage taken is continuous for both sides, under the square law the party will end the battle with a fraction
The above is the canonical formulation of Lanchester's square law. However, constant attrition on the player side is not the norm in RPGs. As a social activity, it is usually considered unsporting to bar a player from contributing to the action---which is exactly what attrition does. Therefore, most RPGs don't make player-side attrition a major factor, i.e. characters may lose health but comparatively rarely lose firepower.
So what happens if player-side attrition is removed entirely, i.e. the player side always has the firepower they started with regardless of health level? In this case, the remaining number of enemy units will go linearly to zero over time. If the enemies still suffer attrition, the remaining fraction of party health at the end will be
as it will take
If the enemies also don't suffer from attrition until completely eliminated, this doubles their mean firepower, and the party will end with a fraction
of their health remaining.
In both cases, the fraction of party health (or other resources) depleted is proportional to
It's rare for an actual scenario to follow the conditions of either the linear or square law exactly. For example:
- Spectators of 1v1 duels might help their side at reduced effectiveness.
- Melee frontage might restrict how many units can gang up on a single opponent, but still allow more than 1v1s.
- Chokepoints might be present but not perfectly effective.
- Area-of-effect attacks may exist, but they might not hit all enemies.
- Ranged attacks might be common but not necessarily all have targets in their field of fire.
A natural mathematical method of interpolating between the linear and square laws is to use a Lanchester exponent
What if one side's individual units are stronger or weaker than the other's? Let's define quality as the kill ratio of the two sides if they fought in a linear law situation (regardless of the scenario's actual Lanchester exponent). A simple example would be units with just two stats, damage per time and hit points, in which case the quality would be the product of the two:
If you are indeed in a linear-law scenario, if you double your quality, you can take on twice as many enemies.
However, if you are in a square-law scenario, the quality must increase quadratically to keep up with a linear increase in quantity. So in this case you would need to quadruple your quality in order to take on twice as many enemies.
For a general Lanchester exponent
for quality to keep up with quantity.
This is all certainly a gross simplification of the real world, or even of the tabletop; it does not take into account factors such as range, terrain, maneuver, alpha damage, healing, heterogenous attrition, and so forth. However, if we want a simple system that assigns just a single numerical rating to units and forces, Lanchester's laws are about as good as we can do.
The D&D 5e DMG pp. 82-83 (see also D&D Beyond) has an "Encounter Multipliers" table that applies a multiplier to the estimate of the difficulty of an encounter based on the number of enemies. The implied Lanchester exponent is
Here's a graph:
Note: The DMG instructs to sum the XP values of the monsters together before applying the multiplier. Therefore, a linear factor is already accounted for, and so the curve above is of
On the player side, the DMG instructs to move the multiplier up by one step if the party has less than 3 player characters (PCs), or down by one step if the party has 6 PCs or more. This is also roughly consistent with Lanchester exponent
All-in-all, the process for designing an encounter specified by the DMG consists of the following steps:
- Sum the XP thresholds of the PCs.
- Multiply by a factor based on the desired encounter difficulty to get the desired adjusted XP.
- Sum the XP values of the enemies.
- Determine a multiplier based on the number of enemies.
- Adjust the multiplier based on the number of PCs.
- Apply the multiplier to the base XP sum to get the adjusted XP.
- Compare the result to the desired adjusted XP and adjust the encounter as necessary.
The DMG states that
This adjusted value is not what the monsters are worth in terms of XP; the adjusted value’s only purpose is to help you accurately assess the encounter's difficulty.
If we assume that this is indeed an accurate estimate of an encounter's difficulty, then it follows that the party will gain the most XP for any given difficulty when fighting a single enemy and the least when fighting a large number of enemies.
How about the player side---are small or large parties better? If the Lanchester exponent is the same for both the party and the enemies, a double-size party could take on twice as many enemies and gain the same XP per PC at the same difficulty. However, as we've just seen, the larger party may have the option of fighting enemies with greater individual XP rather than a greater number of enemies. The former gives more XP for a given difficulty.
Therefore, as far as XP/difficulty is concerned, the party is encouraged to be as large as possible and to arrange to fight one enemy at a time. If the population of enemies is fixed, this follows the "defeat in detail"/"divide and conquer" tactic. If the players can decide what populations of enemies to seek out, this would encourage seeking out single "boss" enemies over hordes of weaker enemies; for example, taking the quest to fight the solitary hydra rather than the quest to fight the goblin army.
On the other hand, if the players have little control over what encounters they face, they can only hope that they will fight mostly single enemies.
Suppose we wanted a quicker way of calculating the adjusted XP, and possibly award the PCs according to this difficulty rather than the linear sum of XP values. Or suppose we wanted to be able to design an encounter by simply adding up the ratings of a group of PCs or enemies without any explicit multiplier for the number of units. How might we design a system to achieve such things?
Since XP would no longer be a property of individual units, it's no use equating Challenge Ratings to XP values. Instead, we'll rate each unit in terms of an Equivalent Quantity (EQ):
Quality is proportional to the number of EQ 1 opponents that would be an even matchup in a sequence of 1v1s (as Lanchester's linear law), whereas EQ represents how many EQ 1 opponents that would be an even matchup if the EQ 1 opponents all came at the same time (as Lanchester's law with exponent
Quantities are inherently additive. Therefore, since EQs in this system are equivalent to quantities, an encounter's EQ is simply the sum of the individual EQs. Likewise, a party EQ could be computed as the sum of the EQs of the PCs. You could make PC EQ equal to PC level, though note that if you do so, the level-over-level (percentage) growth in both EQ and quality will slow down as level increases.
Now, suppose we want to make the progress towards the next level proportional to the fraction of the party's resources expended. Using Lanchester's law with an exponent of
This also serves as an estimation of how difficult the encounter is.
If all of the PCs have the same EQ, we have:
We want the XP to level to depend on only the current PC level, so the only thing it can depend on is the individual PC EQ. The XP must therefore cover the other variables. This gives us
These equations can be precomputed into four tables:
- A table assigning a PC EQ to each PC level.
- A table suggesting what ratio of encounter EQ to party EQ to use for a desired encounter difficulty.
- PC EQs and enemy EQs don't need to have the same scale factor, though it can be more convenient to make them the same. If they are not scaled the same, the difference can be compensated for in the encounter difficulty ratios.
- A table of XP needed to get from one level to the next.
- You can apply an extra multiplier to particular levels if you want to pace them faster or slower than others.
- A table that tells you the adjusted XP per PC for a given encounter EQ and number of PCs.
- This is only used if you want to award XP equal to the adjusted XP; if you are e.g. using 5e's milestone leveling, then this table is not necessary. Only the first two tables in this list are needed for encounter design.
The final process for determining adjusted XP per PC is as follows:
- Total up the EQs of the enemies.
- Count the number of PCs.
- Look up into the table to determine the adjusted XP per PC.
This table lookup replaces the DMG encounter multiplier as well as the division by the number of players.
The final process for encounter design is as follows:
- Total up the EQs of the party.
- Multiply by a factor depending on how difficult you want the encounter to be.
- Select enemies with total EQ equal to the result.
Being able to add EQs together simplifies encounter design, especially where mixed EQs are involved. Contrast the DMG's statement on mixed CRs:
When making this calculation, don't count any monsters whose challenge rating is significantly below the average challenge rating of the other monsters in the group unless you think the weak monsters significantly contribute to the difficulty of the encounter.
- How much is "significantly below"?
- How is "average" computed?
- What does "significantly contribute to the difficulty" mean? And isn't difficulty estimation the job of the CR system in the first place?
If you don't want to go all the way to awarding XP based on the difficulty, you could use one value of
If you go all the way down to
Then you could award
summed among all enemies and split among the PCs, the same as the stock 5e method. In this case the adjusted XP table is not necessary.
As an example, we can try converting D&D 5e to this system. [This article shows the results.](lanchesters laws 5e conversion)
For a more clean-sheet approach, you can try my Google Sheets calculator. Use the Public editable sheet, or File > Make a copy to create a copy for yourself.
The calculator offers two options for growth in PC quality by level. The first is an exponential function, which will produce a constant level-over-level growth in both quality and EQ:
The other is a power function, which will cause a dropoff in level-over-level growth at higher levels:
If we solve for EQ rather than quality, both of these retain their forms, just with different constants.
As far as Dungeons & Dragons goes, 3e resembles an exponential function, while 5e more resembles a power function.4
The calculator assumes that all levels are paced the same. You can add an additional multiplier to the XP required for particular levels to pace them faster or slower.
- Lanchester's laws provide a simple model for comparing two fighting forces and comparing the effects of quantity and quality.
- These laws can be used to derive an XP and difficulty estimation system for encounter-based RPGs similar to Dungeons & Dragons.
- The resulting system has additive difficulties, allowing GMs to design encounters more easily than the process specified by the 5e DMG.
1 For a more in-depth analysis of Lanchester's laws, see the next footnote. If you prefer a demonstration in video form, here's a video applying it in Age of Empires II. This in turn cites a paper studying StarCraft:
Stanescu, Marius Adrian, Nicolas Barriga, and Michael Buro. "Using Lanchester attrition laws for combat prediction in StarCraft." Eleventh artificial intelligence and interactive digital entertainment conference. 2015.
This paper estimated a Lanchester exponent of 1.56, which they call the "attrition order" and denote by
2 For example, the derivation by Niall McKay.
3 If you really want to imagine a mechanism that produces this result, you could say that enemy firepower scales as the
and in the case where neither side suffers attrition of firepower, by
just as the analogy predicts.
Does this correspond to some real-world scenario? You could construct a battlefield topology where extra units have to shoot from a distance from the front line with some dropoff in effective firepower the further they have to shoot from, such that a particular value of
4 In 3e, XP awards double every increase of 2 CR. As written in the core rulebooks, both XP awarded by CR and XP required to level have an extra shared factor by level (for no net effect); an Unearthed Arcana gives the option of removing this extra factor, resulting in approximately
starting at CR 2. If we consider each additional point of attack bonus, AC, and other d20 modifiers to have a constant proportional effect on quality over the last, and these stats to increase linearly with CR, we would indeed expect the quality to increase exponentially with CR.
In 5e, the relationship between CR and XP approximately follows
from CR 2 to CR 20.
Indeed, this coincides with 5e's adoption of the doctrine of bounded accuracy, where, according to designer Rodney Thompson:
The basic premise behind the bounded accuracy system is simple: we make no assumptions on the DM's side of the game that the player's attack and spell accuracy, or their defenses, increase as a result of gaining levels. Instead, we represent the difference in characters of various levels primarily through their hit points, the amount of damage they deal, and the various new abilities they have gained. Characters can fight tougher monsters not because they can finally hit them, but because their damage is sufficient to take a significant chunk out of the monster's hit points; likewise, the character can now stand up to a few hits from that monster without being killed easily, thanks to the character's increased hit points.
This quadratic progression is natural for a system in which firepower and survivability each increase linearly with CR.
This is not a perfect correspondence, as 3e also has some increase in damage and hit points, and 5e in d20 modifiers, but in broad strokes this does seem to support the idea of the shape of the XP curve following the shape of the quality curve.