29/02/2012 @15:45:18 ^18:06:32
When to pick up the green armour
A chronic dilemma for Doom players. If I have some amount of blue armour less than 100, I can pick up a green armour to get it up to 100. But green armour is less effective and I will take more damage. How do I know when to pick up the green armour?
Stop faffing about and tell me the answer already
Pick up the green armour if your health is at least twice your amount of blue armour.
With that out of the way:
The Damage Formula
Picking up the green armour will have some benefit if I can take a larger amount of damage with it than I could by remaining with the blue armour. So we need a formula for the amount of total damage you can take.
From P_DamageMobj - I won't bother to quote the code here - we observe that armour absorbs a fraction of damage taken, with the remainder taken from your health, until it runs out. For green armour the fraction is ⅓ and for blue it is ½. Call this fraction the armour's efficiency; it should be obvious it is limited to values between 0 and 1.
In other words a player with health H and armour A of efficiency e taking damage d will lose ed armour and (1-e)d health.
Now we have two cases to consider. Firstly, consider the high armour case, where ed < A, so the armour doesn't run out. In this case the player has lost (1-e)d health. If that kills him we know that
d >= H/(1-e)
Now suppose that ed > A so that the armour runs out. An incoming damage of A/e is enough to completely remove the player's armour, and gives a corresponding health loss of (1-e)(A/e). That is, the player has H - (1-e)(A-e) health remaining. If the damage is high enough to cover that as well, the player is dead. Therefore
d >= A/e + H - (1-e)(A/e) = A/e - A/e + eA/e + H = eA/e + H = A + H
Therefore it follows that the minimum damage to kill the player is given by
d = min { A + H, H/(1-e) }
This is the Damage Formula. It gives the amount of damage you can take with health H and armour A of efficiency e, or in other words, your effective health.
The way I remember this in words: your armour adds on to your health, up to a maximum of some multiple of your health. (This multiple is 1½ for green armour and 2 for blue armour.)
A% Blue Armour v. 100% Green Armour
|------|--|---------|- H
0 A 100 200
Consider a player with health H. Let b be the total damage he can take wearing A% blue armour and g be the total damage he can take wearing 100% green armour. Note A < 100 else you wouldn't be able to pick the green armour up at all. Anyway, by the damage formula:
b = min { A+H, 2H }, and
g = min { 100+H, 3H/2 }
and we want to know when g > b. Now
b = A+H iff A+H < 2H iff A < H,
that is
b = A+H when A < H
b = 2H when A > H
If A = H both expressions equal the same thing, as you'd expect. Also
g = 100+H iff 100+H < 3H/2 iff 100 < H/2 iff 200 < H
and since H <= 200 (this is the maximum health of a player) we can assume
g = 3H/2.
We have two cases. Firstly, when H < A, g = 3H/2 and b = 2H. Here b > g for any value of health where the player is still alive. So if your health is less than your armour, don't touch the green armour, it'll just make you more vulnerable.
And the more interesting case, when H > A, g = 3H/2 and b = A+H. We have that
3H/2 > A+H iff H/2 > A iff H > 2A
And that's the result we wanted. Don't touch the green armour unless your health is at least twice your amount of blue armour.
The End
Well, almost. There is inaccuracy due to rounding error which means the split of a damage d does not precisely fall into ed armour loss and (1-e)d health loss; the error always deducts more from health so you tend to lose health slightly faster than you should.
For example if you have 200% health and 200% blue armour you should be able to take 400 points of damage but in practice it's a bit less because all the odd damages take one more point of health than armour. In an extreme case you could take 200 one-point damages and die with 200% armour intact!
Thanks to:
Icarus MAP25, in which the green armour next to the blue key memorably presented the dilemma to me one hot night in June 1999. I've refined this a lot since then. For example it took years for it to occur to me to factor out the concept of armour efficiency, which made the derivation of the damage formula twice as long and repetitive.
My old friend and fellow ex-maths student Amy who, once, years ago, I made proof-read a LaTeX version of this document. I have more or less lost contact with her in recent years. Perhaps this explains why.
Whoever it was on Doomworld who, after I posted the rule a couple of weeks ago, had never heard of it and wanted to know if there was a derivation. Well, there is now!
See also Math Time! which presents the green armour condition, among other things, as a series of in-game arithmetic puzzles. It's worth doing.
I wonder if this would make a good Doom Wiki article...