Dice Roller | NextGen RPG

Dice Roller

17 replies [Last post]
Imajica
Imajica's picture
Offline
Joined: 01/06/2009

So what features do people want from their online dice roller? Does anyone have a good one we can steal gratefully use on this site? Anyone have a Drupal module that'll do the trick?

There are some pretty good ones out there - The dice engine here http://www.rpgobjects.com/index.php?c=orpg is pretty comprehensive allowing you to specify how many of what type of dice, take highest(x) dice (or lowest). But it's written in python rather than the nice php-ajax combination that would be required to work here with Drupal.

At the other end of the scale there's this simple script:

What dice type? How many dice to roll?

3 Sided

4 Sided

5 Sided

6 Sided

8 Sided

10 Sided

12 Sided

20 Sided

30 Sided

100 Sided

1

2

3

4

5

6

7

8

9

10

Free JavaScripts provided
by The JavaScript Source

The only drawbacks to this one are that it doesn't show what dice rolled what scores, it can't handle +x/-x modifiers and it can't do clever things like drop lowest die.  Oh, yes.  And it doesn't seem to work in this text box.  But I'm sure if it was put into its own block, it'd work.  The script is here: http://javascript.internet.com/games/dice-roller.html

I'm up for writing a dice roller - once my Drupal module development books arrive - but I'd need to know what features people want from it!

Fire away

Comments

Captain Bunty
Captain Bunty's picture
Offline
Joined: 12/25/2008
For Hero games (and maybe

For Hero games (and maybe others) I believe you need to know the number rolled on each die, and not just the total.

Imajica
Imajica's picture
Offline
Joined: 01/06/2009
Thought that might be the

Thought that might be the case. So... How does this sound for a feature list:

  • Specify how many of what type of dice to roll. E.g. 3d6, 5d20, 9d17, etc.
  • Give the values of the individual dice rolled and the sum of the dice rolled
  • Add/subtract modifiers (E.g. 3d6+1, 5d20-3)
  • Chain different dice together (E.g. 3d6.4d20.1d12+2 where the '.' means "add the results of this roll to the next one")
  • Clever tricks. E.g. Take Highest (# dice), drop lowest (4d6DL(1) would roll 4d6 and drop lowest die, 5d10TH(3) would roll 5d10 and return the values of the highest 3). That sort of thing
  • Chain the tricks together so you've practically got a dice programming language! (And I'll put an example here once I can think of one
  • Dice systems for other games. E.g. 5U would roll 5 dice Ubiquity-style. I'd need some examples for other dice systems. Got Spirit of the Century somewhere, so that would cover Fate...

And that's pretty much in order of priority as once the basic roll-and-display is in place, everything else is just bells and whistles to make people's lives easier.

Comments? Anything I've missed?

sinanju
sinanju's picture
Offline
Joined: 12/28/2008
Well, if we're talking about

Well, if we're talking about coding a dice roller for special cases, how about an option for dice that produce -1, 0 or +1 (per die)? Then I could use "Fudge dice" if I ever wanted to do something on-site using the Fudge game sytem.

Captain Bunty
Captain Bunty's picture
Offline
Joined: 12/25/2008
Synchronicity: I was just

Synchronicity: I was just reading about the fate system this morning. Spirit of the Century sounds awesome and someone needs to start a game statBig smile

Admin
Admin's picture
Offline
Joined: 12/23/2008
My favorite die roller is

My favorite die roller is http://dicelog.com/dice

I just like it because it shows me the pretty dice.  I'll be happy with anything that works though.  AND, I love the idea of customizing it for certain gaming systems, like Ubiquity and such.  

...and maybe even, being able to create our own 'popular rolls', like for hero, I always need a 3d6 for attacking.  - but so not a big deal if we can't.

Admin
Admin's picture
Offline
Joined: 12/23/2008
Captain Bunty

Captain Bunty wrote:
Synchronicity: I was just reading about the fate system this morning. Spirit of the Century sounds awesome and someone needs to start a game statBig smile

Yes, oddly enough, Spirit of the Century seems to be the random phrase of the day.  I'd never heard of it till today...  I guess that's what happens after a reveiw at rpg.net.  

Imajica
Imajica's picture
Offline
Joined: 01/06/2009
Those pretty pictures are

Those pretty pictures are rather nice. I'd never seen a d24 before! It's also got a few nifty commands there that I hadn't thought of - roll again on max value, re-roll 1s, that sort of thing. Stuff to add to the wishlist of features.

Where on the site are you wanting to put the roller? - left sidebar? Keep it open in a new tab? If you're thinking of keeping it for a separate tab, I'd bow to the experts who have already written something excellent like the dicelog one you've linked. Otherwise, I'll write something to go in a small sidebar block that could show on book and blog pages below the navigation menu (or above it, since it would probably be more useful there).

Imajica
Imajica's picture
Offline
Joined: 01/06/2009
OK, I'll write the dice

OK, I'll write the dice roller so that it will show as a separate page with full instructions from under the "My Tools" menu link and also as a streamlined block above book and blog pages so that you can resolve rolls whilst you're writing.

Imajica
Imajica's picture
Offline
Joined: 01/06/2009
sinanju wrote:Well, if we're

sinanju wrote:
Well, if we're talking about coding a dice roller for special cases, how about an option for dice that produce -1, 0 or +1 (per die)? Then I could use "Fudge dice" if I ever wanted to do something on-site using the Fudge game sytem.

Done. I'll include that. Looking at some other system-specific ones as well:

  • Storyteller - only roll D10, don't return the total of the roll. Maybe highlight 1s and 10s. Can't remember - do you re-roll 10s?
  • Ubiquity - just return 0 or 1. Then the total is the number of successes rolled.
  • Fudge- as above!
  • Fate (Spirit of the Century, Starblazer Adventures)

Any other systems people want?

Imajica
Imajica's picture
Offline
Joined: 01/06/2009
So far... Handle basic

So far...

  1. Handle basic rolls. 3d6, 14d10, 1d20, that sort of thing. - DONE
  2. Handle modifiers. 3d6+1, 1d20-5. - DONE
  3. Error checking!!!! Validate input format!!!
  4. Hold the results in an array and sort them into ascending numerical order.
  5. Handle re-rolls: r = reroll ones once. R = reroll onces until you don't get a one.
  6. Keep highest x, discard lowest x - k for keep, d for discard.
  7. Chain things together - join things with a "." - 4d6+1rd1.1d20.4d10 etc. etc.
  8. Common rolls - things that people use a lot. 4d6, reroll ones, discard lowest for AD&D stats (is it still done that way? Last time I created a character it was for AD&D2E)
  9. System-specific settings. Storyteller (d10s only, don't show total). Ubiquity (0 or 1 results only). Fate (+1, 0 or -1 returned for each die, does Fate need the total?)

I've put the prototype into the left-hand-sidebar for you to have a poke around with. It's right down at the bottom. Feedback requested... I'll post here with an update when I've sorted some of the other features.

Admin
Admin's picture
Offline
Joined: 12/23/2008
oh...wow. Didn't expect to

oh...wow. Didn't expect to have a die roller to play with yet.

Just for fun- I rolled 11d6 (a common attack value in TCQ) and got. 3,1,1,1,3,5,1,4,1,1,1 = 22

I do believe that my players would lynch me for that *grin*.

I'll play with it more, for sure, so far I haven't seen any issues.

As far as other gaming systems... I don't really know much about the mechanics. D20 hops to mind, but it seems like that's straight up rolling, nothing fancy. ...but that's someone else's expertise.

And I loved that style chip counter that you did once upon a time as well. --but we can get to that later, cuz that was set to game and player permissions. ...but I love the idea of system specific utilities. Certainly not priorities though...just babbling in my fever crazed state.

Admin
Admin's picture
Offline
Joined: 12/23/2008
Imajica Joined:
Joined: 01/06/2009
User offline. Last seen 6 hours 55 min ago.
Captain Bunty wrote:
China wrote:
* Get Sign-ups working and Test them - Subscriptions are working now, or seem to be. Available in the Control Panel under the subscriptions tab, if anyone would like to help us test them.
 
John, is this set up to your satisfaction? Can I start testing and tweaking? :Big smile:
 
You should be good to go on this one.
 
I knocked up a couple of views last night (before I spotted the "Active Forum Topics" one. One that shows the most recent 5 forum topics, the other that showed the most recent 5 forum comments (i.e. replies to topics). Once Panels hits a fairly stable release, these could sit side-by-side in a little block at the top of the main forum page. Until then, they could sit one on top of the other. Take a look at them in the list of views. Might do what you want...
 
Sorry, not been able to get much done today other than work on the code for the dice roller. Should be able to crack on on Monday...

Admin
Admin's picture
Offline
Joined: 12/23/2008
We had to restore the

We had to restore the database, cuz I messed something up.  Anyways, I saved out the forum posts, and copied them back in.  I apologize for the horrid formatting, AND for screwing up in general.  

Imajica
Imajica's picture
Offline
Joined: 01/06/2009
OK, I've updated the roller.

OK, I've updated the roller.  As you can see, it now handles FUDGE, Storyteller and Ubiquity alongside the normal "just roll the dice" approach.

It also does re-rolls. 3d6r will re-roll a 1 once, 3d6R will re-roll until you don't get a 1.

Yet to do...

  • Tweak the Storyteller one to give the total number of successes, deal with botches, that sort of thing. Need to spend some more time inside the World of Darkness core for that one.
  • Write a proper instructions page for it to go in the FAQ section of the site
  • Sort out "keep highest x"/"discard lowest x"

Anyone got any other suggestions?

Admin
Admin's picture
Offline
Joined: 12/23/2008
Imajica wrote: Anyone got

Imajica wrote:

Anyone got any other suggestions?

Not that I can think of gaming system wise.

Can we make the 'roll' function activate on enter?  Just curious, no biggy if we can't.  Smile

Pretty cool stuffs Imajica.

SDTroll
SDTroll's picture
Offline
Joined: 01/01/2009
Just out of curiosity, would

Just out of curiosity, would it be possible to get one that counts the body for a hero system damage roll (1=0, 2-5=1, 6=2)?  Not vital, since it shows each die, but fun if it wasn't too big a deal

Chairman
Chairman's picture
Offline
Joined: 12/24/2008
SDTroll wrote:Just out of

SDTroll wrote:
Just out of curiosity, would it be possible to get one that counts the body for a hero system damage roll (1=0, 2-5=1, 6=2)?  Not vital, since it shows each die, but fun if it wasn't too big a deal

Neat suggestion!

Imajiiiii---caaaaa?!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.