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.
Read More......

Wednesday, September 5, 2012

Game Design: Basic combat math (I)

Having stated my high level goals for the new game, it’s time to get my hands dirty and do some actual design work. The first point in the agenda, then, is the mathematical framework of the combat system. Easy enough.

I believe that game combat should, by default, favor the player characters while still providing a credible challenge, last long enough for heroes to use most of their toys, and minimize dead turns or turns where a player is left without interesting choices to make. To address these points, we need to pay special attention any factors that affect encounter duration, power usage, and the balance of power between player characters and monsters. Overall, the work process will have the following steps:

  1. Set general goals for the combat system

  2. Define game stats for a fixed-level scenario

  3. Define stats for scenarios with characters of arbitrary levels

  4. Test a lot

  5. Iterate previous steps until satisfied.

Today’s article will focus on the first step, meaning that we won’t be assigning any concrete values to character stats. Instead, we will talk in terms of combat length, number of participating characters, and number of turns it takes to kill a character. We will start by assuming generic stat lines for characters and monsters, leaving the effect of roles and customization for later.

Introduction: Encounter duration and focus fire

With this in mind, let us define the main concepts used in this approach:

  • K (Turns to kill) - The number of game turns that a character A takes, on average, to kill a character B. It depends on A’s accuracy and damage, and on B’s defenses and hit points, among other factors. To calculate it, divide a defender’s HP by the attacker’s average damage.

  • T (Encounter turns) - The number of game turns required to end a combat encounter, on average. It depends on the number of characters on each side, and their K value (i.e. the turns they take to kill each other). Our initial analysis will focus on pure damage only, and more complex effects like negative conditions will be considered later.

A major point that needs to be taken into account is that, except for some specific scenarios, K is not equal to T. That is, the actual encounter duration is different (more specifically, longer) than what one would expect, based on analysis of isolated characters. To understand this, let us first take a look at those scenarios where K is, in fact equal to T.

Consider a combat encounter where Joe the Hero (character H1) faces Gork the Orc (monster M1). For simplicity, let’s assume that both character and monster have 3 hit points, and their attacks occur simultaneously, always hitting for 1 damage. Clearly, in this scenario both combatants would always achieve mutual annihilation by turn 3. The K value of our characters, 3, is equal to the encounter duration. If we extended this basic scenario to have three heroes (H1, H2, H3) facing three monsters (M1, M2, M3), all with the same stats and using the same rules as before, and assuming all combatants have some strange code of honor forcing them to fight one on one, we end up with three pairs of duelists that self-destruct on the third turn of combat.

However, this weird duel behavior is not how combats usually go. The most effective tactic, and thus the one that most parties resort to, is to focus fire, i.e., to have all characters in a team pile on a single unfortunate opponent until he drops, and repeat the process until the combat is over. The tactic advantage of focus fire is that, once an enemy drops, the damage output of the enemy team decreases. If we go back to the example scenario, and have both teams use focus fire, we will have a fight where each side gradually loses combatants, as shown in the following figure.

Two things of note here:

  • As the combat progresses, it takes longer to kill an enemy

  • The combat ends in 5 turns, even though all characters have a K value of 3.

As we can see, the existence of focus fire has an impact on combat duration. This effect will vary with the number of characters in an encounter, and their relative strength. Another important implication is that combat duration cannot be easily determined through simple formulas, but will require some kind of simulation - though we will try to simplify this requirement as much as possible. Finally, it must be noted that the use of focus fire is not a binary proposition: these examples show characters first spreading their damage as much as possible, and then perfectly focusing their attacks, but real combats usually fall somewhere in between. The ability to focus fire better than the opponent is, in fact, a critical factor for success in a tactical combat game like the one we are proposing.

System Requirements

The combat system will need to meet the following requirements:

  • Average combat duration of 5 turns. When both sides are of similar level, I expect the combat to be over in about 5 turns, so that players can spend most of their per-encounter resources without falling into repetitive grinding. This duration may rise to about 6 turns for greedy parties refusing to spend daily resources, or go as low as 4 turns (or slightly below that) if the heroes go all out on daily attacks and action points.

  • The players win... with some effort. Player characters are expected to win same-level encounters, but not without losing a bunch of healing surges and daily powers along the way. Ideally, it will take 20-25% of a party’s daily resources to make it through an encounter - with generous usage of daily powers saving healing surges, and vice versa. Player characters dropping unconscious during combat should be a common occurrence, with about 1-2 KO’d PCs each encounter. Death of individual characters (outside of party wipes) should be rare, but still possible when unconscious party members are left unprotected.

  • Every turn counts. It’s easy to fall into the trap of having the last couple of turns in a fight become an unexciting cleanup routine. This happens when the monster team has been reduced to one or two members, unable to pose a real danger to the heroes, but with enough hit points left to require a significant amount of time to actually finish the encounter. We need to include mechanics that make monsters both more threatening and quick to kill once they are in this situation.

In the next article, we will provide a more detailed look at the numbers and stats behind our combat system, discuss the impact of combat roles, and introduce a few rules changes that should make the last rounds of combat a bit more exciting.

Read More......