Friday, February 26, 2010

Hit points of 4E monsters (part 2).

Let's look at the hit points of low level 4E monsters again.

From a previous post, the hit points of some favorite generic low level monsters are:

Kobold: 24, 27, 36 (level 1-2)
Goblin: 25, 29, 31 (level 1-2)

Let's assume a level 1 player with an at-will power using a weapon which does d8 damage, and the player's primary combat stat has a mod of +4. Hence the damage the player does with each hit is d8+4. The minimum damage per hit is 5 and the maximum damage per hit is 12. The low and upper limits for total damage done by more than one hit is:

1 hit: 5 -> 12
2 hits: 10 -> 24
3 hits: 15 -> 36
4 hits: 20 -> 48
5 hits: 25 -> 60
6 hits: 30 -> 72

The generic kobold or goblin is dead at minimum after 2 or 3 hits, and definitely dead after more than 5 or 6 hits.

To make things more precise, one can examine the probability of the total damage killing a monster after a number of hits. Let's look at the goblin with 29 hit points, using an online dice calculator. The results are:

3 hits: prob(total damage >= 29) = 23.44%
4 hits: prob(total damage >= 29) = 88.01%
5 hits: prob(total damage >= 29) = 99.83%


At a slightly higher level, the hit points of some generic monsters are:

Orc: 46 (level 3)
Hobgoblin: 39, 47 (level 3)
Skeleton: 45 (level 3)
Lycanthrope: 48 (level 3)
Doppelganger: 45 (level 3)

For our player now at level 3 with the same at-will power with a weapon doing d8 damage, the primary combat stat mod is +4 and maybe the weapon is now magic with a +1 bonus to damage. The damage per hit is d8+5. The lower and upper limits for total damage for more than one hit are:

1 hit: 6 -> 13
2 hits: 12 -> 26
3 hits: 18 -> 39
4 hits: 24 -> 52
5 hits: 30 -> 65
6 hits: 36 -> 78
7 hits: 42 -> 91
8 hits: 48 -> 104

It requires a minimum of 3 or 4 hits to kill a generic level 3 or 4 monster, while they're definitely dead after 8 or more hits.

Doing the same exercise using the online dice calculator for a generic orc with 46 hit points, we get:

4 hits: prob(total damage >= 46) = 5.13%
5 hits: prob(total damage >= 46) = 64.77%
6 hits: prob(total damage >= 46) = 98.11%


At a slightly more higher level, the hit points of some generic monsters are:

Beetle: 88 (level 8)
Behemoth: 82 (level 7)
Boar: 85 (level 6)
Troglodyte: 69, 74, 93 (level 6-8)
Zombie: 71, 88 (level 6-8)
Spider: 80 (level 7)
Shadar-Kai: 77, 86 (level 7-8)
Satyr: 80, 86 (level 7-8)
Ogre: 91 (level 8)
Foulspawn: 86, 87 (level 8)
Succubus: 90 (level 9)

For our player now at level 8 with the same at-will power with a weapon doing d8 damage, the primary combat stat mod is +5 (+1 from enough stat increases) and maybe the weapon is now magic with a +2 bonus to damage. The damage per hit is d8+7. The lower and upper limits for total damage for each hit are:

1 hit: 8 -> 15
2 hits: 16 -> 30
3 hits: 24 -> 45
4 hits: 32 -> 60
5 hits: 40 -> 75
6 hits: 48 -> 90
7 hits: 56 -> 105
8 hits: 64 -> 120
9 hits: 72 -> 135
10 hits: 80 -> 150
11 hits: 88 -> 165
12 hits: 96 -> 180

It requires a minimum of 6 or 7 hits to kill a generic level 7 or 8 monster, while they're definitely dead after 12 or more hits.

Doing the same exercise using the online dice calculator for a generic stayr with 80 hit points, we get:

7 hits: prob(total damage >= 80) = 56.41%
8 hits: prob(total damage >= 80) = 97.38%
9 hits: prob(total damage >= 80) = 98.64%

As one can see from these calculations, the number of hits using only at-will powers with d8 damage (with assumptions from magic bonuses and stat increases), goes from 5 hits to kill level 1-2 monsters, to 6 hits to kill level 3-4 monsters, to 8 hits to kill level 7-8 monsters. (The number of hits are from the first greater than 95% probability of total damage killing a monster, from the online dice calculator).

With the players having more daily powers at higher levels, in principle it should reduce the number of hits it takes to kill such higher level monsters. These calculations will be the subject of a future post.

Thursday, February 25, 2010

Hit points of monsters in pre-4E editions.

In older editions of D&D and AD&D, the monsters' hit points was typically the number of d8's rolled and a constant number added sometimes. (We'll ignore the constant number added for simplicity).

For X hit dice, the average number of hit points is:

X avg(d8) = 4.5X (*)

Recall the monster hit point formula from a previous post:

N avg(D)

where N is the number of hits it takes to kill a monster, and avg(D) is the average amount of damage a player does per attack.

In an easy example where a player's weapon does 1d8 damage per attack, the monster hit point formula is:

N avg(1d8) = 4.5N (**)

Equating the average number of hit points from (*) and (**), we get N = X. This means that without any improvements in weapons, it takes on average X hits to kill a monster with X hit dice.

For low level monsters with 1 hit die or less, they basically function like minions which die after one hit. Monsters with 2 hit dice, on average have to be hit twice to kill. (Etc ...)

Let's examine how magic bonuses to damage changes things. The formula N for the number of hits to kill a monster, in general is:

N = 4.5X/avg(D)

For different magic weapon bonuses to damage, for a weapon which normally does d8 damage, we have:

D = d8, avg (d8) = 4.5 -> N = X
D = d8 + 1, avg (d8+1) = 5.5 -> N= 0.82 X
D = d8 + 2, avg (d8+2) = 6.5 -> N= 0.69 X
D = d8 + 3, avg (d8+3) = 7.5 -> N= 0.60 X
D = d8 + 4, avg (d8+4) = 8.5 -> N = 0.53 X
D = d8 + 5, avg (d8+5) = 9.5 -> N = 0.47 X

It takes at least around a +4 or +5 magic weapon bonus to damage, to halve the average number of hits to kill a monster.

Hit points of generic 4E monsters. (part 1)

Continuing from the previous post, let's examine the monster hit point formula:

N avg (D)

where N is the number of hits it takes to kill a monster, and avg (D) is the average damage done by a player per attack.

In 4E, a player can max out their primary combat stat such that it has a stat adjustment of +4 or +5 to attacks and damage. The damage dice is anywhere from a d4 (ie. dagger) to a d12 (ie. greataxe) or 2d6 (ie. maul, heavy flail). Many weapons and magic attacks typically have damage dice of d6 or d8 for at-will powers.

Let's take an example of a player with a primary stat adjustment of +4 for combat attacks and damage, along with d6 damage dice. For such a level 1 player attacking a monster, the average damage per attack would be avg(d6 + 4) = 7.5.

If we want a monster to die after being hit a number of times, the hit points should be:

- 6 hits -> 6(7.5) = 45 hit points
- 5 hits -> 5(7.5) = 37 hit points
- 4 hits -> 4(7.5) = 30 hit points
- 3 hits -> 3(7.5) = 22 hit points

In the case of where the player's damage dice is d8, the average damage per attack would be avg(d8 + 4) = 8.5.

If we want a monster to die after being hit a number of times, the hit points should be:

- 6 hits -> 6(8.5) = 51 hit points
- 5 hits -> 5(8.5) = 42 hit points
- 4 hits -> 4(8.5) = 34 hit points
- 3 hits -> 3(8.5) = 25 hit points

Looking through the 4E Monster Manual, various low level generic monsters have hit points:

Kobold: 24, 27, 36, 42 (level 1-4)
Goblin: 25, 29, 31 (level 1-2)
Hobgoblin: 39, 47 (level 3)
Orc: 46, 64 (level 3-5)
Halfling: 22, 34 (level 1-2)
Human: 37, 42, 47 (level 2-4)
Wolf: 38, 67 (level 2-5)
Wraith: 37 (level 5)
Skeleton: 45, 53 (level 3-5)
Lizardfolk: 50, 54 (level 4-5)
Lycanthrope: 48 (level 3)
Rat: 36, 38 (level 1-2)
Zombie: 40, 46, 54 (level 3-4)
Elf: 32, 39 (level 2)
Gnoll: 50 (level 5)
Gnome: 34, 46 (level 2-3)
Doppelganger: 45 (level 3)
Drake: 29, 38, 40, 48, 77 (level 1-5)

A number of monsters at level 1 or 2 fit into the range of 3 or 4 hit kills, by players with weapons which do d6+4 or d8+4 damage for their at-will powers.

How many hit points should a monster have?

In an older WotC article by David Noonan, it is suggestive that monsters last around 5 rounds. How exactly this is implemented, the article does not state precisely.

Perhaps this "5 rounds" means the number of times it takes to hit a monster, before it is killed by the players?

To investigate this question, we need to recall a few things.

Recall
that the average number of attacks it takes to hit a monster N times is N/p, where p is the probability of hitting a monster.

Also recall that the average amount of damage done by one attack is p avg(D), where D is the damage dice (ie. such as 1d6+2) and p is the probability of hitting a monster. (avg(D) is the expectation value of D).

If a monster dies after being hit N times, it will take on average N/p attacks to kill it. So on average the number of hit points it should have, is the average number of attacks multiplied by the average amount of damage done by each attack. Assuming each attack is done by the same player with the same weapon on the same monster, the number of hit points the monster should have is:

(N/p)(p avg(D)) = N avg(D)

Interesting that the number of monster hit points in this scenario, is independent of the probability to hit the monster. N avg(D) is only dependent on the number of hits a monster will take before dying, and the average damage done by the player.

Average value of a fair die.

Just for completeness, we will show why the average value of a fair dX die is (X+1)/2.

A fair dX die will have X sides with the numbers 1,2, ... to X, which have an equal likelihood of being rolled. Hence the probability of rolling any number is 1/X.

The average value is the sum of the die side values weighted by the probabilities of being rolled. Mathematically, for example the average value for d4 is:

1(1/4) + 2(1/4) + 3(1/4) + 4(1/4) = (1+2+3+4)/4

while for a d6, the average value is:

1(1/6) + 2(1/6) + 3(/16) + 4(1/6) + 5(1/6) + 6(1/6) = (1+2+3+4+5+6)/6

In general, the average value for a fair dX die is:

1(1/X) + 2(1/X) + ... + (X-1)/X + X/X = [1+2+...+(X-1)+X]/X

Recall from high school algebra, the sum of the first n numbers 1, 2, ..., n-1, n is: n(n+1)/2. (This can be shown to be true for any n by mathematical induction).

So for the average value of dX, we get: [X(X+1)/2]/X = (X+1)/2

Average damage.

We will examine the average amount of damage when a player attacks a target (ie. monster).

The easiest way to look at average damage, is to examine the expectation value of the damage rolled.

We start off with a probability p of hitting a target, and rolling D amount of damage for a hit. (D is just a placeholder to represent dice damage, such as 1d6+2).

As a concrete example, let's look at an example where the damage is 1d4 and the probability of hitting is p. (We will ignore critical success and failures).

With probability p of hitting, the possible damage from rolling 1d4 is: 1, 2, 3, and 4 for which each of these damage values have a probability of 1/4. So mathematically, the expectation value of the damage is:

p[1(1/4) + 2 (1/4) + 3(1/4) + 4(1/4)] + (1-p)(0)

which after simplifying is: p[avg(1d4)] = p 2.5

The first term is when the attack hits, while the second term (1-p)(0) is when the attack misses.

Recall that the average value of a single d4 die is avg(1d4) = [1(1/4)+2(1/4)+3(1/4)+4(1/4)] = 2.5. In general, the average value of a single fair die dX is avg(dX) = (X+1)/2. (ie. A single fair die dX has X sides, with numbers 1, 2, ..., X on them, with a probability of 1/X of rolling any number from 1 to X).

To bring this example one step up, let's examine the previous concrete example for two attacks. The probability of hitting a target is still p, and the damage is still 1d4.

The expectation value of the damage of these two attacks is:

p^2 [avg(1d4 +1 d4)] + p(1-p)[avg(1d4)] + (1-p)p[avg(1d4)] + (1-p)^2 (0)

The first term is when both attacks hit, while the second and third terms is when one attacks hits while the other misses. The fourth term is when both attacks miss.

Doing some algebra and noticing that since the 1d4's are independently rolled, avg(1d4+1d4) = avg(1d4) + avg(1d4), we get: 2p avg(1d4) for the average damage done by two attacks.

(In more detail, the values of the total damage done by 1d4 in the first attack and another 1d4 in the second attack: are 2, 3, 4, 5, 6, 7, 8 with probabilities

1/16 for 2 damage
2/16 for 3 damage
3/16 for 4 damage
4/16 for 5 damage
3/16 for 6 damage
2/16 for 7 damage
1/16 for 8 damage.

The average total damage value of two d4 rolls is:

2(1/16) + 3(2/16) + 4(3/16) + 5(4/16) + 6(3/16) + 7 (2/16) + 8(1/16)

which gives: 5 = 2.5 + 2.5

One can do a similar exercise and show that for doing three d4 rolls for damage, the average total damage will be 7.5 = 2.5 + 2.5 + 2.5).

If one has the patience, once can show that for three attacks the average damage done by the three attacks is: 3p avg(1d4).

More generally, if individual attacks have different to-hit probabilities of p1, p2, ..., pN and their respective damage dice rolls are D1, D2, ..., DN, one can show using mathematical induction that the average damage done by these N attacks in sequential order from 1 to N is:

p1 avg(D1) + p2 avg(D2) + ... + pN avg(DN)

(To show this, one uses avg(D1 + D2 + ... + DN) = avg(D1) + avg(D2) + ... + avg(DN) since the damage dice rolls are independent of one another).

Friday, February 12, 2010

Examining average number of attacks more closely.

We examine the result from the last post.

With a probability p of hitting a monster, the average number of attacks it takes to hit is 1/p.

On a d20 (with the mods backed out), the probability of rolling greater than or equal a particular number is:

10 = 55%
11 = 50%
12 = 45%
13 = 40%
14 = 35%
15 = 30%
16 = 25%
17 = 20%
18 = 15%
19 = 10%
20 = 5%

Examining this more closely, we have 1/p for various probabilities p:

prob = 55%, average number of attacks = 1.82
prob = 50%, average number of attacks = 2
prob = 45%, average number of attacks = 2.22
prob = 40%, average number of attacks = 2.5
prob = 35%, average number of attacks = 2.86
prob = 30%, average number of attacks = 3.33
prob = 25%, average number of attacks = 4
prob = 20%, average number of attacks = 5
prob = 15%, average number of attacks = 6.67
prob = 10%, average number of attacks = 10
prob = 5%, average number of attacks = 20

As the probability to hit gets smaller than 25% (ie. greater than 16 on a d20), the average number of attacks it takes to hit such a monster goes up considerably. To minimize combat from becoming too frustrating, it would be optimal to keep the probability to hit in the range of 25% to 50% which would correspond to the range 11 to 16 on a d20. (Less than 10 would be too easy). As one may have experienced, requiring a minimum roll of 18 or 19 to hit a monster can be very frustrating.

From the 4E DMG, the generic monsters typically have minimum defenses which scale as 12+level. So even for level 1 players fighting level 1 monsters, AC/fortitude/reflex/will are at least 13. A minion may only require an 11 or 12 to hit.

Number of attacks to hit

We will examine the number of attacks it takes on average to hit a target monster.

Assuming a probability p of hitting a monster, the probability of missing is 1-p.

The probability of hitting on the first attack = p.

The probability of missing on the first attack, but hitting on the second attack = p(1-p).

The probability of missing on the first two attacks, but hitting on the third attack = p(1-p)^2 .

In general, the probability of missing on the first k-1 attacks, and hitting on the kth attack is: p(1-p)^(k-1) .

To determine the average number of attacks to finally hit a target monster, we take the expectation value of the number of attacks:

sum{k=1, infinity} k p(1-p)^(k-1)

which gives the answer 1/p. (This is using the infinite series 1/(1-x)^2 = 1 + 2x + 3x^2 + 4x^3 + 5x^4 + ...).

With some more work, the variance can be calculated to be (1-p)/p^2.

This probability distribution is better known as the geometric distribution.

http://en.wikipedia.org/wiki/Geometric_distribution

More generally, the problem can be generalized to the case of the average number of times it takes to hit a monster N times. Without going through all the math, one could guess and formally show that the average number of attacks it takes to hit a monster N times is N/p.

In conclusion. With probability p of hitting a monster, the average number of attacks it takes to hit a monster once is 1/p. More generally, the average number of attacks it takes to hit a monster N times is N/p.

Thursday, February 11, 2010

Pattern of the combat to-hit modifier in 4E

One of my posts on enworld dissecting the 4E to-hit modifier.

http://www.enworld.org/forum/5061101-post14.html


Let's look at the pattern of to-hit roll modifier:

[level/2] + stat mod + magic enhancement = to-hit mod

starting with a minmaxed primary stat of 18 at level 1 (ie. stat mod of +4).

The magic enhancement follows the assumed pattern from page 225 from the 4E PHB:

level 1-5, enhancement = +1
level 6-10, enhancement = +2
level 11-15, enhancement = +3
level 16-20, enhancement = +4
level 21-25, enhancement = +5
level 26-30, enhancement = +6

The stat boosts are assumed to be added to the player's primary stat with enough stat boosts at levels 8, 14, 21, and 28, to affect the primary stat mod.

(stat mod = +4)
level 1, to-hit mod = +5
level 2-3, to-hit mod = +6
level 4-5, to-hit mod = +7
level 6-7, to-hit mod = +9

(stat mod = +5)
level 8-9, to-hit mod = +11
level 10, to-hit mod = +12
level 11, to-hit mod = +13
level 12-13, to-hit mod = +14

(stat mod = +6)
level 14-15, to-hit mod = +16
level 16-17, to-hit mod = +18
level 18-19, to-hit mod = +19
level 20, to-hit mod = +20

(stat mod = +7)
level 21, to-hit mod = +22
level 22-23, to-hit mod = +23
level 24-25, to-hit mod = +24
level 26-27, to-hit mod = +26

(stat mod = +8)
level 28-29, to-hit mod = +28
level 30-31, to-hit mod = +29

As an approximation, a possible replacement for [level/2] + stat mod + enhancement = to-hit mod

to-hit mod = level + 3, at heroic tiers of levels 1 to 10
to-hit mod = level + 2, at paragon tiers of levels 11 to 20
to-hit mod = level, at epic tiers of levels 21 to 30.

Not quite a single formula.

Looking at the patterns, I wonder whether it would be easier to just use a to-hit mod = +level, and changing the assumptions of the monsters and skills accordingly to acommodate this. The enhancement bonus of magic weapons for the to-hit and damage, could be stripped out with only the magical properties remaining which may be triggered by critical successes (or something else).

More generally, these approximate to-hit mod equations for a primary stat mod differing from +4 are:

to-hit mod = level + 3 + (primary_stat_mod - 4), at heroic tiers of levels 1 to 10

to-hit mod = level + 2 + (primary_stat_mod - 4) , at paragon tiers of levels 11 to 20

to-hit mod = level + (primary_stat_mod - 4), at epic tiers of levels 21 to 30.

First Post.

First post.

Will attempt to dissect the mechanics in various rpgs.