Spielerando

Armor takes off damage but every hit still does at least one: the real average

Subtracting armor from a random damage roll and never going below a minimum makes the average hit larger than the simple subtraction suggests, so strong armor is worth less than it looks. This shows how to compute the true average and how many hits it takes to fall.

Why this works

A floor cuts off the bottom of the spread, so the weak hits are lifted up and the average rises above the plain difference. Armor is therefore worth less and less as it grows, until the floor alone decides every hit.

When not to use it

Skip it when damage is large compared to armor, since the floor then almost never applies and a plain subtraction is close enough. Also skip it in games where armor should make players immune to weak hits, which needs a floor of zero.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 44 lines of example code with 5 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Armor takes off damage but every hit still does at least one: the real average" (read_entry armor-floor-expected-damage) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP