Tag Archives: Dice Roller

New Dice Roller Updates

At the request of my cousin, I recently added the ability to roll the narrative dice from Fantasy Flight’s Edge of the Empire system to my dice roller.  After putting this off for quite a while, I sat down and powered through it over the course of a couple of evenings.  As expected, the hard part was really getting the iconography together, organized, and displayed in a way that looked good, while the plugin system I developed for my dice roller really made the coding very easy. Continue reading New Dice Roller Updates

Dice Roller Updates

Since I’ve been working on unifying my website, I decided that I would take some time to update some of the other sections of my site while I was at it. The first thing that I wanted to work on was my dice roller – this is probably some of the oldest working perl code that I have, and it shows. It has some fairly obvious security flaws, an inflexible persistence model, and is lacking some options I’ve wanted for a while.

So, I’ve decided to update the code. Since it’s less than 150 lines of code, it should be easy to rewrite from scratch, so that’s my initial plan. Here is my feature list, in priority order:

  1. Rewrite the rolling engine:
    1. Strip the CGI parameter for id – I don’t have a use case for multiple dice rollers anymore.
    2. Sanitize input.
    3. Update storage model for rolls.  (Used Storable)
  2. Rewrite the display engine:
    1. Strip the template parameter – This is a security hole and I don’t have a use case for it anymore.
    2. Sanitize output.
    3. Find a better way to import templates.  (used HTML::Template)
  3. Do better session management
    1. Keep the user’s options so they don’t have to retype them every time.
    2. Explore cookies or CGI sessions for this.  (Used CGI::Session and cookies)
  4. Unify my Gaussian dice roller via options rather than a separate script.
  5. Provide options for counting dice over a threshold (like World of Darkness “successes”).
  6. Provide options for getting the total value of the dice (lots of games do this).
  7. Explore output filters
    1. Name
    2. Game name?
  8. Provide options for glyph dice (Star Wars).
  9. Provide options for exploding dice.

And, as it turns out, it took me longer to write this post than it did to update.  Here it is!