# How would optional re-rolling of all hit dice on leveling up affect average hp?

I am considering a homebrew rule that would give players the option on leveling up to re-roll all of their hit dice (excluding their first level) instead of only rolling their new hit die when determining their maximum hit points.

For example a Wizard has +0 CON. When they reach level 2 they roll a 2 on their new hit die and so have a maximum hp of 8. When they reach level 3 they can choose to either just roll their new hit die to get between 9 and 13 maximum hit points, or they can roll both their new hit die and their level 2 hit die to get between 8 and 18 maximum hit points.

I have been trying to figure out how this option would affect average hp outcomes at different levels but I only play with probabilities as a hobby so I am having issues with the math once it gets to higher levels.

How would allowing players to re-roll all hit dice when leveling up affect average hp, assuming that players will always re-roll if their former max hp was below average?

I am aware that this homebrew creates the possibility that a character would lose health on leveling up. Such an event would not be fun but I am not too worried because players with a lower risk threshold would likely not re-roll when their hp is just slightly below average. In addition if someone ends up with less hp one level they will likely experience greater gains the next level.

• I think the outcome is going to greatly depend on something you didn't clearly specify; does "allowing the player to reroll all hit hit dice" mean allowing them to reroll any hit die (so that they could choose just one bad roll at one level), or does it mean if they reroll any they have to reroll all? Your context seems to indicate the latter, but it would be good to emphasize that is what you mean.
– Kirt
Jan 29 at 17:47

## About the same as taking the rounded up average, better early, worse later. Favors larger hit dice

When I'm trying to analyse a process which I can clearly describe as an alogrithm, but I'm having a hard time constructing the statistics I like to use Monte Carlo. The basic idea is to have a function which does the thing (using a digital die, ie. a pseudorandom number generator), run it many times recording the output, and then analysing that data as experimental results. That means the data will include some noise, we use high numbers to reduce that.

Using the python code at the end of the answer, we get the simulated result of 100000 characters with a d8 hit die and con mod of 0 levelling from 1 to 20 using the proposed houserule. Note that the last column is something else, we'll get back to that.

Omitting the 1st level as it's always static, and the 2nd level which will on average be the same, we get a slight increase over the average for just rolled. At 3rd level it is about 1 (average of 18 opposed to 17), but at level 20 it is only about 9.3 better. So while the initial expected increase is 5.5 going to 3rd level, it dips below 5 (the standard average levelling on a d8) when going to 10th.

But another possibility of this method is the ability to roll lower than your previous hit point total. Therefore, I also included a tracking of that, specifically how many times that happened (that last column in the code output). It averages to a 28.4% chance over the course of levelling from 1 to 20. That obviously includes some characters experiencing it twice or more (5 was the highest in my run), but doesn't include rolling the same hit point total as you had.

Running the same for the other (PC) hit dice sizes gives the tabulated values. Of note that d12 goes down to the rounded up average by 20th level, but would (slightly) more often experience a loss of hit points.

Value d6 d8 d10 d12
Avg at 20th level 79.4 102.8 126.2 149.6
Avg vanilla roll 72.5 93.5 114.5 135.5
Vanilla rounded avg 82.0 103 124.0 145.0
Gain at 3rd level 4.2 5.5 6.7 8.0
Gain at 20th level 3.8 4.8 5.9 7.0
Chance of decrease 24.9% 28.4% 31.0% 32.0%

When diving into what level the decreases happen using a slightly different version of the function in the code, we find them biased towards Tier II and to odd levels. I would assume the latter to be an artefact of the .5 in dice's average compared to the integer results.

The y-axis is count of levels with a decrease out of 100000 runs for that die size.

import sys
import random

def d(n):
return random.randint(1, n)

def rollNd(N, n):
return list(map(d, [n]*N))

def rollhitpoints(die, con, f):
decCounter = 0
hp = die
for level in range(2, 21):
ohp = hp
if hp < die + (die + 1)/2*(level-2) + con*level:
hp = die + sum(rollNd(level-1, die)) + con*level
if ohp > hp:
decCounter += 1
else:
hp += d(die) + con
f.write(str(hp)+'\t')
f.write(str(decCounter)+'\n')

def rollnormalhitpoints(die, con, f):
hp = die
for level in range(2, 21):
hp += d(die) + con
f.write(str(hp)+'\t')
f.write('\n')

IterCount = 100000
f = open('output/odohitpoints.txt', 'w+')
for i in range(IterCount):
rollhitpoints(8, 0, f)
f.close()


## In theory, not much. In practice, even less

For an easy way to estimate the value of a dice you can reroll, you replace each re-rollable value with the average of the dice. For example, the result of a 1d8, reroll if under 5, is the average of [4.5, 4.5, 4.5, 4.5, 5, 6, 7, 8], which is 5.5. As you can see, it's not a major improvement (only by 1 for each dice) - of course you can reroll it again at later levels, but here is where we come into the 'in practice part'.

For one, you wouldn't reroll if your score was above the average of 4.5 per dice, since odds are you'd end up worse. And you would be rerolling any good scores you previously had. On top of that, you only ever get to do this once per level, so averages won't matter nearly as much as the very random results this will produce.

After all, don't forget that this gives you the unique chance for a character to, upon leveling up, lose considerable amounts of hit points from a bad roll - something that would be extremely unfun to experience as a player.

In summary, I think this option would ultimately be a trap for your players, which would actively harm their enjoyment of the game.

• FWIW, while the "reroll only if below average" rule is optimal for maximizing the average HP at your current level, it's not necessarily so in the long term. For an extreme example, if you only cared about what your HP will be at level 20, it'd be better to reroll very aggressively during, say, levels 2–15 and hope for a great roll; after all, if you roll badly, you can always reroll at the next level-up. (What I haven't determined is the actual optimal reroll threshold for each level; it might make a decent question for our Mathematics sister site.) Jan 29 at 2:03
• @Odo: My calculations suggest otherwise. I don't claim that the "Strategy B" in the linked code is optimal, but it does seem to outperform "reroll if below average". But maybe I've made a mistake somewhere? (Yes, I know I'm ignoring CON modifiers, but those shouldn't really have much if any effect here.) Jan 29 at 17:31