More Fun With Coding: Dice, Spreadsheets, and Macros

in #gaming5 years ago

image.png
pxfuel.com

Here's one for all my D&D pals out there. This programming experiment has to do with rolling your HP when you level.

The Introduction

What house rules do you employ for HP? The standard rules are:

  • roll your hit die (original method, health gain of 1 to max roll on hit die, random, don't roll a 1!)
  • half your hit die plus one (newer streamlined method, guaranteed same health gain each level, no risk)

Some people took the newer, set values method as the most fair and balanced way to do it, while others feel it adds more depth to the game to have to live with whatever the dice say. Well if you're in the latter category, odds are you're gonna come across that time when you roll a 1 for your new hp. This isn't too terrible at higher levels, but at the beginning when your health is less than 10, adding only 1 can actually be deadly.

One house rule I heard to help was to count all rolls of 1 as if they were 2s. That way you'll never get only 1 health.

The Challenge

Well, just recently a friend, fellow gamer, and current DM (Dungeon Master) came up with a new idea he calls the "FateMax" system. Upon leveling at some point of your choosing, fate smiles upon you and you get max health for that level. This is to be employed in tandem with the 1 = 2 method mentioned earlier except once you use the FateMax effect, all future 1s rolled stay as 1s. No more converting them to 2s. All your old ones stay put though.

I wasn't sure how effective of a method this would be, so I decided to write some code! Would it be better to use FateMax, or just stick with rolling and changing all 1s to 2s? Or would you be better off playing it safe and going with the assigned value every level? And if FateMax is better, which level gets you the best effect?

The Process

There were plenty of numbers to calculate and tables to be drawn, so I decided Excel/VBA would be the way to go. So first I needed to generate 19 random dice rolls (at level 1 you start with max health) and assign them to our two roll methods. Note: in Excel, a rand() call will generate a new number every time the sheet is edited, so the random column on the right won't match with the other columns on the page. Don't worry. For best accuracy, I made sure our two test subjects (1 = 2 and FateMax) always get the same roll sets. We will also only use the eight-sided die (d8) for this test.

dice rolls

Right off the bat, this test showed a couple things. FateMax is slightly better overall, and a terrible roll set will set you way behind the slow-and-steady half+1 easy method. Also note I applied FateMax upon reaching level 2.

But that's not enough information to go by. Maybe this was so terrible a roll that it's unlikely to ever come up. Let's instead run this 100 times to get better averages over the long haul.

We can automate the copying of all the cells to speed this along like so:

automate copy

Then change all the 1s to 2s on one column and only up to the FateMax level on the other column:

image.png

And here we can compile the data to make some results. Things like highest HP, greatest spread between the two, and the average spread.

getting data

And the result is this box.
trends and such

Now let's do that for each level so we can see how FateMax differs from either other method. Things get a little cluttered in this view, but here are all the stats for the value of spending your FateMax on any level.

The Result

the whole shebang

Here you can see that FateMax wins nearly all the time when used at any level. The least winning of them in this batch of rolls is level 3 with only 61% wins vs the 1 = 2 method. The average hp difference between these two is between 2 and 3.5 with the spread trending upward the later you use it. So these two methods are pretty close to one another, having only about 3 apart.

When you take into account the half + 1 standard method, you will have a flat HP of 103 when you reach level 20. With FateMax, the highest rolled was 114 gaining an extra 11 HP over the base. However, the lowest FateMax roll was 64, a whopping 39 below the base.

It looks like any rolling method is a gamble with minimal rewards when compared to the half + 1 standard method. Based on this test, you're better off just taking the average roll at half + 1 and not risking all the loss. However, if that's not an option, the FateMax method just might get you a slight edge on everyone else.

Coin Marketplace

STEEM 0.20
TRX 0.25
JST 0.038
BTC 96483.87
ETH 3356.14
USDT 1.00
SBD 3.20