Saturday, September 29, 2012

Game Design (II): Simulating combat, healing and defending

In my previous article, I set the guidelines for the design of our combat system, and defined key concepts like turns-to-kill and focus fire, illustrating them with some very basic simulations,  We also stated the primary system requirements: finish encounters in 5 turns on average, have players win by a not-too-wide margin, and prevent combats from ending in a boring grind. From this point, I intend to gradually increase the depth and accuracy of our simulations, introducing new elements one at a time and examining their impact in the game math. Today I will take a look at some combat roles, like defending and healing, and discuss two new game mechanics aimed at improving the game experience: monster healing, and last effort.

Simulating a 5-vs-5 combat

Let us begin with our first “realistic” (though still quite simplified) simulation scenario: A combat between five playing characters and five monsters, in which the heroes have the advantage, and win in roughly 5 rounds. We assume that all PCs have the same stats, as do all monsters, and that all damage from each party is focused on a single enemy character at a time. For now, we won’t be considering any variance - instead, all characters hit automatically each turn for a fixed amount of damage. In addition, the effect of overkill damage is not considered - any excess damage after slaying a foe is fully applied to the next enemy in the line.

Assuming that PCs have a K value of 4.5 (i.e. they each kill a monster in ~4.5 turns, and deal damage 1/(4.5) times a monster’s HP per turn), and that monsters have a K value of 5.5, the evolution of this combat encounter would look as follows:

Fig 1 Evolution of # of PCs/Monsters in example encounter
PC K Turns  4.5
Monster K Turns  5.5

The figure shows how many characters remain conscious at the end of each combat round. Turn 0 represents the initial state. In this case, the fight would be over by turn 6, with all monsters slain and 3 heroes knocked down. The spreadsheet used for this exercise can be found here.

This is a very abstracted view of a combat, but there is some valuable insight to be gained from this perspective, for the following reason: the number of active combatants on a given combat round has a direct impact player fun. Though game fun is far from an exact science, I believe the following statements to be true:

  • Any player whose character is inactive (unconscious or dead) for the majority of combat will have substantially less fun.
  • Combat is more challenging and fun in rounds where both sides have a similar number of active characters.
  • It is particularly frustrating to have monsters that are no longer threatening to the players but refuse to die.

Taking these ideas into account, we could talk about an Optimal Zone in a combat encounter, defined roughly as the period where most PCs are active and enough monsters remain for an engaging challenge, and a Grind Zone, or the time where either two or more PCs are out of the battle, or the team monster is too weakened to pose an interesting threat. Ideally, we would want our system to encourage combats with long optimal zones while keeping the grind zones as short as possible.

The figure below shows optimal zones and grind zones for our previous example, defining them as follows: The optimal zone includes turns that start with 4+ active PCs and 4+ active monsters. The grind zone includes turns that either start with 3 or less active PCs, or 2 or less active monsters.

In this example, we can see that the first few monsters drop fairly quickly, whereas the last ones tend to overstay their welcome - that is, we have a relatively brief optimal zone, and a significant grind zone. I want to change this so that the initial kills are delayed, and the final kills don’t take so long - thus maximizing the sweet spot where lots of characters are interacting in the battlefield. However, before I introduce specific mechanics to address this, I need to add a new layer of complexity to my simulated model: the combat roles of defending and healing.

Defending and healing

The defender role is based on two mechanical pillars: the ability to withstand more damage than average characters, and effects that encourage enemies to attack the defender instead of his allies. If we assume that this “attack magnet” effect has a 100% success rate (which is an exaggeration, but not a terrible approximation), and that the extra survivability amounts to about 50% (in enemy attacks to kill the defender, compared to a non-defender character), adding a single defender to a PC party in our model has two consequences:

  • Total party survivability increased by 50/5=10%
  • Number of attacks required to drop the first character in the party increased by 50%

The first effect can be compensated by increasing enemy offense by a similar amount (i.e. 10%), to preserve the balance of power between both sides, and the time it takes to end an encounter. Interestingly, if we do this, we find that the second effect still provides a significant advantage to the party with a defender, since delaying character deaths means that the party now has more active characters (which translates into more aggregate attacks) after sustaining damage. Unfortunately, I haven’t found an easy way to describe this analytically, but it’s easy enough to observe in the simulation.

The death-delaying effect of a defender is represented in the figure below (and this spreadsheet), which shows loss of party characters as a function of attacks received. The blue line shows a regular focus fire scenario without a defender, where the first character drops after the party sustains 20% of the total attacks required to kill it. By contrast, the red line shows the same scenario with a defender, normalizing monster offense to match the increase in total party survivability. Here, we can see that the defender doesn’t fall until the party takes attacks worth 30% of its total survivability, and that each subsequent character loss before the last is also delayed, to a smaller degree.

In terms of our model, character healing works in a very similar way. If we suppose that healing is used as soon as it is needed, adding a healer to a party is the same as increasing the survivability of the first party character to be attacked by a given percentage. An effect like Healing Word gives back about 33% of a character’s HP, so a healer with 2 such powers per encounter would amount to a total of 66% extra survivability for the first character.

It is interesting to note that healing and defending work very well together, since any healing power spent on a defender becomes particularly effective. A party with both a defender and a healer in our example would have a total extra survivability of ((1.5*1.66)-1)=1.5, or 150% that of a normal character.

A case for monster healing

Aside from other important considerations (like adding tactical depth and variety), the existence of defending and healing roles in player parties has an important advantage in how it affects combat development: it keeps player characters active for a greater portion of an encounter, without necessarily extending total combat duration. Now, I’m going to argue how providing a similar bonus to the monster side could be of benefit to the game.

D&D 4E has been designed so that monsters don’t get healing effects. Conventional wisdom says that this is a good thing, since one of the most common complaints about the game is the fact that encounters run too long, and monster healing would only aggravate it... or wouldn’t it? Certainly, that’s what would happen if you just shoehorned additional healing onto the existing game mechanics and mathematical framework, but what if we were talking of deeper, carefully considered changes?

I don’t think monsters should get a general Second Wind ability, nor am I suggesting a new monster role with healing capabilities. That would only extend combats for no tangible benefit, and complicate encounter composition, respectively. What I want is a limited pool of healing that is available every combat, to delay the first monster losses. Below, you can see my first draft of this rule:

Monster Commander: Before every encounter, the Game Master selects one of the monsters (usually the most powerful of intelligent one)as the Commander of that monster party. The commander gains the Commanding Word power:

Commanding Word. Minor Action (2/encounter, 1/turn). Close burst 5. Target: You or one ally in burst. Effect: The target regains hit points equal to 5+ (2.5* its level).

The number is ugly, but it intends to approximate 1/3 of a monster’s HP under the current math. This will hopefully change to something more readable once I update the monster stat block and math (coming soon!), but it should work for now. Overall, the healing effect would be equivalent to that of a low level PC healer: a 66% extra survivability.

Keep in mind that the defending role is already present in monsters, though Soldier monsters are comparatively not as tough, nor as effective, as a PC defender - equivalent to about a 20% extra survivability. Combined with this healing, this amounts to roughly a 100% bonus in survivability for the first monster, considerably delaying the first monster deaths.

Since just want to rearrange monster deaths without increasing the total combat duration, we should compensate the introduction of this rule by either a 15% increase in PC damage, or a 15% decrease in monster HP. At this point I don’t have a clean way to address this, other than changing numbers by hand, but this will be taken into account when redefining the monster stats. This is how our example would look like after introducing monster healing and adjusting PC damage.

A last effort

In the previous section, we suggested improvements for the first rounds of combat. However, these changes still left late-game grinding untouched, as is evident from the figure above: the last three turns in the example scenario have the monsters severely disadvantaged, and should play out as little more than routine cleanup for our heroes... but they still take way too long.

In my opinion, there are two main ways we can improve the grind problem:

  • Shorten the agony: Once it’s clear that the fight is decided, end the encounter right away, or at least make the monsters somehow die much faster.
  • Make comebacks possible: Introduce a mechanic that makes almost-defeated monsters threatening again, so players cannot be certain of their victory until the very end.

I have opted for a mixed approach that hopefully combines the best of both worlds. Lo an behold:

Last effort: Whenever a character starts a turn, if the majority of characters in their party are bloodied, dying, or dead, that character becomes desperate until the end of the encounter.

(Desperate is a new character condition, defined below)

Desperate: A desperate character gains:

    • A +2 bonus to all attacks
    • A -2 penalty to all defenses
    • For each of the character’s attacks that hits but doesn’t crit, roll 1d20. On a roll of 19-20, the attack becomes a critical hit.

Note that this is mandatory, and applies to both monsters and PCs! The overall effect should amount to a 25% increase in offensive output, and a 15% decrease in survivability (assuming a 65% hit rate). Desperate provides a significant advantage to the losing side, which usually won’t be enough to turn the tide, but should make the last turns much more exciting. It also speeds up the end of combat, particularly when both sides are desperate, and introduces a new layer of strategy by providing an incentive to save up strong attacks for late in an encounter.

This is how our example scenario looks like with both the Monster Commander and Last Effort rules:

That is all for today. In our next installment, we will look at combat pacing and resource usage.


  1. As I mentioned earlier, multi-target attacks really change the math. I mean, the assumption here is focused fire, but one of the two problems you're trying to address-the Grind Zone-is actually affected quite significantly by multi-target attacks. Of course, the flipside is that a multi-target attacker starts dealing less damage once there are no longer multiple enemies to attack.

    I don't think removing multiple target powers from the game is a viable solution, even if it makes the math simpler-but I strongly believe that if you go forwards saying you'll figure out the math of multi-target attacks later, you're ultimately going to end up regretting it. It's the big thing that derailed me, for instance.

  2. For what it's worth, I did quite a bit of work on area attack math a while ago. I posted it on Wizard's CharOp forums, which have traditionally been far too focused on single-target damage. The thread got some interesting discussion, and then died, and my framework never gained any real traction. You can read it here:

    In case you are wondering, I didn't post this on the blog because I considered it excessively theoretical and math-heavy, which is saying something. Anyway. The short version is that it's a really complicated question, but I managed to establish a rough equivalence between single-target damage and area damage (and between area damage attacks with different numbers of targets) based on how they affect the total damage received by a party over the course of a fight (measured, as I usually do, in monster turns). This is useful from a player and charOp point of view in that it helps evaluate area powers against one another and against single-target ones. From a game design standpoint, it's useful for the same reason, and it allows me to calculate the right difference in damage between area and single-target attacks to balance them as best as possible.

    It turns out that none of this is terribly relevant to the simulation model at hand. As far as this model goes, the only things that matter are how much damage each side puts out (normalized as turns to kill an enemy), and how focused it is.

    I am currently studying the very specific (and very useful) case of 100% focused fire. On my last article, I showed an example encounter with completely unfocused fire, which is quite unrealistic, but useful to find the boundaries of our system (as it turns out, 0% focus results in no grind zone whatsoever, which is something to consider). Any real encounter will usually lie somewhere between these known 100% focus and 0% focus scenarios, so the trick will be to find a way to estimate the level of focus fire, and its impact in the combat effectiveness of a party (which will, again, fall between the effectiveness of a party with 100% focus and that of one with 0% focus).

    As far as this model goes, adding area damage increases the total damage outpus of a party (though it also makes it decrease as enemies get killed), and decreases its level of focus fire.

    TLDR: I have thought about the matter, and I plan to fully address it in the future, and I have quite a few ideas on how to do it - though I may need to rework some parts or scrap it altogether, when I get to it. On the other hand, I think there are other topics that need to be covered first, so I may take a while to get there. :)

    1. Sorry if I came off a little defensive there - it wasn't my intention. I definitely appreciate all the feedback and useful discussion, and I've been the first to criticize disregard for area damage in other people's models.

      Now, if only I could bring out these articles at a less glacial pace... I have a ton of ideas and material that I'm dying to show, but I really want to get the theory right first, and explain it, and it takes me forever to write down, even when I have the numbers mostly worked out.

    2. Admittedly, some of your explanations on blaster theory went a little over my head. Let me see if I'm reading this right: You're suggesting that, given the assumption that each encounter has about 4 enemies, Arc Lightning is basically worth 150% percent it's single target damage?

    3. Yep, more or less. It also depends on the number of PCs in a party, but if you have a single wizard in a 5-man party, and he always uses arc lightning or equivalent powers, his contibution to the encounter would be equivalent to that of another character doing single target damage worth 145% the single target damage of Arc Lightning.

      This equivalence is defined in terms of how much damage the party takes before defeating an encounter - overall encounter duration will actually be shorter with area damage, because a blaster is putting out more raw damage, but this is compensated by the fact that each individual monster dies later, due to the reduced focus fire.

      And it gets more complicated. If the whole party is made up of wizards using arc lightning, the equivalence factor rises to 167%, for example. And these results are based on a simulation that repeats the same attacks over an over, so they don't really describe what happens if you mix up, say, arc lightnings and scorching bursts, or whatever.

      The model is not all that easy to understand or use, and it is a rough approximation at best, but I doubt I'll ever get anything much better. Full encounter simulations (which I intend to try, eventually) may achieve higher accuracy, but at the significant cost of becoming even harder to set up and analyze...

  3. I really like the idea of Desesperate.

    If I ever play 4e again, I'll use it

  4. Was enjoying these articles... ever going to publish more?

  5. The next one is almost done, and should be out sometime this week.

  6. The way I've addressed this situation is to add a "break" condition to encounters. If the condition is met, the bad guys surrender, flee, curl into a ball, suicide, whatever. They cease being a threat.

    The default break condition is that team monster be all bloodied or dead, and that team hero has at least one member who isn't. Certain encounters have other conditions - killing a central monster, killing X monsters in one turn, killing a monster with a particular element, etc.

    Each character gets a free skill check at the start of the encounter, that they can use to either as a monster knowledge check, or to try and determine the break condition.

    It's worked so far, but I've only had opportunity to use it a couple of times, as I'm not DMing at the moment.