Jump to content
Valucre added to a new directory! Read more... ×
Sign in to follow this  

Site dice roller

Recommended Posts

I took the site down for a little while earlier today (announced on the Valucre Twitter) so that I could take a database backup. This was to have a good backup because I was on the verge of installing a new plugin and wanted to make sure it didn't mess the site up

Plugin installed successfully. As you may have guessed from the title the plugin is a dice roller! After years of wanting to integrate dice rolls into the site, for the first time a developer made a plugin roller available for the IPS software just last month. Super nice

At the moment I have to set pre-defined ranges and then it rolls a dice for each range every post. So I've only set two ranges, a d10 and a d20. It rolls the dice outside of the post content so they can't be edited

He's continuing development on it so we will hopefully get new features, like selecting which dice to roll, but it works for now. If there are any questions post a topic in Help with the support template that's pinned there

To use it head on over to the water cooler dice rolling thread

Edited by supernal

Share this post

Link to post
Share on other sites

Although no one's seriously complained about the roller in terms of raising an issue with admin, as someone that uses rolls heaviy myself and that enjoys using them in tabletop games, I wanted to pass on what I knew about the "randomness" of the die roller on the site

I spoke to the developer of the plugin and he indicated that the randomness is generated by calling PHP's rand function, which you can read about here: https://secure.php.net/manual/en/function.rand.php

Reading through it a few things that stand out is that the function is "pseudo-random" and that it isn't "cryptographically secure"

Pseudorandom means that a sequence "exhibits statistical randomness while being generated by an entirely deterministic causal process". To generate actually random numbers isn't easy, and is why random.org is so popular. RAND is a linear congruential generator and represents "one of the oldest and best-known pseudorandom number generator algorithms"


To clarify, my understanding of the implementation is that a mathematician wouldn't be able to predict the rolls used by pseudorandom functions without the information that feeds that sequence, which ostensibly no user should have. I don't believe there's anyone on the forum that's "cracking the code" or that the rolls generated now are unreliable or predictable

That said, in the next instance of the plugin the developer is planning to use mt_rand, which generates numbers using Mersene Twister. MT is "by far the most widely used general-purpose PRNG"

You can read more about mt_rand here: https://secure.php.net/manual/en/function.mt-rand.php
And mersenne twister here: https://en.wikipedia.org/wiki/Mersenne_Twister

ok that's it

Edited by supernal

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.