Help support TMP


"RANDOM NUMBER GENERATOR" Topic


21 Posts

All members in good standing are free to post here. Opinions expressed here are solely those of the posters, and have not been cleared with nor are they endorsed by The Miniatures Page.

Remember that you can Stifle members so that you don't have to read their posts.

For more information, see the TMP FAQ.


Back to the Computer Stuff Plus Board

Back to the Technical Stuff Plus Board


Areas of Interest

General

Featured Hobby News Article


Featured Link


Featured Ruleset


Featured Profile Article

Those Blasted Trees

How do you depict "shattered forest" on the tabletop?


Featured Book Review


580 hits since 30 Apr 2008
©1994-2026 Bill Armintrout
Comments or corrections?

Tim Thomas27 Dec 2007 9:27 a.m. PST

I am looking for either a calculator or software that will have a random number generator in lieu of dice rolls. Anyone know of anything. I'm writing a solo campaign and would like to have a computer moderated element to it.

Steve Hazuka27 Dec 2007 9:30 a.m. PST

I've downloaded several in the past. Google computer die roller and you'll find them. There are hundreds of them/

Devil Dice27 Dec 2007 10:08 a.m. PST

Somewhere I have a calculator sized thingy I got from Gamescience . I don't know if they are still available.

BRUTALPAUL27 Dec 2007 10:40 a.m. PST

I like to use this one, which has all kind of dice:
link

Lentulus27 Dec 2007 12:08 p.m. PST

"a computer moderated element to it"

If you have a computer available, the rand function of most spreadsheets (including open office, reasonably stable and free) should do the job. Excel even has a RANDBETWEEN function perfectly suited to be a dice roller.

Ric Raynor27 Dec 2007 1:07 p.m. PST

If you have a TI calculator laying around, you can also use it to generate random numbers. I use this from time to time when dice rolling is impossible or would make too much noise.

Mark Plant27 Dec 2007 2:37 p.m. PST

I use Excel. The advantage is that I get to keep the results and output them straight away -- such as when generating unit values.

Also I can set it to produce different rolls in different columns -- including complicated rolls ones like taking the highest two of three d6 rolls.

GuruDave27 Dec 2007 2:57 p.m. PST

True random number generators are hard to come by, since computers never do anything "at random." Most APPEAR random to the casual observer, but statistical analysis of a large enough sample size will show that certain numbers, or sequences of numbers, occur more frequently than others.

In computer hardware, it is necessary to sample and amplify "random" occurences in nature, such as thermal noise in a diode. Very few processors bother to include such hardware.

thatotherguy27 Dec 2007 5:06 p.m. PST

GuruDave,

As a former code monkey; computer "random" functions use a "seed" value, usually the system clock and then pass them through a series of algorithms. You can approach random with a sophisticated enough series of algorithms. Never actually random.

Chris Wimbrow27 Dec 2007 5:38 p.m. PST

When a program seeded with the host processor time of day is compiled, is this a one time setting of the random number generator or does it update at each request for a new "roll" during run time?

If not reseeded in run time, would this make an interpreted language like old BASIC varieties more random, based on the vagaries of when the wetware chooses to make an input?

Mark Plant27 Dec 2007 11:55 p.m. PST

We're not cryptologists: good pseudorandom is easily good enough for gamers. (MSExcel specifically goes over this in the help part: you need to reseed the random function each time.)

Let the mathematicians fret about "true" random.

Cincinnatus28 Dec 2007 12:33 a.m. PST

I feel the same way. True random is not necesseary for us.

"Good enough for who it's for" comes to mind.

Ditto Tango 2 128 Dec 2007 5:18 a.m. PST

True random is not necesseary for us

Cinncinnatus, it actually is. Would you not be suspicious of a six sided die that seemed to roll a 6 more often than not? grin

Of course, the actual technical methods behind random number generation are not really necessary to be understood, but if someone is using Excel or Access or some other program to generate a random number, it's important to make sure one reads the help files or consults with a tech newsgroup or forum to make sure they use the available functions in the program of choice properly or you can end up with a "predictable" random number generator.

When a program seeded with the host processor time of day is compiled, is this a one time setting of the random number generator or does it update at each request for a new "roll" during run time?

It depends upon how the programming is set up. I use random numbers in MS Access/Oracle applications from time to time and here is the VBA code I usually use. Lines preceeded by ' are comments (similar to "rem" or :

Public Function fRoll_D100

'This function picks a random number from 1 to 100
'
'First, set current system time as seed
'for random number generator

Randomize

'Next, use the VBA Rnd function to generate a decimal
'number from more than zero to 1.
'The system algortihim for Rnd starts with a number
'provided by the Randomize command, above.

fRoll_D100 = Int((100 * Rnd) + 1)

'Error handling code omitted

End Function

The above generates a andom number from 1 to 100. Using the system clock as the source for the "seed", ie, the starting number that the random number generator, Rnd, uses to generate a number.

XRaysVision28 Dec 2007 9:25 a.m. PST

There are several "magic" algorithms that will generate numbers that can be used as random numbers. I should think that there would be one or two to be found in Knuth's "The Art of Computer Programming".

It is misleading to say that an algorithm "approaches" randomness. It does nothing of the kind. What it will do, is to increase the period period of repetition. That is to say a good random number algorithm might no repeat the sequence of numbers it produces for several billion iterations.

But others are quite correct in saying that such randomness is not required for our purposes. Using a built-in function in BASIC or a library function in C will quite suffice. Indeed this is what most people do when programming their little Fudge, D&D, T&T, TFT, etc. dice rolling applications.

What's more interesting to me, are the dice rollers applications that can also perform Monte Carlo simulations using the dice rolling functions and perform the calculations to predict the probability curve generated by rolling several different numbers of different faceted dice at the same time.

For more information on dice and how they act as well as a program that will generate probablilities go to: link

Bardolph28 Dec 2007 10:32 p.m. PST
Mark Plant29 Dec 2007 3:36 a.m. PST

It was designed to have a period of 2exp19937 − 1 (the creators of the algorithm proved this property). In practice, there is little reason to use larger ones, as most applications do not require 2exp19937 unique combinations (in decimal, 2exp19937 is approximately 4.315425 × 10exp6001).

I love the gentle "most applications do not require…"

XRaysVision29 Dec 2007 7:55 a.m. PST

That simply means that, unless you're the NSA, you probably don't need a less predictable pseudorandom generator. I doubt whether your opponent will be cracking be predicting the next interation of you dice roll so that they can foil your attempt to take over the world with your DBA army.

Truth is, while the technical discussion if fun for us software guys, for our gaming purposes, the built in functions of many programming languages, databases, and spreadsheets are just fine and dandy…of course one might virtually roll 2^19937 times with MT19937 just to see what happens….

Cincinnatus30 Dec 2007 9:52 a.m. PST

I agree. True randomness is not as easy to generate as some might think but the point is that it's not really important if the number is truely random as long as it's close enough for what we need.

Tim –

(Ignoring the complexity of generating a true random number)

What happens if the cpu is able to execute the code twice before the system clock can change? (Your seed value will be the same). So do you think your code generates a "true" random number? (nope, but still good enough for what you use it for I'm sure).

andygamer30 Dec 2007 9:06 p.m. PST

6

Terrement02 Jan 2008 2:37 p.m. PST

Andy,

Mine was a 3

Last Hussar13 Jan 2008 7:30 p.m. PST

Tim Marshall- how do you know that all those sequences of 6s aren't random. That's the problem with true random- eventually someone will roll 10,000 sixes on the trot (1:6^10,000 = 3.254646585493662058831844291325e+7781)

lol

Sorry - only verified members can post on the forums.