Showing posts with label evolution. Show all posts
Showing posts with label evolution. Show all posts

Saturday, July 12, 2014

Of Orcs and Probability


In the last post, I addressed what in the comments section I called a "category error"—wrongly imputing the existence in the fantasy world of a unit of measurement in the game mechanic that existed only in our world. There are no hit points in the fantasy world, nor are there abilities such as Strength or Constitution, nor +1 modifiers to magic swords, nor players, GM's or potato chips. But there are genes (probably), creatures that are strong or have a sturdy constitution, magic swords of varying utility (some of which talk back to you), player-characters (as opposed to players), gods (sort of like GM's but easier to sweet talk) and almost certainly potatoes. Mixing categories, or mixing up worlds leads to all sorts of errors. Constructing a theory of evolution in the fantasy world based on hit points is a bit like basing it on potato chips.

But I want to leave that point for now. For the fun of it, let's assume that hit points do have a real existence in the fantasy world, like genes perhaps. And thus we can now go along with constructing a kind of evolutionary theory that might show how a community of, say, Orcs has its low hit point members gradually (or not so gradually) weeded out through fighting. There's no question that they would be weeded out eventually, of course, but it might be fun and interesting to track how the process would occur.

The initial set-up was specified in this blog post. You start with 100 one hit die Orcs with an average spread of 1-8 hit points—12.5 would have 1 hit point, 12.5 would have 2 hit points, and so on. They fight three rounds against a similar group of Orcs. Each Orc has an Armor Class of 6 and carries a spear that does 1-6 points of damage. At the end of this, how many Orcs would survive? Perhaps more interestingly, what proportion of each hit point group of Orcs would survive? And how would this change the overall spread of the different hit point groups?
The claim was made that:

From the final count, if we presume that any of these humanoids we're meeting have been in only 3 rounds of combat, only 1 in 100 humanoids should have 1 hit point.  Only 13% should have 3 or less. Nearly half, 45%, should have either 7 or 8 hit points.  More than three quarters, 77%, should have 5 or more.

This is because:

Trying to get my math right here.  The numbers are based on the chances of being hit once plus the chance of being hit twice and the chance of being hit three times, multiplied by the chance of any of those hits killing the humanoid.  The humanoid's attacks are not considered - only the chance of a humanoid with an armor class of 6 surviving three spear attacks during a given combat.

Actually, he didn’t get his math right.

That’s okay, we all make mistakes, and I owe a debt to that blogger for giving me an interesting puzzle in probability to occupy myself for an hour or so after the kids had gone to sleep.

The easiest way of seeing part of it is to focus on the weakest group—the 1 hit point Orcs. All they need is one successful hit against them and they go down. You don’t need to figure out the chances of, say, one hit versus two hits occurring, or how much expected damage might or might not be done with each strike. Rather, it’s quite simple: One hit and you’re dead.

What are the odds that you’ll be hit? Well, flip it—what are the odd’s you won’t be hit? Every round there’s a 60% chance you won’t be hit (1-12 is a miss, 13-20 is a hit). Thus, the odds for surviving three rounds are 60% x 60% x 60%, or roughly 22%. That roughly tracks this blog post’s leading graphic, above. 4 Orcs would reduced to 1.  12.5 Orcs would be reduced to 2.7. However, asking how many 1 hit point Orcs would remain out of 100 survivors has to take into account that many of the other stronger Orcs would also have fallen. As we shall see later, it comes to about 50%. So out of 100 surviving Orcs (imagine you started with 200), there would be 2.7 x 2, or roughly five 1 hit point guys still standing. So the proportion of the wimpiest would have been reduced from 12.5% to 5%. It’s a tough world. But not quite as tough or tough so quickly on the 1 hit point Orcs as was originally claimed. The answer after three rounds is not 1 in 100 but more like 5 in 100.

Quick digression: the original blogger pegged the to hit chances at 35% not 40%. Every early edition of D&D that I’ve seen, from the original 1974 version to the 1e Players Handbook, to Moldvay/Cook has one hit die monsters hitting AC 6 opponents on a 13. So why 35%? Most likely, the blogger made the same mistake that I sometimes make in my head: 13 to hit means a probability to hit of (20-13)/20, right? Wrong. Don’t forget to count the 13. The correct formula is 20 minus the highest roll to miss (12) not the lowest roll to hit (13). Or if you prefer, you can also just add 1 to the numerator. But pegging the chances at 40% rather than 35% actually kills the weaker Orcs quicker. If the chances to hit had only been 35%, then 27% or 3.4 (as opposed to 2.7) would have survived.

Moving on to computing the survival odds for all Orcs, I’m not going to explicitly go through the whole thing, but here’s a sketch:


1. The first thing to do is break down the odds for any Orc in a three round battle being hit 0 times vs. 1 time vs. 2 times vs. 3 times. You can represent it like this:

Permutation
1st round
2nd round
3rd round
# of hits
Probability






1
miss (60%)
miss (60%)
miss (60%)
0
21.6%
2
miss (60%)
miss (60%)
hit (40%)
1
14.4%
3
miss (60%)
hit (40%)
miss (60%)
1
14.4%
4
miss (60%)
hit (40%)
hit (40%)
2
9.6%
5
hit (40%)
miss (60%)
miss (60%)
1
14.4%
6
hit (40%)
miss (60%)
hit (40%)
2
9.6%
7
hit (40%)
hit (40%)
miss (60%)
2
9.6%
8
hit (40%)
hit (40%)
hit (40%)
3
6.4%

This gives totals of:

Chance of 0 hits
21.6%
Chance of 1 hit
43.2%
Chance of 2 hits
28.8%
Chance of 3 hits
6.4%

So, now, without doing any more calculations, we can also see why 7 and 8 hit point Orcs make out so well in the original blogger’s example. Since the maximum damage is 6 hits, an Orc with 7 or 8 hit points must be hit at least two times to be killed (and even then there’s a good chance he won’t be killed). But there’s only about a one-third chance this will happen. Why, in the original example, all the Orcs are fighting with spears as opposed to doing standard damage of 1-8, or using some of the better weapons assigned to Orcs in, say, the Monster Manual is a good question. But it shows up an interesting and almost paradoxical pattern. The less effective the weapons the worse the wimpier Orcs will fare relative to their 7 or 8 hit point comrades. The evolutionary process would happen quicker if Orc armies wielded daggers. Conversely, if the Orcs were all wielding two-handed swords or halberds, the proportions of surviving wimpy Orcs versus surviving strong Orcs would be less pronounced. Even doing the calculations with weapons that did 1-8 points of damage (as opposed to those spears doing only 1-6) would smooth things out on the survival curve (as opposed to the discontinuous break in the original example that separates the 7 hit point and 8 hit point Orcs out from the rest).

2. Now compute the expected damage chances for 1 hit, 2 hits and 3 hits. Here, we’re actually in familiar territory as we’re simply calculating the odds for achieving various totals using 1d6, 2d6 and 3d6. Many OD&D players almost carry those odds around in their heads.

3. Next multiply the two together in all the possible cases. I used an Excel spreadsheet, and again I won’t go though the details, but the final expected survival numbers after 3 rounds of battle are given on this table.

1 hp
2 hp
3 hp
4 hp
5 hp
6 hp
7 hp
8 hp
2.7
3.6
4.6
5.7
6.9
8.2
9.6
10.2

That gives the expected number of survivors as 51.5 out of a starting group of 100.

That’s actually an interesting number. It shows that for one hit die or 1st levelish creatures with moderate armor, if you (as a low level character) fight them for three rounds, you are likely to have reduced their numbers by about half. That’s another morale break point, I think. Low level OD&D combats shouldn’t last very long.

We can rewrite the results using percentages (by dividing the results by 51.5%). Drop the %’s and you have the number of Orcs in each hit point category out of 100 surviving ones:

1 hp
2 hp
3 hp
4 hp
5 hp
6 hp
7 hp
8 hp
5.2%
7.0%
8.9%
11.1%
13.4%
15.9%
18.6%
19.8%

These numbers are closer to those of the original blogger at the high ends (though not at the low ends), though they are still not quite as pronounced.  So replace

Only 13% should have 3 or less. Nearly half, 45%, should have either 7 or 8 hit points.  More than three quarters, 77%, should have 5 or more.

With

Only 21% should have 3 or less. Over a third, 38%, should have either 7 or 8 hit points.  More than two thirds, 68%, should have 5 or more.

Keep in mind, though, that raising the to hit chances to 40% helps the original blogger’s case. The numbers would be even more off if we had stayed with 35%.

Finally, you can rerun the numbers using the new proportions—5.2, 7.0 etc. vs. 12.5, 12.5, etc.—to find results if the surviving Orcs decide to fight additional three round battles. Sure enough, if you fight enough three round battles—3 actually—the wimpy 1 hit point Orcs will be reduced to that magic 1 in 100 number.
  

# Battles
1 hp
2 hp
3 hp
4 hp
5 hp
6 hp
7 hp
8 hp
1
5.2%
7.0%
8.9%
11.1%
13.4%
15.9%
18.6%
19.8%
2
1.9%
3.4%
5.5%
8.4%
12.4%
17.5%
23.9%
27.0%
3
0.6%
1.5%
3.1%
5.8%
10.4%
17.4%
27.9%
33.5%


But these numbers are quite different from those originally claimed:


hp
surviving after three battles


1
1 in 11,248 (!!! -ed.)
2
1 in 252
3
1 in 46
4
1 in 15
5
1 in 6
6
1 in 3
7
4 in 7
8
2 in 3

Again, see here.

Extra credit: instead of computing probability formulas, you can simulate Orc battles using the RANDBETWEEN and IF functions of Excel.

For the first to hit roll on a d20 it’s a1=RANDBETWEEN (1,20), then to compute damage you go b1=IF(a1>=13, RANDBETWEEN (1,6), 0). Do that three times and then add the “damage cells” to determine whether you have a kill. If f2 is the number of starting hit points, then the formula is =IF((b2+d2+e2)>=f2, 1, 0) where 1 is a kill and 0 is a survival. Of course starting hit points can be determined by =RANDBETWEEN(1,8). Or one can simply start out with 12 or 13 in each category. For successive battles featuring survivors, you can use a more complicated RANDBETWEEN or even RAND function using the new proportions.

If anyone has ever done something like this in Excel, you know that once you have the formulas set up, you just have to touch a random non-used cell (or fill it in) to simulate another battle and thus get a different result. It takes less than a second.

Probability can be weird. On only my fifth battle I had a situation where the 1 hit point Orcs actually survived in greater numbers than the 8 hit point Orcs.

More power to them!

Final note: I could of course have made all sorts or errors. If any readers would like to try their hand at identifying them, I would of course be interested and not offended. But please, no four-letter words, Alexis.

Wednesday, July 9, 2014

Of Orcs and Evolution




Recently another blogger put forth the claim that monsters with only one hit die should generally be assigned 7 or 8 hit points, as opposed to the standard range of 1-8 generated by rolling for them. (Obviously we're assuming the  eight-sided die standard of Greyhawk and AD&D as opposed to the six-sided standard of Monsters & Treasure, but the same sort of considerations would be applicable in the latter case.) Essentially the argument is an evolutionary one-that for any community of one-hit die creatures where its members lead dangerous and violent lives, creatures with fewer than 7-8 hit points would inexorably be weeded out by a sort of social-darwinian process. I'm calling it "social-darwinian" as opposed to "darwinian" partly to stress that the argument has nothing to do with reproductive chances (though I suppose one could add that consideration to it if one chose) but rather simply looks at what would happen to the same group of, say, Orcs over a period of time in which they fought a set of battles containing multiple attack rounds. Probability analysis shows that after a relatively small number of combat rounds, the overwhelming majority of surviving Orcs would be those that started out with 7 or 8 hit points. So the typical Orc from a tribe that did a lot of fighting would presumably be one of those Orcs. The Orcs with fewer hit points would have already fallen off the treadmill, so to speak, in this tough and unforgiving world.

If you're like me, you probably find the conclusion annoying, though it may not be clear precisely what if anything is wrong with the actual argument. Various commentators on that blog and elsewhere proposed various "solutions"-maybe low hit point Orcs are actually high hit point Orcs that are just having a bad day, perhaps the low hit point Orcs have just come from another fight, etc. J.D. Jarvis at Aeons & Augauries has a series of three quite useful posts ending here where he considers the issue from a number of angles.

In my view, the original argument is perhaps valid. But it is certainly unsound. This is because one of the premises is false. Which premise is that?


I'll say in a moment. But to first digress slightly: When various theories of evolution were proposed by Darwin, Huxley, Spencer and others in the late 19th century, some felt that while evolution in some form was probably true, it was imprudent to, so to speak, make too big a deal of it, especially to the scientifically untrained "masses". Darwinian evolution had the potential (so went the argument) to shatter people's most cherished beliefs.


So to get back to that false premise. I'm going to say something that arguably may shatter one of the most cherished beliefs of many OD&D players (I'm sort of kidding, of course). Or at least it may appear to attack a key metaphysical pillar of the game. Just to be careful, I'm going to whisper it. Here goes:


Hit points don't exist.

"What was that? What? I didn't quite catch that. Could you really have said what I think you said?" Okay, I'm going to whisper it again:


Hit points don't exist.

Now, it's important to understand that I'm not making the claim that because we are talking about a fantasy game, nothing in the game really exists. No. That would be an extremely trivial and thus silly claim. Within the context of the fantasy world referenced by the game (which is what we're of course referring to when debating theories of Orcian evolution) all sorts of things exist. For example, Orcs exist. Orc lungs and muscles exist. Orc brains (such as they are) exist. In Orcs and most other humanoid creatures, fast-twitch muscle fibers (for better sprinting and other short energy bursts) exist, as do slow-twitch muscle fibers (for better endurance). And if the deep anatomy and biology of our fantasy world is remotely similar to ours, then even Orc genes exist.


But hit points do not exist. The point is not that that they do not exist because they are abstractions (although they certainly are abstractions) but that they are abstractions whose only purpose is to help resolve combats and similar dangerous situations that involve players. They have no meaning and indeed no reality beyond that. "Offstage", hit points have no reality. None.


So, while you are and your group are exploring that dungeon, it's true that there are all sorts of violent episodes raging in that same fantasy world-from minor one-on-one muggings to vast battles involving multiple armies. And, yes, creatures are dying and being killed (and surviving and killing), probably in very large quantities. But in any particular case, that creature going to its creaturely reward is doing so not because "its hit points have been reduced to zero", but because it had its head cut off or was stabbed in the heart, or (to use a different level of analysis) it didn't have enough fast-twitch muscles or the right selection of useful Orc genes, or whatever.


So, I have no problem going along with some theory of Orcian evolution that posits the weeding out of wimpy Orcs (though that would seem to be sort of self-evident, and why anyone would want to spend more than a few seconds pondering such a theory is beyond me). No doubt evolution in the somewhat more civilized human communities of our fantasy world would have a tendency to weed out people that aren't attractive to the opposite sex, or aren't very good at sucking up to the Man, or whatever. But if there is any evolution going on, it has nothing to do with hit points.


Moving outside and above the fantasy world to the level of game playing, the standard implication of OD&D that when fighting one-hit die creatures there will be an average spread of hit points from 1-8 is perfectly reasonable given the assumptions of the combat resolution mechanism, in the same way that "hits" doing an average spread of 1-6 points of damage is perfectly reasonable. The combination is just a way of creating a satisfying and interesting set of possibilities influenced by multiple levels of randomness, not an attempt to construct a realistic combat system based on identifying hit points as some essential physical or metaphysical feature of Orcs, humanoids, monsters or anything else.


That really would be silly.