Don't get me started
If a Goblin attacks, it can roll 0, 1 or 2 skulls.
If the hero defends, the end result can be 0, 1 or 2 Body Points damage. That's a "damage series".
The exact problem statement was a collaboration between me and Count Mohawk; the solution was all Count Mohawks idea. Whereupon I built up a little bit.
1. Both damage series (hero and monster) are put in a matrix.
2. If the hero does 0 damage, the goblin does his damage series. If the hero does more damage, the first goblin does no damage - but if there are more monsters in the room, then maybe the next monster does it's series. The number of monsters who are allowed "to do their series" depends on the room geometry and place of fighting.
3. Repeat until no monsters are left. (ok, this is a bit inaccurate, but...
)
4. Count the number of body points that the hero has lost in every possible future.
5. Multiply the number of lost BP with the probability for this future. There are quite a lot of different futures, that's why it is a matrix and not a single value.
6. Add all possible future damages together: This is the number of Body Points the Hero will lose in this room. This is two numbers, mean and variance.
7. Repeat for every room, assuming the hero survives all rooms.
8. Add the results
Here you are, the results for one hero if he fights, room for room, the monsters in a certain order.
Now we made an intellectual exercise to apply that same method for entire hero groups (the result will be different, surprise, less monsters survive
).
9. Substract potions of healings from the damage, add traps (50% if they are findable, 100% if they are not findable because a monster is standing behind).
10. Compare with base game quests where "The Trial" is too hard and "The Rescue of Sir Ragnar " is too easy; assume that the middle between the two is perfect.
11. Repeat the simulation with lots of different equipment levels. Find out which hero group lands closest to the "ideal"
Today it includes the special rules for diagonal and ranged weapons, defense or attack on any number of dice sides, using any colored dice you like, using "Master" or "Guardian" defense from the expansions. Other than heroes, mercenaries will die during the simulation.
Which hero is how likely to be in the middle of a fight ja important, too(Barbarian more, Wizard less) and last but not least, including an estimation how many heroes and monsters may attack each round (which also
changes each round depending on the outcome matrix)
So no, it is not based solely on average. It has become quite sophisticated over time.
I can upload the code to GitHub if you are interested.