Random number selector? Where to start?

Hello, I’m making a pen and paper rpg and instead of rolling dice for damage, I want to build something that picks a random number in between two numbers. Kind of like programmable dice except you select two numbers, 0-9, and it will display a third number in between those two numbers.

I prefer something cost efficient due to the fact that other people will (hopefully) be buying this and I don’t want to risk losing potential customers due to high cost. With that notion, is beagleboard right for this type of project? If not, does anyone have any suggestions other than sticking with traditional dice rolling?

As you can probably guess, I know nothing on building electronics but I’m very much willing to learn.

If anyone can point me in the right direction that would be wonderful.

Look, you seem to be a programmer if you’re truly from Full Sail. What would you do to write a program like this on the PC ? The Beaglebone black is no different, with a few distinctions. THe BBB is small uses less power than a PC, and has potential to interact with the outside world via GPIO, I2C, SPI, UART, etc. Not to mention through USB, and ethernet as well.

Anyway, point being you can write this code on a PC for a PC, and port it over to the BBB easily. If you stay within stdlib, perhaps it will work on both platforms without modifications too.

After this, you know how much the BBB costs already. Would you pay that much, plus the cost of the software you’ve written for it yourself ?

It is probably safe to say however that this project could easily scale overboard into hundreds of dollars in hardware. On the same token however, outside of your time spent writing code, a project like this could also use ZERO additional hardware. It really depends on what you want in a device like this.

Either way, this is a project you need to research for yourself, or pay a consultant to figure out for you. Which is to say, probably a good idea that you start learning about electronics hardware for yourself. the programming part should come easy.

BBB for this is like a rocket launcher to kill a fly

Sure is, you could actually write an entire P&P like RPG, have the processor do the AI, Graphics etc, etc. Much like the older SSI gold box series games. With much much better graphics even. This platform has already been shown to run games like need for speed: shift reasonably well.

However, for easing into electronics, this would not be a bad start. The BBB as a platform I mean. Much better than Arduino IMHO.

Random pseudo number Generator could be made to run on something small like an MSP430G2553( 512 bytes RAM, 16kb Flash ), and still have plenty of code space left on the MCU.

Some MCU’s have a random number generator built into them so all you do is read a register.

On the BeagleBone, you should be able to use /dev/random, though the fewer peripherals it’s working with the less randomness it will be able to produce.

If this is a smaller MCU that has an ADC you can get randomness by reading the voltage across a noisy semiconductor junction like a zener diode. You’d have to do some testing to figure out how many of the ADC bits are truly random, and you may have to run the accumulation through some filters to get the distribution even.

I'm afraid that your best option here would be to write an android
app to do the rolling, and trust that in a gaming group there will
be at least one smartphone.

As somebody else said, the beaglebone is perfectly capable to do it,
but it is much more expensive than lots of things that are just
as able.

If it is going to be mass produced, IMHO your best opinion would be
to pay an engeneer to develop it using simple ICs: cost would be
< 1-2$ for every produced device, plus a biggish fixed fee
for the engeneer.

If you plan to sell a very small number of devices, an option would be
to develop something using an arduino and then create a standalone
board that includes the atmega IC. This is more expensive (where I
live it would be a bit more than 10 EUR in materials), takes more space
and *does not scale*, but it is quite easy to do with very little
electronic experience and could work if you believe you will
be able to sell maybe 100 pieces total, or less.

Between 100 pieces and mass production, I'm afraid your only cost
effective solution is the software one.

Eh, /dev/urandom; /dev/random tries hard to be really random and will
block if you use up all 'entropy' from random system events. urandom
is seeded from random and doesn't block.

Going to completely disagree with you there. Full Sail isn’t just a programming school. I was going there for Graphics Design. But enough of that. I thought about programming software to do this, but it would kind of defeat the purpose of pen and paper RPG’s in my opinion. I’ll just stick with traditional dice rolling.

On the BeagleBone, you should be able to use /dev/random, though the fewer peripherals it’s working with the less randomness it will be able to produce.

Doesn’t the bone have a hardware RNG source? is it not presently implimented in the present kernel code for /dev/random?


Simple project: Have a high-speed ( > 100kHz ) counter that wraps around at (i.e. modulo) your maximum number, and a push-button that latches and displays the number it’s at at the moment it is pressed. No programming needed and very random. Or use an AVR or PIC to do the same if you prefer.

I found a reference to some kind of RNG in the TI literature for the Sitara
chip in something called the "Backoff Test Register", but I couldn't find
any details of how it works and it looks like it's intended for
manufacturing testing only. Didn't find anything else searching for
"random" or "RNG".

Linux generally collects random data from external events like the time
disks takes to seek, timing keyboard key strikes or mouse clicks, packet
arrival timing, etc., and then mashes it all together to generate random
bytes in /dev/random. The less external, physical, inputs a cpu can
access, the less true randomness it can come up with.