Point Buy Equivalent Online Notebook

This Jupyter notebook is designed with a simple GUI that allows the user to simulate the results from a random character attribute rolling method. It uses PyPBE as the backend.

Instructions

Running this notebook interactively requires you to install Python 3, the latest version of which can be found here:

https://www.python.org/downloads/

Alternatively, if you're having trouble getting these instructions to work, you may want to download the scientific Anaconda package (preferred, but larger size):

https://www.continuum.io/downloads

Once Python 3 is installed, the following Python modules are also required:

  • ipywidgets
  • jupyter
  • numpy
  • matplotlib
  • seaborn
  • pypbe

The "install.bat" file in this base directory can be used to install these modules automatically using pip (assuming that you are on Windows). Just double-click on the batch file to run it. If you installed Anaconda, most of these are available by default. Otherwise, you can install these modules by opening a command terminal and typing (for each of the six MODULEs above):

pip install MODULE

After those steps are complete, download this notebook to your computer. You can run a Jupyter notebook by typing:

jupyter notebook

in a command terminal, or if you installed Anaconda, open the "Anaconda Navigator" program and click on the "Jupyter" icon. Once the Jupyter notebook interface is open (it should appear in a web browser), navigate to where you downloaded this file, and click on it.

Run the following code by clicking the next "code" cell, then clicking the green arrow ("run") above, and a series of sliders and a button should appear, which allows you to investigate the results from any random character attribute rolling method you desire.

The plots will keep generating every time you click the button (so you can compare results), but you can re-run the cell using the green arrow in order to clear the current plots.


In [2]:
from ipywidgets import *
from pypbe import PBE
import matplotlib.pyplot as plt
%matplotlib inline
system = Dropdown(options=['pf', '3e', '4e', '5e'], value='pf', description='System:')
dice_num = IntSlider(value=3, min=1, max=18, step=1, description='# of Dice')
dice_keep = IntSlider(value=3, min=1, max=18, step=1, description='# Dice to Keep')
dice_type = IntSlider(value=6, min=1, max=18, step=1, description='Dice Type')
dice_add = IntSlider(value=0, min=0, max=18, step=1, description='Add')
att_num = IntSlider(value=6, min=1, max=18, step=1, description='# of Attrs')
att_keep = IntSlider(value=6, min=1, max=18, step=1, description='# Attr to Keep')
arr_num = IntSlider(value=1, min=1, max=18, step=1, description='# of Arrays')
rerolls = IntSlider(value=0, min=0, max=18, step=1, description='Rerolls')
sim = Button(description='Simulate')
def on_button_click(b):
    alg = PBE(dice_num.value, dice_type.value, dice_add.value, att_num.value, 
              arr_num.value, rerolls.value, dice_keep.value, att_keep.value, 
              system.value)
    alg.roll_mc(int(1e5)).plot_histogram()
sim.on_click(on_button_click)
VBox([system, dice_num, dice_keep, dice_type, dice_add, att_num, att_keep, arr_num,
      rerolls, sim])

Explanations of each property:

  • Number of Dice- the number of dice to roll (i.e. this is the "3" in "3d6")
  • Number of Dice to Keep- if you want to roll more dice than you need and then take the best N results. E.g. "Roll 4d6 and drop the lowest roll" would require a "3" here.
  • Dice Type- the type of dice to roll (i.e. six-sided, eight-sided, etc. This is the "6" in "3d6")
  • Add- the value to add to the dice roll. (i.e. this is the "8" in "1d10+8")
  • Number of Attributes- the number of ability scores to generate (e.g. 6)
  • Number of Attributes to Keep- if you want to roll more abilities than you need and then take the best N results. E.g. "Roll 3d6 seven times, and take the best six times" would require a "6" here.
  • Number of Arrays- The number of ability scores arrays that can be chosen from. For instance, 2 arrays might allow the player to choose between [12,10,6,11,15,17] and [6,9,12,18,15,10]
  • Rerolls- Allow dice re-rolling, cumulatively. "0" is no re-rolls, "1" is re-rolling 1s, and "2" is re-rolling 1s and 2s, and so on.