For this installment of my Game Balance series, I decided to examine Point Buy systems and compare them to scores from randomly generated dice rolls. (See the caveats at the bottom for how scores less than those on point buy tables were treated.)
I generated 100,000 sets of ability scores and calculated their point buy equivalents for 3.5e D&D, 4e D&D, and for Pathfinder. The results I found are presented in the table below.
|Pathfinder||D&D 3.5||D&D 4|
|High Power Points||20||28||NA|
|4d6, drop one||19.48||29.11||21.89|
|reference||p. 16 PCRB||p. 169 DMG||p. 17 PHB|
I decided to play with the dice rolling program I showed off last week some more. Game balance has been an interest of mine for many years; since I first made character classes for my Elruse campaign world. One of the most basic factors of game balance, as anyone who has agonized over character creation can tell you, is the set of ability scores you have for your character. This weeks bonus code is a snippet from what I used to generate the graphs in the Game Balance, Ability Scores article.
For this I used Monte Carlo simulation, which is just a way to say that I wrote a function that rolled the dice many, many times. In this case I rolled the dice 10,000 times to generate the samples for each ability score generation method.
Today I cleaned up and refactored some code I wrote for rolling RPG style dice a few weeks ago. So far this is especially for games in the D&D/Pathefinder/D20 pantheon.
The main work horse is the following few lines.
def die(x, y=1):
"""Roll a die with 'x' sides 'y' times"""
results = 
for i in range(y):
The function is fairly basic, it takes a number of sides, and a number of dice (defaulted to 1) and returns a list of the results.
I've been looking for a way to encourage myself to spend more time learning Python and writing code and decided corerulebook.com was the perfect excuse.
I'm still new to Python, having started in August, with the excellent Learn Python the Hard Way.
My first public, self-written piece of code will be a set of dice rolling functions. As I learn better coding practices and more advanced techniques I will be writing new code (or rewriting old code) that does things with an role-playing game theme.
Keep watching, the intersection of learning to program with one of my favorite hobbies should be lots of fun.